initiate
This commit is contained in:
@@ -0,0 +1,104 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
/// <summary>
|
||||
/// 实施计划
|
||||
/// </summary>
|
||||
public static class ActionPlanListService
|
||||
{
|
||||
/// <summary>
|
||||
/// 根据主键获取实施计划
|
||||
/// </summary>
|
||||
/// <param name="actionPlanListId"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.ActionPlan_ActionPlanList GetActionPlanListById(string actionPlanListId)
|
||||
{
|
||||
return Funs.DB.ActionPlan_ActionPlanList.FirstOrDefault(e => e.ActionPlanListId == actionPlanListId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据日期获取实施计划集合
|
||||
/// </summary>
|
||||
/// <param name="startTime">开始时间</param>
|
||||
/// <param name="endTime">结束时间</param>
|
||||
/// <param name="projectId">项目号</param>
|
||||
/// <returns>实施计划集合</returns>
|
||||
public static List<Model.ActionPlan_ActionPlanList> GetActionPlanListsByDate(DateTime startTime, DateTime endTime, string projectId)
|
||||
{
|
||||
return (from x in Funs.DB.ActionPlan_ActionPlanList where x.CompileDate >= startTime && x.CompileDate <= endTime && x.ProjectId == projectId orderby x.CompileDate select x).ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加实施计划
|
||||
/// </summary>
|
||||
/// <param name="actionPlanList"></param>
|
||||
public static void AddActionPlanList(Model.ActionPlan_ActionPlanList actionPlanList)
|
||||
{
|
||||
Model.ActionPlan_ActionPlanList newActionPlanList = new Model.ActionPlan_ActionPlanList
|
||||
{
|
||||
ActionPlanListId = actionPlanList.ActionPlanListId,
|
||||
ProjectId = actionPlanList.ProjectId,
|
||||
ActionPlanListCode = actionPlanList.ActionPlanListCode,
|
||||
ActionPlanListName = actionPlanList.ActionPlanListName,
|
||||
VersionNo = actionPlanList.VersionNo,
|
||||
ProjectType = actionPlanList.ProjectType,
|
||||
ActionPlanListContents = actionPlanList.ActionPlanListContents,
|
||||
CompileMan = actionPlanList.CompileMan,
|
||||
CompileDate = actionPlanList.CompileDate,
|
||||
States = actionPlanList.States
|
||||
};
|
||||
Funs.DB.ActionPlan_ActionPlanList.InsertOnSubmit(newActionPlanList);
|
||||
Funs.DB.SubmitChanges();
|
||||
|
||||
////增加一条编码记录
|
||||
BLL.CodeRecordsService.InsertCodeRecordsByMenuIdProjectIdUnitId(BLL.Const.ProjectActionPlanListMenuId, newActionPlanList.ProjectId, null, newActionPlanList.ActionPlanListId, newActionPlanList.CompileDate);
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改实施计划
|
||||
/// </summary>
|
||||
/// <param name="actionPlanList"></param>
|
||||
public static void UpdateActionPlanList(Model.ActionPlan_ActionPlanList actionPlanList)
|
||||
{
|
||||
Model.ActionPlan_ActionPlanList newActionPlanList = Funs.DB.ActionPlan_ActionPlanList.FirstOrDefault(e => e.ActionPlanListId == actionPlanList.ActionPlanListId);
|
||||
if (newActionPlanList != null)
|
||||
{
|
||||
//newActionPlanList.ProjectId = actionPlanList.ProjectId;
|
||||
newActionPlanList.ActionPlanListCode = actionPlanList.ActionPlanListCode;
|
||||
newActionPlanList.ActionPlanListName = actionPlanList.ActionPlanListName;
|
||||
newActionPlanList.VersionNo = actionPlanList.VersionNo;
|
||||
newActionPlanList.ProjectType = actionPlanList.ProjectType;
|
||||
newActionPlanList.ActionPlanListContents = actionPlanList.ActionPlanListContents;
|
||||
newActionPlanList.CompileMan = actionPlanList.CompileMan;
|
||||
newActionPlanList.CompileDate = actionPlanList.CompileDate;
|
||||
newActionPlanList.States = actionPlanList.States;
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键删除实施计划
|
||||
/// </summary>
|
||||
/// <param name="actionPlanListId"></param>
|
||||
public static void DeleteActionPlanListById(string actionPlanListId)
|
||||
{
|
||||
Model.ActionPlan_ActionPlanList actionPlanList = Funs.DB.ActionPlan_ActionPlanList.FirstOrDefault(e => e.ActionPlanListId == actionPlanListId);
|
||||
if (actionPlanList != null)
|
||||
{
|
||||
////删除审核流程表
|
||||
BLL.CommonService.DeleteFlowOperateByID(actionPlanList.ActionPlanListId);
|
||||
///删除附件
|
||||
BLL.CommonService.DeleteAttachFileById(actionPlanListId);
|
||||
////删除编码表记录
|
||||
BLL.CodeRecordsService.DeleteCodeRecordsByDataId(actionPlanList.ActionPlanListId);
|
||||
Funs.DB.ActionPlan_ActionPlanList.DeleteOnSubmit(actionPlanList);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,100 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
/// <summary>
|
||||
/// 实施计划总结
|
||||
/// </summary>
|
||||
public static class ActionPlanSummaryService
|
||||
{
|
||||
/// <summary>
|
||||
/// 根据主键获取实施计划
|
||||
/// </summary>
|
||||
/// <param name="ActionPlanSummaryId"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.ActionPlan_ActionPlanSummary GetActionPlanSummaryById(string ActionPlanSummaryId)
|
||||
{
|
||||
return Funs.DB.ActionPlan_ActionPlanSummary.FirstOrDefault(e => e.ActionPlanSummaryId == ActionPlanSummaryId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据日期获取实施计划集合
|
||||
/// </summary>
|
||||
/// <param name="startTime">开始时间</param>
|
||||
/// <param name="endTime">结束时间</param>
|
||||
/// <param name="projectId">项目号</param>
|
||||
/// <returns>实施计划集合</returns>
|
||||
public static List<Model.ActionPlan_ActionPlanSummary> GetActionPlanSummarysByDate(DateTime startTime, DateTime endTime, string projectId)
|
||||
{
|
||||
return (from x in Funs.DB.ActionPlan_ActionPlanSummary where x.CompileDate >= startTime && x.CompileDate <= endTime && x.ProjectId == projectId orderby x.CompileDate select x).ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加实施计划
|
||||
/// </summary>
|
||||
/// <param name="ActionPlanSummary"></param>
|
||||
public static void AddActionPlanSummary(Model.ActionPlan_ActionPlanSummary ActionPlanSummary)
|
||||
{
|
||||
Model.ActionPlan_ActionPlanSummary newActionPlanSummary = new Model.ActionPlan_ActionPlanSummary
|
||||
{
|
||||
ActionPlanSummaryId = ActionPlanSummary.ActionPlanSummaryId,
|
||||
ProjectId = ActionPlanSummary.ProjectId,
|
||||
UnitId = ActionPlanSummary.UnitId,
|
||||
Code = ActionPlanSummary.Code,
|
||||
Name = ActionPlanSummary.Name,
|
||||
Contents = ActionPlanSummary.Contents,
|
||||
CompileMan = ActionPlanSummary.CompileMan,
|
||||
CompileDate = ActionPlanSummary.CompileDate,
|
||||
States = ActionPlanSummary.States
|
||||
};
|
||||
Funs.DB.ActionPlan_ActionPlanSummary.InsertOnSubmit(newActionPlanSummary);
|
||||
Funs.DB.SubmitChanges();
|
||||
|
||||
////增加一条编码记录
|
||||
BLL.CodeRecordsService.InsertCodeRecordsByMenuIdProjectIdUnitId(BLL.Const.ProjectActionPlanSummaryMenuId, newActionPlanSummary.ProjectId, null, newActionPlanSummary.ActionPlanSummaryId, newActionPlanSummary.CompileDate);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改实施计划
|
||||
/// </summary>
|
||||
/// <param name="ActionPlanSummary"></param>
|
||||
public static void UpdateActionPlanSummary(Model.ActionPlan_ActionPlanSummary ActionPlanSummary)
|
||||
{
|
||||
Model.ActionPlan_ActionPlanSummary newActionPlanSummary = Funs.DB.ActionPlan_ActionPlanSummary.FirstOrDefault(e => e.ActionPlanSummaryId == ActionPlanSummary.ActionPlanSummaryId);
|
||||
if (newActionPlanSummary != null)
|
||||
{
|
||||
newActionPlanSummary.UnitId = ActionPlanSummary.UnitId;
|
||||
newActionPlanSummary.Code = ActionPlanSummary.Code;
|
||||
newActionPlanSummary.Name = ActionPlanSummary.Name;
|
||||
newActionPlanSummary.Contents = ActionPlanSummary.Contents;
|
||||
newActionPlanSummary.CompileMan = ActionPlanSummary.CompileMan;
|
||||
newActionPlanSummary.CompileDate = ActionPlanSummary.CompileDate;
|
||||
newActionPlanSummary.States = ActionPlanSummary.States;
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键删除实施计划
|
||||
/// </summary>
|
||||
/// <param name="ActionPlanSummaryId"></param>
|
||||
public static void DeleteActionPlanSummaryById(string ActionPlanSummaryId)
|
||||
{
|
||||
Model.ActionPlan_ActionPlanSummary ActionPlanSummary = Funs.DB.ActionPlan_ActionPlanSummary.FirstOrDefault(e => e.ActionPlanSummaryId == ActionPlanSummaryId);
|
||||
if (ActionPlanSummary != null)
|
||||
{
|
||||
BLL.CommonService.DeleteAttachFileById(ActionPlanSummaryId);
|
||||
////删除审核流程表
|
||||
BLL.CommonService.DeleteFlowOperateByID(ActionPlanSummary.ActionPlanSummaryId);
|
||||
////删除编码表记录
|
||||
BLL.CodeRecordsService.DeleteCodeRecordsByDataId(ActionPlanSummary.ActionPlanSummaryId);
|
||||
Funs.DB.ActionPlan_ActionPlanSummary.DeleteOnSubmit(ActionPlanSummary);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,132 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
public static class ActionPlan_CompanyManagerRuleService
|
||||
{
|
||||
/// <summary>
|
||||
/// 根据主键获取管理规定
|
||||
/// </summary>
|
||||
/// <param name="manageRuleId"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.ActionPlan_CompanyManagerRule GetManagerRuleById(string managerRuleId)
|
||||
{
|
||||
return Funs.DB.ActionPlan_CompanyManagerRule.FirstOrDefault(e => e.ManagerRuleId == managerRuleId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据名称获取已发布管理规定的集合
|
||||
/// </summary>
|
||||
/// <param name="managerRuleName"></param>
|
||||
/// <returns></returns>
|
||||
public static List<Model.ActionPlan_CompanyManagerRule> GetIsIssueManagerRulesByName(string managerRuleName)
|
||||
{
|
||||
return (from x in Funs.DB.ActionPlan_CompanyManagerRule where x.ManageRuleName == managerRuleName && x.IsIssue == true orderby x.IssueDate select x).ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据日期获取管理规定集合
|
||||
/// </summary>
|
||||
/// <param name="startTime">开始时间</param>
|
||||
/// <param name="endTime">结束时间</param>
|
||||
/// <param name="projectId">项目号</param>
|
||||
/// <returns>管理规定集合</returns>
|
||||
public static List<Model.ActionPlan_CompanyManagerRule> GetManagerRuleListsByDate(DateTime startTime, DateTime endTime, string projectId)
|
||||
{
|
||||
return (from x in Funs.DB.ActionPlan_CompanyManagerRule where x.CompileDate >= startTime && x.CompileDate <= endTime && x.ProjectId == projectId orderby x.CompileDate select x).ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据整理人获取管理规定
|
||||
/// </summary>
|
||||
/// <param name="compileMan"></param>
|
||||
/// <returns></returns>
|
||||
public static List<Model.ActionPlan_CompanyManagerRule> GetManageRuleByCompileMan(string compileMan)
|
||||
{
|
||||
return (from x in Funs.DB.ActionPlan_CompanyManagerRule where x.CompileMan == compileMan select x).ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加管理规定
|
||||
/// </summary>
|
||||
/// <param name="manageRule"></param>
|
||||
public static void AddManageRule(Model.ActionPlan_CompanyManagerRule manageRule)
|
||||
{
|
||||
Model.ActionPlan_CompanyManagerRule newManageRule = new Model.ActionPlan_CompanyManagerRule
|
||||
{
|
||||
ManagerRuleId = manageRule.ManagerRuleId,
|
||||
ManageRuleCode = manageRule.ManageRuleCode,
|
||||
OldManageRuleId = manageRule.OldManageRuleId,
|
||||
ProjectId = manageRule.ProjectId,
|
||||
ManageRuleName = manageRule.ManageRuleName,
|
||||
ManageRuleTypeId = manageRule.ManageRuleTypeId,
|
||||
VersionNo = manageRule.VersionNo,
|
||||
AttachUrl = manageRule.AttachUrl,
|
||||
Remark = manageRule.Remark,
|
||||
CompileMan = manageRule.CompileMan,
|
||||
CompileDate = manageRule.CompileDate,
|
||||
Flag = manageRule.Flag,
|
||||
State = manageRule.State,
|
||||
SeeFile = manageRule.SeeFile
|
||||
};
|
||||
Funs.DB.ActionPlan_CompanyManagerRule.InsertOnSubmit(newManageRule);
|
||||
Funs.DB.SubmitChanges();
|
||||
|
||||
////增加一条编码记录
|
||||
BLL.CodeRecordsService.InsertCodeRecordsByMenuIdProjectIdUnitId(BLL.Const.ActionPlan_CompanyManagerRuleMenuId, manageRule.ProjectId, null, manageRule.ManagerRuleId, manageRule.CompileDate);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改管理规定
|
||||
/// </summary>
|
||||
/// <param name="manageRule"></param>
|
||||
public static void UpdateManageRule(Model.ActionPlan_CompanyManagerRule manageRule)
|
||||
{
|
||||
Model.ActionPlan_CompanyManagerRule newManageRule = Funs.DB.ActionPlan_CompanyManagerRule.FirstOrDefault(e => e.ManagerRuleId == manageRule.ManagerRuleId);
|
||||
if (newManageRule != null)
|
||||
{
|
||||
newManageRule.ManageRuleName = manageRule.ManageRuleName;
|
||||
newManageRule.ManageRuleTypeId = manageRule.ManageRuleTypeId;
|
||||
newManageRule.VersionNo = manageRule.VersionNo;
|
||||
newManageRule.AttachUrl = manageRule.AttachUrl;
|
||||
newManageRule.Remark = manageRule.Remark;
|
||||
newManageRule.CompileMan = manageRule.CompileMan;
|
||||
newManageRule.CompileDate = manageRule.CompileDate;
|
||||
newManageRule.IsIssue = manageRule.IsIssue;
|
||||
newManageRule.IssueDate = manageRule.IssueDate;
|
||||
newManageRule.Flag = manageRule.Flag;
|
||||
newManageRule.State = manageRule.State;
|
||||
newManageRule.SeeFile = manageRule.SeeFile;
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键删除管理规定
|
||||
/// </summary>
|
||||
/// <param name="manageRuleId"></param>
|
||||
public static void DeleteManageRuleById(string managerRuleId)
|
||||
{
|
||||
Model.ActionPlan_CompanyManagerRule manageRule = Funs.DB.ActionPlan_CompanyManagerRule.FirstOrDefault(e => e.ManagerRuleId == managerRuleId);
|
||||
if (manageRule != null)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(manageRule.AttachUrl))
|
||||
{
|
||||
BLL.UploadFileService.DeleteFile(Funs.RootPath, manageRule.AttachUrl);
|
||||
}
|
||||
///删除编码表记录
|
||||
CodeRecordsService.DeleteCodeRecordsByDataId(managerRuleId);
|
||||
////删除附件表
|
||||
CommonService.DeleteAttachFileById(manageRule.ManagerRuleId);
|
||||
////删除审核流程表
|
||||
CommonService.DeleteFlowOperateByID(manageRule.ManagerRuleId);
|
||||
Funs.DB.ActionPlan_CompanyManagerRule.DeleteOnSubmit(manageRule);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,134 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
/// <summary>
|
||||
/// 管理规定发布
|
||||
/// </summary>
|
||||
public static class ActionPlan_ManagerRuleService
|
||||
{
|
||||
/// <summary>
|
||||
/// 根据主键获取管理规定
|
||||
/// </summary>
|
||||
/// <param name="manageRuleId"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.ActionPlan_ManagerRule GetManagerRuleById(string managerRuleId)
|
||||
{
|
||||
return Funs.DB.ActionPlan_ManagerRule.FirstOrDefault(e => e.ManagerRuleId == managerRuleId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据名称获取已发布管理规定的集合
|
||||
/// </summary>
|
||||
/// <param name="managerRuleName"></param>
|
||||
/// <returns></returns>
|
||||
public static List<Model.ActionPlan_ManagerRule> GetIsIssueManagerRulesByName(string managerRuleName)
|
||||
{
|
||||
return (from x in Funs.DB.ActionPlan_ManagerRule where x.ManageRuleName == managerRuleName && x.IsIssue == true orderby x.IssueDate select x).ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据日期获取管理规定集合
|
||||
/// </summary>
|
||||
/// <param name="startTime">开始时间</param>
|
||||
/// <param name="endTime">结束时间</param>
|
||||
/// <param name="projectId">项目号</param>
|
||||
/// <returns>管理规定集合</returns>
|
||||
public static List<Model.ActionPlan_ManagerRule> GetManagerRuleListsByDate(DateTime startTime, DateTime endTime, string projectId)
|
||||
{
|
||||
return (from x in Funs.DB.ActionPlan_ManagerRule where x.CompileDate >= startTime && x.CompileDate <= endTime && x.ProjectId == projectId orderby x.CompileDate select x).ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据整理人获取管理规定
|
||||
/// </summary>
|
||||
/// <param name="compileMan"></param>
|
||||
/// <returns></returns>
|
||||
public static List<Model.ActionPlan_ManagerRule> GetManageRuleByCompileMan(string compileMan)
|
||||
{
|
||||
return (from x in Funs.DB.ActionPlan_ManagerRule where x.CompileMan == compileMan select x).ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加管理规定
|
||||
/// </summary>
|
||||
/// <param name="manageRule"></param>
|
||||
public static void AddManageRule(Model.ActionPlan_ManagerRule manageRule)
|
||||
{
|
||||
Model.ActionPlan_ManagerRule newManageRule = new Model.ActionPlan_ManagerRule
|
||||
{
|
||||
ManagerRuleId = manageRule.ManagerRuleId,
|
||||
ManageRuleCode = manageRule.ManageRuleCode,
|
||||
OldManageRuleId = manageRule.OldManageRuleId,
|
||||
ProjectId = manageRule.ProjectId,
|
||||
ManageRuleName = manageRule.ManageRuleName,
|
||||
ManageRuleTypeId = manageRule.ManageRuleTypeId,
|
||||
VersionNo = manageRule.VersionNo,
|
||||
AttachUrl = manageRule.AttachUrl,
|
||||
Remark = manageRule.Remark,
|
||||
CompileMan = manageRule.CompileMan,
|
||||
CompileDate = manageRule.CompileDate,
|
||||
Flag = manageRule.Flag,
|
||||
State = manageRule.State,
|
||||
SeeFile = manageRule.SeeFile
|
||||
};
|
||||
Funs.DB.ActionPlan_ManagerRule.InsertOnSubmit(newManageRule);
|
||||
Funs.DB.SubmitChanges();
|
||||
|
||||
////增加一条编码记录
|
||||
BLL.CodeRecordsService.InsertCodeRecordsByMenuIdProjectIdUnitId(BLL.Const.ActionPlan_ManagerRuleMenuId, manageRule.ProjectId, null, manageRule.ManagerRuleId, manageRule.CompileDate);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改管理规定
|
||||
/// </summary>
|
||||
/// <param name="manageRule"></param>
|
||||
public static void UpdateManageRule(Model.ActionPlan_ManagerRule manageRule)
|
||||
{
|
||||
Model.ActionPlan_ManagerRule newManageRule = Funs.DB.ActionPlan_ManagerRule.FirstOrDefault(e => e.ManagerRuleId == manageRule.ManagerRuleId);
|
||||
if (newManageRule != null)
|
||||
{
|
||||
newManageRule.ManageRuleName = manageRule.ManageRuleName;
|
||||
newManageRule.ManageRuleTypeId = manageRule.ManageRuleTypeId;
|
||||
newManageRule.VersionNo = manageRule.VersionNo;
|
||||
newManageRule.AttachUrl = manageRule.AttachUrl;
|
||||
newManageRule.Remark = manageRule.Remark;
|
||||
newManageRule.CompileMan = manageRule.CompileMan;
|
||||
newManageRule.CompileDate = manageRule.CompileDate;
|
||||
newManageRule.IsIssue = manageRule.IsIssue;
|
||||
newManageRule.IssueDate = manageRule.IssueDate;
|
||||
newManageRule.Flag = manageRule.Flag;
|
||||
newManageRule.State = manageRule.State;
|
||||
newManageRule.SeeFile = manageRule.SeeFile;
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键删除管理规定
|
||||
/// </summary>
|
||||
/// <param name="manageRuleId"></param>
|
||||
public static void DeleteManageRuleById(string managerRuleId)
|
||||
{
|
||||
Model.ActionPlan_ManagerRule manageRule = Funs.DB.ActionPlan_ManagerRule.FirstOrDefault(e => e.ManagerRuleId == managerRuleId);
|
||||
if (manageRule != null)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(manageRule.AttachUrl))
|
||||
{
|
||||
BLL.UploadFileService.DeleteFile(Funs.RootPath, manageRule.AttachUrl);
|
||||
}
|
||||
///删除编码表记录
|
||||
CodeRecordsService.DeleteCodeRecordsByDataId(managerRuleId);
|
||||
////删除附件表
|
||||
CommonService.DeleteAttachFileById(manageRule.ManagerRuleId);
|
||||
////删除审核流程表
|
||||
CommonService.DeleteFlowOperateByID(manageRule.ManagerRuleId);
|
||||
Funs.DB.ActionPlan_ManagerRule.DeleteOnSubmit(manageRule);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,131 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
public static class ActionPlan_ProjectManagerRuleService
|
||||
{
|
||||
/// <summary>
|
||||
/// 根据主键获取管理规定
|
||||
/// </summary>
|
||||
/// <param name="manageRuleId"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.ActionPlan_ProjectManagerRule GetManagerRuleById(string managerRuleId)
|
||||
{
|
||||
return Funs.DB.ActionPlan_ProjectManagerRule.FirstOrDefault(e => e.ManagerRuleId == managerRuleId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据名称获取已发布管理规定的集合
|
||||
/// </summary>
|
||||
/// <param name="managerRuleName"></param>
|
||||
/// <returns></returns>
|
||||
public static List<Model.ActionPlan_ProjectManagerRule> GetIsIssueManagerRulesByName(string managerRuleName)
|
||||
{
|
||||
return (from x in Funs.DB.ActionPlan_ProjectManagerRule where x.ManageRuleName == managerRuleName && x.IsIssue == true orderby x.IssueDate select x).ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据日期获取管理规定集合
|
||||
/// </summary>
|
||||
/// <param name="startTime">开始时间</param>
|
||||
/// <param name="endTime">结束时间</param>
|
||||
/// <param name="projectId">项目号</param>
|
||||
/// <returns>管理规定集合</returns>
|
||||
public static List<Model.ActionPlan_ProjectManagerRule> GetManagerRuleListsByDate(DateTime startTime, DateTime endTime, string projectId)
|
||||
{
|
||||
return (from x in Funs.DB.ActionPlan_ProjectManagerRule where x.CompileDate >= startTime && x.CompileDate <= endTime && x.ProjectId == projectId orderby x.CompileDate select x).ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据整理人获取管理规定
|
||||
/// </summary>
|
||||
/// <param name="compileMan"></param>
|
||||
/// <returns></returns>
|
||||
public static List<Model.ActionPlan_ProjectManagerRule> GetManageRuleByCompileMan(string compileMan)
|
||||
{
|
||||
return (from x in Funs.DB.ActionPlan_ProjectManagerRule where x.CompileMan == compileMan select x).ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加管理规定
|
||||
/// </summary>
|
||||
/// <param name="manageRule"></param>
|
||||
public static void AddManageRule(Model.ActionPlan_ProjectManagerRule manageRule)
|
||||
{
|
||||
Model.ActionPlan_ProjectManagerRule newManageRule = new Model.ActionPlan_ProjectManagerRule
|
||||
{
|
||||
ManagerRuleId = manageRule.ManagerRuleId,
|
||||
ManageRuleCode = manageRule.ManageRuleCode,
|
||||
ProjectId = manageRule.ProjectId,
|
||||
ManageRuleName = manageRule.ManageRuleName,
|
||||
ManageRuleTypeId = manageRule.ManageRuleTypeId,
|
||||
VersionNo = manageRule.VersionNo,
|
||||
AttachUrl = manageRule.AttachUrl,
|
||||
Remark = manageRule.Remark,
|
||||
CompileMan = manageRule.CompileMan,
|
||||
CompileDate = manageRule.CompileDate,
|
||||
Flag = manageRule.Flag,
|
||||
State = manageRule.State,
|
||||
SeeFile = manageRule.SeeFile
|
||||
};
|
||||
Funs.DB.ActionPlan_ProjectManagerRule.InsertOnSubmit(newManageRule);
|
||||
Funs.DB.SubmitChanges();
|
||||
|
||||
////增加一条编码记录
|
||||
BLL.CodeRecordsService.InsertCodeRecordsByMenuIdProjectIdUnitId(BLL.Const.ActionPlan_ProjectManagerRuleMenuId, manageRule.ProjectId, null, manageRule.ManagerRuleId, manageRule.CompileDate);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改管理规定
|
||||
/// </summary>
|
||||
/// <param name="manageRule"></param>
|
||||
public static void UpdateManageRule(Model.ActionPlan_ProjectManagerRule manageRule)
|
||||
{
|
||||
Model.ActionPlan_ProjectManagerRule newManageRule = Funs.DB.ActionPlan_ProjectManagerRule.FirstOrDefault(e => e.ManagerRuleId == manageRule.ManagerRuleId);
|
||||
if (newManageRule != null)
|
||||
{
|
||||
newManageRule.ManageRuleName = manageRule.ManageRuleName;
|
||||
newManageRule.ManageRuleTypeId = manageRule.ManageRuleTypeId;
|
||||
newManageRule.VersionNo = manageRule.VersionNo;
|
||||
newManageRule.AttachUrl = manageRule.AttachUrl;
|
||||
newManageRule.Remark = manageRule.Remark;
|
||||
newManageRule.CompileMan = manageRule.CompileMan;
|
||||
newManageRule.CompileDate = manageRule.CompileDate;
|
||||
newManageRule.IsIssue = manageRule.IsIssue;
|
||||
newManageRule.IssueDate = manageRule.IssueDate;
|
||||
newManageRule.Flag = manageRule.Flag;
|
||||
newManageRule.State = manageRule.State;
|
||||
newManageRule.SeeFile = manageRule.SeeFile;
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键删除管理规定
|
||||
/// </summary>
|
||||
/// <param name="manageRuleId"></param>
|
||||
public static void DeleteManageRuleById(string managerRuleId)
|
||||
{
|
||||
Model.ActionPlan_ProjectManagerRule manageRule = Funs.DB.ActionPlan_ProjectManagerRule.FirstOrDefault(e => e.ManagerRuleId == managerRuleId);
|
||||
if (manageRule != null)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(manageRule.AttachUrl))
|
||||
{
|
||||
BLL.UploadFileService.DeleteFile(Funs.RootPath, manageRule.AttachUrl);
|
||||
}
|
||||
///删除编码表记录
|
||||
CodeRecordsService.DeleteCodeRecordsByDataId(managerRuleId);
|
||||
////删除附件表
|
||||
CommonService.DeleteAttachFileById(manageRule.ManagerRuleId);
|
||||
////删除审核流程表
|
||||
CommonService.DeleteFlowOperateByID(manageRule.ManagerRuleId);
|
||||
Funs.DB.ActionPlan_ProjectManagerRule.DeleteOnSubmit(manageRule);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,131 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
public static class ActionPlan_SubManagerRuleService
|
||||
{
|
||||
/// <summary>
|
||||
/// 根据主键获取管理规定
|
||||
/// </summary>
|
||||
/// <param name="manageRuleId"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.ActionPlan_SubManagerRule GetManagerRuleById(string managerRuleId)
|
||||
{
|
||||
return Funs.DB.ActionPlan_SubManagerRule.FirstOrDefault(e => e.ManagerRuleId == managerRuleId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据名称获取已发布管理规定的集合
|
||||
/// </summary>
|
||||
/// <param name="managerRuleName"></param>
|
||||
/// <returns></returns>
|
||||
public static List<Model.ActionPlan_SubManagerRule> GetIsIssueManagerRulesByName(string managerRuleName)
|
||||
{
|
||||
return (from x in Funs.DB.ActionPlan_SubManagerRule where x.ManageRuleName == managerRuleName && x.IsIssue == true orderby x.IssueDate select x).ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据日期获取管理规定集合
|
||||
/// </summary>
|
||||
/// <param name="startTime">开始时间</param>
|
||||
/// <param name="endTime">结束时间</param>
|
||||
/// <param name="projectId">项目号</param>
|
||||
/// <returns>管理规定集合</returns>
|
||||
public static List<Model.ActionPlan_SubManagerRule> GetManagerRuleListsByDate(DateTime startTime, DateTime endTime, string projectId)
|
||||
{
|
||||
return (from x in Funs.DB.ActionPlan_SubManagerRule where x.CompileDate >= startTime && x.CompileDate <= endTime && x.ProjectId == projectId orderby x.CompileDate select x).ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据整理人获取管理规定
|
||||
/// </summary>
|
||||
/// <param name="compileMan"></param>
|
||||
/// <returns></returns>
|
||||
public static List<Model.ActionPlan_SubManagerRule> GetManageRuleByCompileMan(string compileMan)
|
||||
{
|
||||
return (from x in Funs.DB.ActionPlan_SubManagerRule where x.CompileMan == compileMan select x).ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加管理规定
|
||||
/// </summary>
|
||||
/// <param name="manageRule"></param>
|
||||
public static void AddManageRule(Model.ActionPlan_SubManagerRule manageRule)
|
||||
{
|
||||
Model.ActionPlan_SubManagerRule newManageRule = new Model.ActionPlan_SubManagerRule
|
||||
{
|
||||
ManagerRuleId = manageRule.ManagerRuleId,
|
||||
ManageRuleCode = manageRule.ManageRuleCode,
|
||||
ProjectId = manageRule.ProjectId,
|
||||
ManageRuleName = manageRule.ManageRuleName,
|
||||
ManageRuleTypeId = manageRule.ManageRuleTypeId,
|
||||
VersionNo = manageRule.VersionNo,
|
||||
AttachUrl = manageRule.AttachUrl,
|
||||
Remark = manageRule.Remark,
|
||||
CompileMan = manageRule.CompileMan,
|
||||
CompileDate = manageRule.CompileDate,
|
||||
Flag = manageRule.Flag,
|
||||
State = manageRule.State,
|
||||
SeeFile = manageRule.SeeFile
|
||||
};
|
||||
Funs.DB.ActionPlan_SubManagerRule.InsertOnSubmit(newManageRule);
|
||||
Funs.DB.SubmitChanges();
|
||||
|
||||
////增加一条编码记录
|
||||
BLL.CodeRecordsService.InsertCodeRecordsByMenuIdProjectIdUnitId(BLL.Const.ActionPlan_SubManagerRuleMenuId, manageRule.ProjectId, null, manageRule.ManagerRuleId, manageRule.CompileDate);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改管理规定
|
||||
/// </summary>
|
||||
/// <param name="manageRule"></param>
|
||||
public static void UpdateManageRule(Model.ActionPlan_SubManagerRule manageRule)
|
||||
{
|
||||
Model.ActionPlan_SubManagerRule newManageRule = Funs.DB.ActionPlan_SubManagerRule.FirstOrDefault(e => e.ManagerRuleId == manageRule.ManagerRuleId);
|
||||
if (newManageRule != null)
|
||||
{
|
||||
newManageRule.ManageRuleName = manageRule.ManageRuleName;
|
||||
newManageRule.ManageRuleTypeId = manageRule.ManageRuleTypeId;
|
||||
newManageRule.VersionNo = manageRule.VersionNo;
|
||||
newManageRule.AttachUrl = manageRule.AttachUrl;
|
||||
newManageRule.Remark = manageRule.Remark;
|
||||
newManageRule.CompileMan = manageRule.CompileMan;
|
||||
newManageRule.CompileDate = manageRule.CompileDate;
|
||||
newManageRule.IsIssue = manageRule.IsIssue;
|
||||
newManageRule.IssueDate = manageRule.IssueDate;
|
||||
newManageRule.Flag = manageRule.Flag;
|
||||
newManageRule.State = manageRule.State;
|
||||
newManageRule.SeeFile = manageRule.SeeFile;
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键删除管理规定
|
||||
/// </summary>
|
||||
/// <param name="manageRuleId"></param>
|
||||
public static void DeleteManageRuleById(string managerRuleId)
|
||||
{
|
||||
Model.ActionPlan_SubManagerRule manageRule = Funs.DB.ActionPlan_SubManagerRule.FirstOrDefault(e => e.ManagerRuleId == managerRuleId);
|
||||
if (manageRule != null)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(manageRule.AttachUrl))
|
||||
{
|
||||
BLL.UploadFileService.DeleteFile(Funs.RootPath, manageRule.AttachUrl);
|
||||
}
|
||||
///删除编码表记录
|
||||
CodeRecordsService.DeleteCodeRecordsByDataId(managerRuleId);
|
||||
////删除附件表
|
||||
CommonService.DeleteAttachFileById(manageRule.ManagerRuleId);
|
||||
////删除审核流程表
|
||||
CommonService.DeleteFlowOperateByID(manageRule.ManagerRuleId);
|
||||
Funs.DB.ActionPlan_SubManagerRule.DeleteOnSubmit(manageRule);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user