first commit
This commit is contained in:
@@ -0,0 +1,203 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
public class HSSEStandardsListService
|
||||
{
|
||||
public static Model.SGGLDB db = Funs.DB;
|
||||
|
||||
/// <summary>
|
||||
/// 根据id查询标准规范信息
|
||||
/// </summary>
|
||||
/// <param name="groupId"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.Law_HSSEStandardsList GetHSSEStandardsListByHSSEStandardsListId(string standardId)
|
||||
{
|
||||
return Funs.DB.Law_HSSEStandardsList.FirstOrDefault(e => e.StandardId == standardId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据上传人获取标准规范
|
||||
/// </summary>
|
||||
/// <param name="compileMan"></param>
|
||||
/// <returns></returns>
|
||||
public static List<Model.Law_HSSEStandardsList> GetHSSEStandardsListByCompileMan(string compileMan)
|
||||
{
|
||||
return (from x in Funs.DB.Law_HSSEStandardsList where x.CompileMan == compileMan select x).ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加标准规范信息
|
||||
/// </summary>
|
||||
/// <param name="?"></param>
|
||||
public static void AddHSSEStandardsList(Model.Law_HSSEStandardsList hSSEStandardsList)
|
||||
{
|
||||
Model.Law_HSSEStandardsList newHSSEStandardsList = new Model.Law_HSSEStandardsList
|
||||
{
|
||||
StandardId = hSSEStandardsList.StandardId,
|
||||
StandardGrade = hSSEStandardsList.StandardGrade,
|
||||
StandardNo = hSSEStandardsList.StandardNo,
|
||||
StandardName = hSSEStandardsList.StandardName,
|
||||
TypeId = hSSEStandardsList.TypeId,
|
||||
AttachUrl = hSSEStandardsList.AttachUrl,
|
||||
IsSelected1 = hSSEStandardsList.IsSelected1,
|
||||
IsSelected2 = hSSEStandardsList.IsSelected2,
|
||||
IsSelected3 = hSSEStandardsList.IsSelected3,
|
||||
IsSelected4 = hSSEStandardsList.IsSelected4,
|
||||
IsSelected5 = hSSEStandardsList.IsSelected5,
|
||||
IsSelected6 = hSSEStandardsList.IsSelected6,
|
||||
IsSelected7 = hSSEStandardsList.IsSelected7,
|
||||
IsSelected8 = hSSEStandardsList.IsSelected8,
|
||||
IsSelected9 = hSSEStandardsList.IsSelected9,
|
||||
IsSelected10 = hSSEStandardsList.IsSelected10,
|
||||
IsSelected11 = hSSEStandardsList.IsSelected11,
|
||||
IsSelected12 = hSSEStandardsList.IsSelected12,
|
||||
IsSelected13 = hSSEStandardsList.IsSelected13,
|
||||
IsSelected14 = hSSEStandardsList.IsSelected14,
|
||||
IsSelected15 = hSSEStandardsList.IsSelected15,
|
||||
IsSelected16 = hSSEStandardsList.IsSelected16,
|
||||
IsSelected17 = hSSEStandardsList.IsSelected17,
|
||||
IsSelected18 = hSSEStandardsList.IsSelected18,
|
||||
IsSelected19 = hSSEStandardsList.IsSelected19,
|
||||
IsSelected20 = hSSEStandardsList.IsSelected20,
|
||||
IsSelected21 = hSSEStandardsList.IsSelected21,
|
||||
IsSelected22 = hSSEStandardsList.IsSelected22,
|
||||
IsSelected23 = hSSEStandardsList.IsSelected23,
|
||||
IsSelected24 = hSSEStandardsList.IsSelected24,
|
||||
IsSelected25 = hSSEStandardsList.IsSelected25,
|
||||
IsSelected90 = hSSEStandardsList.IsSelected90,
|
||||
CompileMan = hSSEStandardsList.CompileMan,
|
||||
CompileDate = hSSEStandardsList.CompileDate,
|
||||
IsPass = hSSEStandardsList.IsPass,
|
||||
UnitId = hSSEStandardsList.UnitId,
|
||||
UpState = hSSEStandardsList.UpState,
|
||||
IsBuild = false
|
||||
};
|
||||
Funs.DB.Law_HSSEStandardsList.InsertOnSubmit(newHSSEStandardsList);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改标准规范信息
|
||||
/// </summary>
|
||||
/// <param name="teamGroup"></param>
|
||||
public static void UpdateHSSEStandardsList(Model.Law_HSSEStandardsList hSSEStandardsList)
|
||||
{
|
||||
Model.Law_HSSEStandardsList newHSSEStandardsList = Funs.DB.Law_HSSEStandardsList.FirstOrDefault(e => e.StandardId == hSSEStandardsList.StandardId);
|
||||
if (newHSSEStandardsList != null)
|
||||
{
|
||||
newHSSEStandardsList.StandardGrade = hSSEStandardsList.StandardGrade;
|
||||
newHSSEStandardsList.StandardNo = hSSEStandardsList.StandardNo;
|
||||
newHSSEStandardsList.StandardName = hSSEStandardsList.StandardName;
|
||||
newHSSEStandardsList.TypeId = hSSEStandardsList.TypeId;
|
||||
newHSSEStandardsList.AttachUrl = hSSEStandardsList.AttachUrl;
|
||||
newHSSEStandardsList.IsSelected1 = hSSEStandardsList.IsSelected1;
|
||||
newHSSEStandardsList.IsSelected2 = hSSEStandardsList.IsSelected2;
|
||||
newHSSEStandardsList.IsSelected3 = hSSEStandardsList.IsSelected3;
|
||||
newHSSEStandardsList.IsSelected4 = hSSEStandardsList.IsSelected4;
|
||||
newHSSEStandardsList.IsSelected5 = hSSEStandardsList.IsSelected5;
|
||||
newHSSEStandardsList.IsSelected6 = hSSEStandardsList.IsSelected6;
|
||||
newHSSEStandardsList.IsSelected7 = hSSEStandardsList.IsSelected7;
|
||||
newHSSEStandardsList.IsSelected8 = hSSEStandardsList.IsSelected8;
|
||||
newHSSEStandardsList.IsSelected9 = hSSEStandardsList.IsSelected9;
|
||||
newHSSEStandardsList.IsSelected10 = hSSEStandardsList.IsSelected10;
|
||||
newHSSEStandardsList.IsSelected11 = hSSEStandardsList.IsSelected11;
|
||||
newHSSEStandardsList.IsSelected12 = hSSEStandardsList.IsSelected12;
|
||||
newHSSEStandardsList.IsSelected13 = hSSEStandardsList.IsSelected13;
|
||||
newHSSEStandardsList.IsSelected14 = hSSEStandardsList.IsSelected14;
|
||||
newHSSEStandardsList.IsSelected15 = hSSEStandardsList.IsSelected15;
|
||||
newHSSEStandardsList.IsSelected16 = hSSEStandardsList.IsSelected16;
|
||||
newHSSEStandardsList.IsSelected17 = hSSEStandardsList.IsSelected17;
|
||||
newHSSEStandardsList.IsSelected18 = hSSEStandardsList.IsSelected18;
|
||||
newHSSEStandardsList.IsSelected19 = hSSEStandardsList.IsSelected19;
|
||||
newHSSEStandardsList.IsSelected20 = hSSEStandardsList.IsSelected20;
|
||||
newHSSEStandardsList.IsSelected21 = hSSEStandardsList.IsSelected21;
|
||||
newHSSEStandardsList.IsSelected22 = hSSEStandardsList.IsSelected22;
|
||||
newHSSEStandardsList.IsSelected23 = hSSEStandardsList.IsSelected23;
|
||||
newHSSEStandardsList.IsSelected24 = hSSEStandardsList.IsSelected24;
|
||||
newHSSEStandardsList.IsSelected25 = hSSEStandardsList.IsSelected25;
|
||||
newHSSEStandardsList.IsSelected90 = hSSEStandardsList.IsSelected90;
|
||||
newHSSEStandardsList.UpState = hSSEStandardsList.UpState;
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改标准规范 是否采用
|
||||
/// </summary>
|
||||
/// <param name="lawRegulationList"></param>
|
||||
public static void UpdateHSSEStandardsListIsPass(Model.Law_HSSEStandardsList standardsList)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.Law_HSSEStandardsList newHSSEStandardsList = db.Law_HSSEStandardsList.FirstOrDefault(e => e.StandardId == standardsList.StandardId);
|
||||
if (newHSSEStandardsList != null)
|
||||
{
|
||||
newHSSEStandardsList.AuditMan = standardsList.AuditMan;
|
||||
newHSSEStandardsList.AuditDate = standardsList.AuditDate;
|
||||
newHSSEStandardsList.IsPass = standardsList.IsPass;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 是否存在标准规范编号
|
||||
/// </summary>
|
||||
/// <param name="EDU_Code"></param>
|
||||
/// <returns>true-存在,false-不存在</returns>
|
||||
public static bool IsExistStandardName(string standardName)
|
||||
{
|
||||
var q = from x in Funs.DB.Law_HSSEStandardsList where x.StandardName == standardName select x;
|
||||
if (q.Count() > 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 是否存在标准规范编号
|
||||
/// </summary>
|
||||
/// <param name="EDU_Code"></param>
|
||||
/// <returns>true-存在,false-不存在</returns>
|
||||
public static bool IsExistStandardNo(string standardNo)
|
||||
{
|
||||
var q = from x in Funs.DB.Law_HSSEStandardsList where x.StandardNo == standardNo select x;
|
||||
if (q.Count() > 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 删除标准规范信息
|
||||
/// </summary>
|
||||
/// <param name="EDU_ID"></param>
|
||||
public static void DeleteHSSEStandardsList(string standardId)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.Law_HSSEStandardsList hSSEStandardsList = db.Law_HSSEStandardsList.FirstOrDefault(e => e.StandardId == standardId);
|
||||
if (hSSEStandardsList != null)
|
||||
{
|
||||
//if (!string.IsNullOrEmpty(hSSEStandardsList.AttachUrl))
|
||||
//{
|
||||
// UploadFileService.DeleteFile(Funs.RootPath, hSSEStandardsList.AttachUrl);
|
||||
//}
|
||||
|
||||
////删除附件表
|
||||
// BLL.CommonService.DeleteAttachFileById(hSSEStandardsList.StandardId);
|
||||
|
||||
db.Law_HSSEStandardsList.DeleteOnSubmit(hSSEStandardsList);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,136 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
/// <summary>
|
||||
/// 法律法规表
|
||||
/// </summary>
|
||||
public static class LawRegulationListService
|
||||
{
|
||||
public static Model.SGGLDB db = Funs.DB;
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键获取法律法规
|
||||
/// </summary>
|
||||
/// <param name="lawRegulationId"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.Law_LawRegulationList GetLawRegulationListById(string lawRegulationId)
|
||||
{
|
||||
return Funs.DB.Law_LawRegulationList.FirstOrDefault(e => e.LawRegulationId == lawRegulationId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键获取法律法规
|
||||
/// </summary>
|
||||
/// <param name="lawRegulationId"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.View_Law_LawRegulationList GetViewLawRegulationListById(string lawRegulationId)
|
||||
{
|
||||
return Funs.DB.View_Law_LawRegulationList.FirstOrDefault(e => e.LawRegulationId == lawRegulationId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据编制人获取法律法规
|
||||
/// </summary>
|
||||
/// <param name="lawRegulationId"></param>
|
||||
/// <returns></returns>
|
||||
public static List<Model.Law_LawRegulationList> GetLawRegulationListByCompileMan(string compileMan)
|
||||
{
|
||||
return (from x in Funs.DB.Law_LawRegulationList where x.CompileMan== compileMan select x).ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加法律法规
|
||||
/// </summary>
|
||||
/// <param name="lawRegulationList"></param>
|
||||
public static void AddLawRegulationList(Model.Law_LawRegulationList lawRegulationList)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.Law_LawRegulationList newLawRegulationList = new Model.Law_LawRegulationList
|
||||
{
|
||||
LawRegulationId = lawRegulationList.LawRegulationId,
|
||||
LawRegulationCode = lawRegulationList.LawRegulationCode,
|
||||
LawRegulationName = lawRegulationList.LawRegulationName,
|
||||
ApprovalDate = lawRegulationList.ApprovalDate,
|
||||
EffectiveDate = lawRegulationList.EffectiveDate,
|
||||
Description = lawRegulationList.Description,
|
||||
AttachUrl = lawRegulationList.AttachUrl,
|
||||
LawsRegulationsTypeId = lawRegulationList.LawsRegulationsTypeId,
|
||||
CompileMan = lawRegulationList.CompileMan,
|
||||
CompileDate = lawRegulationList.CompileDate,
|
||||
UnitId = lawRegulationList.UnitId,
|
||||
IsPass = lawRegulationList.IsPass,
|
||||
UpState = lawRegulationList.UpState,
|
||||
IsBuild = false
|
||||
};
|
||||
db.Law_LawRegulationList.InsertOnSubmit(newLawRegulationList);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改法律法规
|
||||
/// </summary>
|
||||
/// <param name="lawRegulationList"></param>
|
||||
public static void UpdateLawRegulationList(Model.Law_LawRegulationList lawRegulationList)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.Law_LawRegulationList newLawRegulationList = db.Law_LawRegulationList.FirstOrDefault(e => e.LawRegulationId == lawRegulationList.LawRegulationId);
|
||||
if (newLawRegulationList != null)
|
||||
{
|
||||
newLawRegulationList.LawRegulationCode = lawRegulationList.LawRegulationCode;
|
||||
newLawRegulationList.LawRegulationName = lawRegulationList.LawRegulationName;
|
||||
newLawRegulationList.ApprovalDate = lawRegulationList.ApprovalDate;
|
||||
newLawRegulationList.EffectiveDate = lawRegulationList.EffectiveDate;
|
||||
newLawRegulationList.Description = lawRegulationList.Description;
|
||||
newLawRegulationList.AttachUrl = lawRegulationList.AttachUrl;
|
||||
newLawRegulationList.LawsRegulationsTypeId = lawRegulationList.LawsRegulationsTypeId;
|
||||
newLawRegulationList.UpState = lawRegulationList.UpState;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改法律法规 是否采用
|
||||
/// </summary>
|
||||
/// <param name="lawRegulationList"></param>
|
||||
public static void UpdateLawRegulationListIsPass(Model.Law_LawRegulationList lawRegulationList)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.Law_LawRegulationList newLawRegulationList = db.Law_LawRegulationList.FirstOrDefault(e => e.LawRegulationId == lawRegulationList.LawRegulationId);
|
||||
if (newLawRegulationList != null)
|
||||
{
|
||||
newLawRegulationList.AuditMan = lawRegulationList.AuditMan;
|
||||
newLawRegulationList.AuditDate = lawRegulationList.AuditDate;
|
||||
newLawRegulationList.IsPass = lawRegulationList.IsPass;
|
||||
newLawRegulationList.UpState = lawRegulationList.UpState;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///根据主键删除法律法规
|
||||
/// </summary>
|
||||
/// <param name="lawRegulationId"></param>
|
||||
public static void DeleteLawRegulationListById(string lawRegulationId)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.Law_LawRegulationList lawRegulationList = db.Law_LawRegulationList.FirstOrDefault(e => e.LawRegulationId == lawRegulationId);
|
||||
if (lawRegulationList!=null)
|
||||
{
|
||||
//if (!string.IsNullOrEmpty(lawRegulationList.AttachUrl))
|
||||
//{
|
||||
// BLL.UploadFileService.DeleteFile(Funs.RootPath, lawRegulationList.AttachUrl);
|
||||
//}
|
||||
|
||||
////删除附件表
|
||||
// BLL.CommonService.DeleteAttachFileById(lawRegulationList.LawRegulationId);
|
||||
|
||||
db.Law_LawRegulationList.DeleteOnSubmit(lawRegulationList);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,126 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
/// <summary>
|
||||
/// 管理规定
|
||||
/// </summary>
|
||||
public static class ManageRuleService
|
||||
{
|
||||
public static Model.SGGLDB db = Funs.DB;
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键获取管理规定
|
||||
/// </summary>
|
||||
/// <param name="manageRuleId"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.Law_ManageRule GetManageRuleById(string manageRuleId)
|
||||
{
|
||||
return Funs.DB.Law_ManageRule.FirstOrDefault(e => e.ManageRuleId == manageRuleId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据整理人获取管理规定
|
||||
/// </summary>
|
||||
/// <param name="compileMan"></param>
|
||||
/// <returns></returns>
|
||||
public static List<Model.Law_ManageRule> GetManageRuleByCompileMan(string compileMan)
|
||||
{
|
||||
return (from x in Funs.DB.Law_ManageRule where x.CompileMan == compileMan select x).ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加管理规定
|
||||
/// </summary>
|
||||
/// <param name="manageRule"></param>
|
||||
public static void AddManageRule(Model.Law_ManageRule manageRule)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.Law_ManageRule newManageRule = new Model.Law_ManageRule
|
||||
{
|
||||
ManageRuleId = manageRule.ManageRuleId,
|
||||
ManageRuleCode = manageRule.ManageRuleCode,
|
||||
ManageRuleName = manageRule.ManageRuleName,
|
||||
ManageRuleTypeId = manageRule.ManageRuleTypeId,
|
||||
VersionNo = manageRule.VersionNo,
|
||||
AttachUrl = manageRule.AttachUrl,
|
||||
Remark = manageRule.Remark,
|
||||
CompileMan = manageRule.CompileMan,
|
||||
CompileDate = manageRule.CompileDate,
|
||||
IsPass = manageRule.IsPass,
|
||||
UnitId = manageRule.UnitId,
|
||||
UpState = manageRule.UpState,
|
||||
SeeFile = manageRule.SeeFile
|
||||
};
|
||||
db.Law_ManageRule.InsertOnSubmit(newManageRule);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改管理规定
|
||||
/// </summary>
|
||||
/// <param name="manageRule"></param>
|
||||
public static void UpdateManageRule(Model.Law_ManageRule manageRule)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.Law_ManageRule newManageRule = db.Law_ManageRule.FirstOrDefault(e => e.ManageRuleId == manageRule.ManageRuleId);
|
||||
if (newManageRule != null)
|
||||
{
|
||||
newManageRule.ManageRuleCode = manageRule.ManageRuleCode;
|
||||
newManageRule.ManageRuleName = manageRule.ManageRuleName;
|
||||
newManageRule.ManageRuleTypeId = manageRule.ManageRuleTypeId;
|
||||
newManageRule.VersionNo = manageRule.VersionNo;
|
||||
//newManageRule.CompileMan = manageRule.CompileMan;
|
||||
//newManageRule.CompileDate = manageRule.CompileDate;
|
||||
newManageRule.AttachUrl = manageRule.AttachUrl;
|
||||
newManageRule.Remark = manageRule.Remark;
|
||||
newManageRule.UpState = manageRule.UpState;
|
||||
newManageRule.SeeFile = manageRule.SeeFile;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改管理规定 是否采用
|
||||
/// </summary>
|
||||
/// <param name="manageRule"></param>
|
||||
public static void UpdateManageRuleIsPass(Model.Law_ManageRule manageRule)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.Law_ManageRule newManageRule = db.Law_ManageRule.FirstOrDefault(e => e.ManageRuleId == manageRule.ManageRuleId);
|
||||
if (newManageRule!=null)
|
||||
{
|
||||
newManageRule.IsPass = manageRule.IsPass;
|
||||
newManageRule.AuditMan = manageRule.AuditMan;
|
||||
newManageRule.AuditDate = manageRule.AuditDate;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键删除管理规定
|
||||
/// </summary>
|
||||
/// <param name="manageRuleId"></param>
|
||||
public static void DeleteManageRuleById(string manageRuleId)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.Law_ManageRule manageRule = db.Law_ManageRule.FirstOrDefault(e => e.ManageRuleId == manageRuleId);
|
||||
if (manageRule != null)
|
||||
{
|
||||
//if (!string.IsNullOrEmpty(manageRule.AttachUrl))
|
||||
//{
|
||||
// BLL.UploadFileService.DeleteFile(Funs.RootPath, manageRule.AttachUrl);
|
||||
//}
|
||||
|
||||
////删除附件表
|
||||
//BLL.CommonService.DeleteAttachFileById(manageRule.ManageRuleId);
|
||||
|
||||
db.Law_ManageRule.DeleteOnSubmit(manageRule);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,123 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
/// <summary>
|
||||
/// 安全生产规章制度表
|
||||
/// </summary>
|
||||
public static class RulesRegulationsService
|
||||
{
|
||||
public static Model.SGGLDB db = Funs.DB;
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键获取生产规章制度
|
||||
/// </summary>
|
||||
/// <param name="rulesRegulationsId"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.Law_RulesRegulations GetRulesRegulationsById(string rulesRegulationsId)
|
||||
{
|
||||
return Funs.DB.Law_RulesRegulations.FirstOrDefault(e => e.RulesRegulationsId == rulesRegulationsId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据编制人获取生产规章制度
|
||||
/// </summary>
|
||||
/// <param name="compileMan"></param>
|
||||
/// <returns></returns>
|
||||
public static List<Model.Law_RulesRegulations> GetRulesRegulationByCompileMan(string compileMan)
|
||||
{
|
||||
return (from x in Funs.DB.Law_RulesRegulations where x.CompileMan == compileMan select x).ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加生产规章制度
|
||||
/// </summary>
|
||||
/// <param name="rulesRegulations"></param>
|
||||
public static void AddRulesRegulations(Model.Law_RulesRegulations rulesRegulations)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.Law_RulesRegulations newRuleRegulations = new Model.Law_RulesRegulations
|
||||
{
|
||||
RulesRegulationsId = rulesRegulations.RulesRegulationsId,
|
||||
RulesRegulationsCode = rulesRegulations.RulesRegulationsCode,
|
||||
RulesRegulationsName = rulesRegulations.RulesRegulationsName,
|
||||
RulesRegulationsTypeId = rulesRegulations.RulesRegulationsTypeId,
|
||||
CustomDate = rulesRegulations.CustomDate,
|
||||
ApplicableScope = rulesRegulations.ApplicableScope,
|
||||
Remark = rulesRegulations.Remark,
|
||||
AttachUrl = rulesRegulations.AttachUrl,
|
||||
IsPass = rulesRegulations.IsPass,
|
||||
CompileMan = rulesRegulations.CompileMan,
|
||||
CompileDate = rulesRegulations.CompileDate,
|
||||
UnitId = rulesRegulations.UnitId,
|
||||
UpState = rulesRegulations.UpState
|
||||
};
|
||||
db.Law_RulesRegulations.InsertOnSubmit(newRuleRegulations);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改规章制度
|
||||
/// </summary>
|
||||
/// <param name="rulesRegulations"></param>
|
||||
public static void UpdateRulesRegulations(Model.Law_RulesRegulations rulesRegulations)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.Law_RulesRegulations newRuleRegulations = db.Law_RulesRegulations.FirstOrDefault(e => e.RulesRegulationsId == rulesRegulations.RulesRegulationsId);
|
||||
if (newRuleRegulations != null)
|
||||
{
|
||||
newRuleRegulations.RulesRegulationsCode = rulesRegulations.RulesRegulationsCode;
|
||||
newRuleRegulations.RulesRegulationsName = rulesRegulations.RulesRegulationsName;
|
||||
newRuleRegulations.RulesRegulationsTypeId = rulesRegulations.RulesRegulationsTypeId;
|
||||
newRuleRegulations.CustomDate = rulesRegulations.CustomDate;
|
||||
newRuleRegulations.ApplicableScope = rulesRegulations.ApplicableScope;
|
||||
newRuleRegulations.Remark = rulesRegulations.Remark;
|
||||
newRuleRegulations.AttachUrl = rulesRegulations.AttachUrl;
|
||||
newRuleRegulations.UpState = rulesRegulations.UpState;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改规章制度 是否采用
|
||||
/// </summary>
|
||||
/// <param name="rulesRegulations"></param>
|
||||
public static void UpdateRulesRegulationsIsPass(Model.Law_RulesRegulations rulesRegulations)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.Law_RulesRegulations newRuleRegulations = db.Law_RulesRegulations.FirstOrDefault(e => e.RulesRegulationsId == rulesRegulations.RulesRegulationsId);
|
||||
if (newRuleRegulations != null)
|
||||
{
|
||||
newRuleRegulations.AuditMan = rulesRegulations.AuditMan;
|
||||
newRuleRegulations.AuditDate = rulesRegulations.AuditDate;
|
||||
newRuleRegulations.IsPass = rulesRegulations.IsPass;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键删除规章制度
|
||||
/// </summary>
|
||||
/// <param name="ruleRegulationsId"></param>
|
||||
public static void DeleteRuleRegulationsById(string ruleRegulationsId)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.Law_RulesRegulations rulesRegulations = db.Law_RulesRegulations.FirstOrDefault(e => e.RulesRegulationsId == ruleRegulationsId);
|
||||
if (rulesRegulations != null)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(rulesRegulations.AttachUrl))
|
||||
{
|
||||
BLL.UploadFileService.DeleteFile(Funs.RootPath, rulesRegulations.AttachUrl);//删除附件
|
||||
}
|
||||
////删除附件表
|
||||
BLL.CommonService.DeleteAttachFileById(rulesRegulations.RulesRegulationsId);
|
||||
|
||||
db.Law_RulesRegulations.DeleteOnSubmit(rulesRegulations);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user