initproject
This commit is contained in:
@@ -0,0 +1,77 @@
|
||||
using System.Linq;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
/// <summary>
|
||||
/// 国内现行相关标准规范
|
||||
/// </summary>
|
||||
public static class FileControl_DomesticStandardsService
|
||||
{
|
||||
/// <summary>
|
||||
/// 根据主键获取国内现行相关标准规范
|
||||
/// </summary>
|
||||
/// <param name="domesticStandardsId"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.FileControl_DomesticStandards GetDomesticStandardsById(string domesticStandardsId)
|
||||
{
|
||||
return Funs.DB.FileControl_DomesticStandards.FirstOrDefault(e => e.DomesticStandardsId == domesticStandardsId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加国内现行相关标准规范
|
||||
/// </summary>
|
||||
/// <param name="domesticStandards"></param>
|
||||
public static void AddDomesticStandards(Model.FileControl_DomesticStandards domesticStandards)
|
||||
{
|
||||
Model.HJGLDB db = Funs.DB;
|
||||
Model.FileControl_DomesticStandards newDomesticStandards = new Model.FileControl_DomesticStandards();
|
||||
newDomesticStandards.DomesticStandardsId = domesticStandards.DomesticStandardsId;
|
||||
newDomesticStandards.DomesticStandardsCode = domesticStandards.DomesticStandardsCode;
|
||||
newDomesticStandards.DomesticStandardsName = domesticStandards.DomesticStandardsName;
|
||||
newDomesticStandards.Abstract = domesticStandards.Abstract;
|
||||
newDomesticStandards.CompileMan = domesticStandards.CompileMan;
|
||||
newDomesticStandards.CompileDate = domesticStandards.CompileDate;
|
||||
newDomesticStandards.Remarks = domesticStandards.Remarks;
|
||||
newDomesticStandards.AttachUrl = domesticStandards.AttachUrl;
|
||||
db.FileControl_DomesticStandards.InsertOnSubmit(newDomesticStandards);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改国内现行相关标准规范
|
||||
/// </summary>
|
||||
/// <param name="domesticStandards"></param>
|
||||
public static void UpdateDomesticStandards(Model.FileControl_DomesticStandards domesticStandards)
|
||||
{
|
||||
Model.HJGLDB db = Funs.DB;
|
||||
Model.FileControl_DomesticStandards newDomesticStandards = db.FileControl_DomesticStandards.FirstOrDefault(e => e.DomesticStandardsId == domesticStandards.DomesticStandardsId);
|
||||
if (newDomesticStandards != null)
|
||||
{
|
||||
newDomesticStandards.DomesticStandardsCode = domesticStandards.DomesticStandardsCode;
|
||||
newDomesticStandards.DomesticStandardsName = domesticStandards.DomesticStandardsName;
|
||||
newDomesticStandards.Abstract = domesticStandards.Abstract;
|
||||
newDomesticStandards.CompileMan = domesticStandards.CompileMan;
|
||||
newDomesticStandards.CompileDate = domesticStandards.CompileDate;
|
||||
newDomesticStandards.Remarks = domesticStandards.Remarks;
|
||||
newDomesticStandards.AttachUrl = domesticStandards.AttachUrl;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键删除国内现行相关标准规范
|
||||
/// </summary>
|
||||
/// <param name="domesticStandardsId"></param>
|
||||
public static void DeleteDomesticStandardsById(string domesticStandardsId)
|
||||
{
|
||||
Model.HJGLDB db = Funs.DB;
|
||||
Model.FileControl_DomesticStandards domesticStandards = db.FileControl_DomesticStandards.FirstOrDefault(e => e.DomesticStandardsId == domesticStandardsId);
|
||||
if (domesticStandards != null)
|
||||
{
|
||||
BLL.AttachFileService.DeleteAttachFile(Funs.RootPath, domesticStandardsId, Const.DomesticStandardsMenuId);//删除附件
|
||||
db.FileControl_DomesticStandards.DeleteOnSubmit(domesticStandards);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user