fix:问题修改
This commit is contained in:
@@ -0,0 +1,96 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
namespace BLL;
|
||||
|
||||
public class AwardStandardsService
|
||||
{
|
||||
public static Model.SGGLDB db = Funs.DB;
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键获取
|
||||
/// </summary>
|
||||
/// <param name="AwardStandardsId"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.Technique_AwardStandards GetAwardStandardsListById(string AwardStandardsId)
|
||||
{
|
||||
return Funs.DB.Technique_AwardStandards.FirstOrDefault(e =>
|
||||
e.AwardStandardsId == AwardStandardsId);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 添加
|
||||
/// </summary>
|
||||
/// <param name="AwardStandardsList"></param>
|
||||
public static void AddAwardStandardsList(Model.Technique_AwardStandards AwardStandardsList)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.Technique_AwardStandards newAwardStandardsList = new Model.Technique_AwardStandards
|
||||
{
|
||||
AwardStandardsId = AwardStandardsList.AwardStandardsId,
|
||||
AwardStandardsCode = AwardStandardsList.AwardStandardsCode,
|
||||
AwardStandardsName = AwardStandardsList.AwardStandardsName,
|
||||
AttachUrl = AwardStandardsList.AttachUrl,
|
||||
CompileMan = AwardStandardsList.CompileMan,
|
||||
CompileDate = AwardStandardsList.CompileDate,
|
||||
};
|
||||
newAwardStandardsList.CompileMan = AwardStandardsList.CompileMan;
|
||||
newAwardStandardsList.CompileDate = AwardStandardsList.CompileDate;
|
||||
newAwardStandardsList.IsPass = AwardStandardsList.IsPass;
|
||||
newAwardStandardsList.UpState = AwardStandardsList.UpState;
|
||||
newAwardStandardsList.Remark = AwardStandardsList.Remark;
|
||||
db.Technique_AwardStandards.InsertOnSubmit(newAwardStandardsList);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改
|
||||
/// </summary>
|
||||
/// <param name="AwardStandardsList"></param>
|
||||
public static void UpdateAwardStandardsList(Model.Technique_AwardStandards AwardStandardsList)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.Technique_AwardStandards newAwardStandardsList =
|
||||
db.Technique_AwardStandards.FirstOrDefault(e =>
|
||||
e.AwardStandardsId == AwardStandardsList.AwardStandardsId);
|
||||
if (newAwardStandardsList != null)
|
||||
{
|
||||
newAwardStandardsList.AwardStandardsCode = AwardStandardsList.AwardStandardsCode;
|
||||
newAwardStandardsList.AwardStandardsName = AwardStandardsList.AwardStandardsName;
|
||||
newAwardStandardsList.AttachUrl = AwardStandardsList.AttachUrl;
|
||||
newAwardStandardsList.CompileMan = AwardStandardsList.CompileMan;
|
||||
newAwardStandardsList.CompileDate = AwardStandardsList.CompileDate;
|
||||
newAwardStandardsList.UpState = AwardStandardsList.UpState;
|
||||
newAwardStandardsList.Remark = AwardStandardsList.Remark;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
///根据主键删除
|
||||
/// </summary>
|
||||
/// <param name="AwardStandardsId"></param>
|
||||
public static void DeleteAwardStandardsListById(string AwardStandardsId)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.Technique_AwardStandards AwardStandardsList =
|
||||
db.Technique_AwardStandards.FirstOrDefault(e => e.AwardStandardsId == AwardStandardsId);
|
||||
if (AwardStandardsList != null)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(AwardStandardsList.AttachUrl))
|
||||
{
|
||||
BLL.UploadFileService.DeleteFile(Funs.RootPath, AwardStandardsList.AttachUrl);
|
||||
}
|
||||
|
||||
////删除附件表
|
||||
BLL.CommonService.DeleteAttachFileById(AwardStandardsList.AwardStandardsId);
|
||||
|
||||
db.Technique_AwardStandards.DeleteOnSubmit(AwardStandardsList);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user