提交定制会内容
This commit is contained in:
@@ -0,0 +1,107 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
/// <summary>
|
||||
/// 企业大检查类别
|
||||
/// </summary>
|
||||
public class SuperviseCheckTypeService
|
||||
{
|
||||
/// <summary>
|
||||
/// 根据主键获取检查类别
|
||||
/// </summary>
|
||||
/// <param name="checkTypeId"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.Base_SuperviseCheckType GetCheckTypeById(string checkTypeId)
|
||||
{
|
||||
return Funs.DB.Base_SuperviseCheckType.FirstOrDefault(e => e.CheckTypeId == checkTypeId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加检查类别
|
||||
/// </summary>
|
||||
/// <param name="checkType"></param>
|
||||
public static void AddCheckType(Model.Base_SuperviseCheckType checkType)
|
||||
{
|
||||
Model.Base_SuperviseCheckType newCheckType = new Model.Base_SuperviseCheckType
|
||||
{
|
||||
CheckTypeId = checkType.CheckTypeId,
|
||||
CheckTypeCode = checkType.CheckTypeCode,
|
||||
CheckTypeName = checkType.CheckTypeName,
|
||||
CheckMainType = checkType.CheckMainType,
|
||||
Remark = checkType.Remark
|
||||
};
|
||||
Funs.DB.Base_SuperviseCheckType.InsertOnSubmit(newCheckType);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改检查类别
|
||||
/// </summary>
|
||||
/// <param name="checkType"></param>
|
||||
public static void UpdateCheckType(Model.Base_SuperviseCheckType checkType)
|
||||
{
|
||||
Model.Base_SuperviseCheckType newCheckType = Funs.DB.Base_SuperviseCheckType.FirstOrDefault(e => e.CheckTypeId == checkType.CheckTypeId);
|
||||
if (newCheckType != null)
|
||||
{
|
||||
newCheckType.CheckTypeCode = checkType.CheckTypeCode;
|
||||
newCheckType.CheckTypeName = checkType.CheckTypeName;
|
||||
newCheckType.CheckMainType = checkType.CheckMainType;
|
||||
newCheckType.Remark = checkType.Remark;
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键删除检查类别
|
||||
/// </summary>
|
||||
/// <param name="checkTypeId"></param>
|
||||
public static void DeleteCheckTypeById(string checkTypeId)
|
||||
{
|
||||
Model.Base_SuperviseCheckType newCheckType = Funs.DB.Base_SuperviseCheckType.FirstOrDefault(e => e.CheckTypeId == checkTypeId);
|
||||
if (newCheckType != null)
|
||||
{
|
||||
Funs.DB.Base_SuperviseCheckType.DeleteOnSubmit(newCheckType);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取检查类别下拉列表项
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static List<Model.Base_SuperviseCheckType> GetCheckTypeListByMainType(string mainType)
|
||||
{
|
||||
if (!string.IsNullOrWhiteSpace(mainType))
|
||||
{
|
||||
return (from x in Funs.DB.Base_SuperviseCheckType where x.CheckMainType == mainType orderby x.CheckTypeCode select x).ToList();
|
||||
}
|
||||
else
|
||||
{
|
||||
return (from x in Funs.DB.Base_SuperviseCheckType orderby x.CheckTypeCode select x).ToList();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 检查类别下拉框
|
||||
/// </summary>
|
||||
/// <param name="dropName">下拉框名字</param>
|
||||
/// <param name="mainType">检查大类</param>
|
||||
/// <param name="isShowPlease">是否显示请选择</param>
|
||||
public static void InitCheckTypeDropDownListByMainType(FineUIPro.DropDownList dropName, string mainType, bool isShowPlease)
|
||||
{
|
||||
dropName.DataValueField = "CheckTypeCode";
|
||||
dropName.DataTextField = "CheckTypeName";
|
||||
dropName.DataSource = GetCheckTypeListByMainType(mainType);
|
||||
dropName.DataBind();
|
||||
if (isShowPlease)
|
||||
{
|
||||
Funs.FineUIPleaseSelect(dropName);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user