79 lines
2.8 KiB
C#
79 lines
2.8 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
|
|
namespace BLL
|
|
{
|
|
/// <summary>
|
|
/// 执行标准
|
|
/// </summary>
|
|
public static class HJGL_ExecStandardService
|
|
{
|
|
/// <summary>
|
|
/// 根据主键获取执行标准
|
|
/// </summary>
|
|
/// <param name="execStandardId"></param>
|
|
/// <returns></returns>
|
|
public static Model.HJGL_BS_ExecStandard GetExecStandardById(string execStandardId)
|
|
{
|
|
return Funs.DB.HJGL_BS_ExecStandard.FirstOrDefault(e => e.ExecStandardId == execStandardId);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 添加执行标准
|
|
/// </summary>
|
|
/// <param name="execStandard"></param>
|
|
public static void AddExecStandard(Model.HJGL_BS_ExecStandard execStandard)
|
|
{
|
|
Model.SGGLDB db = Funs.DB;
|
|
Model.HJGL_BS_ExecStandard newExecStandard = new Model.HJGL_BS_ExecStandard();
|
|
newExecStandard.ExecStandardId = execStandard.ExecStandardId;
|
|
newExecStandard.ExecStandardName = execStandard.ExecStandardName;
|
|
newExecStandard.Def = execStandard.Def;
|
|
db.HJGL_BS_ExecStandard.InsertOnSubmit(newExecStandard);
|
|
db.SubmitChanges();
|
|
}
|
|
|
|
/// <summary>
|
|
/// 修改执行标准
|
|
/// </summary>
|
|
/// <param name="execStandard"></param>
|
|
public static void UpdateExecStandard(Model.HJGL_BS_ExecStandard execStandard)
|
|
{
|
|
Model.SGGLDB db = Funs.DB;
|
|
Model.HJGL_BS_ExecStandard newExecStandard = db.HJGL_BS_ExecStandard.FirstOrDefault(e => e.ExecStandardId == execStandard.ExecStandardId);
|
|
if (newExecStandard != null)
|
|
{
|
|
newExecStandard.ExecStandardName = execStandard.ExecStandardName;
|
|
newExecStandard.Def = execStandard.Def;
|
|
db.SubmitChanges();
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 根据主键删除执行标准
|
|
/// </summary>
|
|
/// <param name="execStandardId"></param>
|
|
public static void DeleteExecStandardById(string execStandardId)
|
|
{
|
|
Model.SGGLDB db = Funs.DB;
|
|
Model.HJGL_BS_ExecStandard execStandard = db.HJGL_BS_ExecStandard.FirstOrDefault(e => e.ExecStandardId == execStandardId);
|
|
if (execStandard != null)
|
|
{
|
|
db.HJGL_BS_ExecStandard.DeleteOnSubmit(execStandard);
|
|
db.SubmitChanges();
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 获取执行标准列表
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public static List<Model.HJGL_BS_ExecStandard> GetExecStandardNameList()
|
|
{
|
|
return (from x in Funs.DB.HJGL_BS_ExecStandard orderby x.ExecStandardName select x).ToList();
|
|
}
|
|
}
|
|
}
|