87 lines
4.8 KiB
C#
87 lines
4.8 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
|
|
namespace BLL
|
|
{
|
|
/// <summary>
|
|
/// 国内法律法规相关条款表
|
|
/// </summary>
|
|
public static class HJGL_FileControl_DomesticLawsRegulationsService
|
|
{
|
|
/// <summary>
|
|
/// 根据主键获取国内法律法规相关条款
|
|
/// </summary>
|
|
/// <param name="domesticLawsRegulationsId"></param>
|
|
/// <returns></returns>
|
|
public static Model.HJGL_FileControl_DomesticLawsRegulations GetDomesticLawsRegulationsById(string domesticLawsRegulationsId)
|
|
{
|
|
return Funs.DB.HJGL_FileControl_DomesticLawsRegulations.FirstOrDefault(e => e.DomesticLawsRegulationsId == domesticLawsRegulationsId);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 添加国内法律法规相关条款
|
|
/// </summary>
|
|
/// <param name="domesticLawsRegulations"></param>
|
|
public static void AddDomesticLawsRegulations(Model.HJGL_FileControl_DomesticLawsRegulations domesticLawsRegulations)
|
|
{
|
|
Model.SGGLDB db = Funs.DB;
|
|
Model.HJGL_FileControl_DomesticLawsRegulations newDomesticLawsRegulations = new Model.HJGL_FileControl_DomesticLawsRegulations();
|
|
newDomesticLawsRegulations.DomesticLawsRegulationsId = domesticLawsRegulations.DomesticLawsRegulationsId;
|
|
newDomesticLawsRegulations.DomesticLawsRegulationsCode = domesticLawsRegulations.DomesticLawsRegulationsCode;
|
|
newDomesticLawsRegulations.DomesticLawsRegulationsName = domesticLawsRegulations.DomesticLawsRegulationsName;
|
|
newDomesticLawsRegulations.Summary = domesticLawsRegulations.Summary;
|
|
newDomesticLawsRegulations.CompileDate = domesticLawsRegulations.CompileDate;
|
|
newDomesticLawsRegulations.AttachUrl = domesticLawsRegulations.AttachUrl;
|
|
newDomesticLawsRegulations.CompileMan = domesticLawsRegulations.CompileMan;
|
|
newDomesticLawsRegulations.CompileDate = domesticLawsRegulations.CompileDate;
|
|
newDomesticLawsRegulations.Remarks = domesticLawsRegulations.Remarks;
|
|
db.HJGL_FileControl_DomesticLawsRegulations.InsertOnSubmit(newDomesticLawsRegulations);
|
|
db.SubmitChanges();
|
|
}
|
|
|
|
/// <summary>
|
|
/// 修改国内法律法规相关条款
|
|
/// </summary>
|
|
/// <param name="domesticLawsRegulations"></param>
|
|
public static void UpdateDomesticLawsRegulations(Model.HJGL_FileControl_DomesticLawsRegulations domesticLawsRegulations)
|
|
{
|
|
Model.SGGLDB db = Funs.DB;
|
|
Model.HJGL_FileControl_DomesticLawsRegulations newDomesticLawsRegulations = db.HJGL_FileControl_DomesticLawsRegulations.FirstOrDefault(e => e.DomesticLawsRegulationsId == domesticLawsRegulations.DomesticLawsRegulationsId);
|
|
if (newDomesticLawsRegulations != null)
|
|
{
|
|
newDomesticLawsRegulations.DomesticLawsRegulationsCode = domesticLawsRegulations.DomesticLawsRegulationsCode;
|
|
newDomesticLawsRegulations.DomesticLawsRegulationsName = domesticLawsRegulations.DomesticLawsRegulationsName;
|
|
newDomesticLawsRegulations.Summary = domesticLawsRegulations.Summary;
|
|
newDomesticLawsRegulations.CompileDate = domesticLawsRegulations.CompileDate;
|
|
newDomesticLawsRegulations.AttachUrl = domesticLawsRegulations.AttachUrl;
|
|
newDomesticLawsRegulations.CompileMan = domesticLawsRegulations.CompileMan;
|
|
newDomesticLawsRegulations.CompileDate = domesticLawsRegulations.CompileDate;
|
|
newDomesticLawsRegulations.Remarks = domesticLawsRegulations.Remarks;
|
|
db.SubmitChanges();
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 根据主键删除国内法律法规相关条款
|
|
/// </summary>
|
|
/// <param name="domesticLawsRegulationsId"></param>
|
|
public static void DeleteDomesticLawsRegulationsById(string domesticLawsRegulationsId)
|
|
{
|
|
Model.SGGLDB db = Funs.DB;
|
|
Model.HJGL_FileControl_DomesticLawsRegulations DomesticLawsRegulations = db.HJGL_FileControl_DomesticLawsRegulations.FirstOrDefault(e => e.DomesticLawsRegulationsId == domesticLawsRegulationsId);
|
|
if (DomesticLawsRegulations != null)
|
|
{
|
|
if (!string.IsNullOrEmpty(DomesticLawsRegulations.AttachUrl))
|
|
{
|
|
BLL.UploadFileService.DeleteFile(Funs.RootPath, DomesticLawsRegulations.AttachUrl);//删除附件
|
|
}
|
|
|
|
BLL.AttachFileService.DeleteAttachFile(Funs.RootPath, domesticLawsRegulationsId, Const.HJGLServer_DomesticLawsRegulationsMenuId);//删除附件
|
|
db.HJGL_FileControl_DomesticLawsRegulations.DeleteOnSubmit(DomesticLawsRegulations);
|
|
db.SubmitChanges();
|
|
}
|
|
}
|
|
}
|
|
} |