20240305 开车HSE管理

This commit is contained in:
2024-03-05 09:52:53 +08:00
parent f227bbeba2
commit 8fec129c11
32 changed files with 2334 additions and 2283 deletions
@@ -0,0 +1,98 @@
using System.Collections.Generic;
using System.Linq;
namespace BLL
{
/// <summary>
/// 作业类别及模板
/// </summary>
public class TestRunLicenseTypeService
{
/// <summary>
/// 根据主键获取作业类别及模板
/// </summary>
/// <param name="licenseTypeId"></param>
/// <returns></returns>
public static Model.Base_TestRunLicenseType GetLicenseTypeById(string licenseTypeId)
{
return Funs.DB.Base_TestRunLicenseType.FirstOrDefault(e => e.LicenseTypeId == licenseTypeId);
}
/// <summary>
/// 添加作业类别及模板
/// </summary>
/// <param name="testRunLicenseType"></param>
public static void AddTestRunLicenseType(Model.Base_TestRunLicenseType testRunLicenseType)
{
Model.Base_TestRunLicenseType newTestRunLicenseType = new Model.Base_TestRunLicenseType
{
LicenseTypeId = testRunLicenseType.LicenseTypeId,
LicenseTypeCode = testRunLicenseType.LicenseTypeCode,
LicenseTypeName = testRunLicenseType.LicenseTypeName,
Remark = testRunLicenseType.Remark,
TemplateUrl = testRunLicenseType.TemplateUrl
};
Funs.DB.Base_TestRunLicenseType.InsertOnSubmit(newTestRunLicenseType);
Funs.DB.SubmitChanges();
}
/// <summary>
/// 修改作业类别及模板
/// </summary>
/// <param name="testRunLicenseType"></param>
public static void UpdateTestRunLicenseType(Model.Base_TestRunLicenseType testRunLicenseType)
{
Model.Base_TestRunLicenseType newTestRunLicenseType = Funs.DB.Base_TestRunLicenseType.FirstOrDefault(e => e.LicenseTypeId == testRunLicenseType.LicenseTypeId);
if (newTestRunLicenseType != null)
{
newTestRunLicenseType.LicenseTypeCode = testRunLicenseType.LicenseTypeCode;
newTestRunLicenseType.LicenseTypeName = testRunLicenseType.LicenseTypeName;
newTestRunLicenseType.Remark = testRunLicenseType.Remark;
newTestRunLicenseType.TemplateUrl = testRunLicenseType.TemplateUrl;
Funs.DB.SubmitChanges();
}
}
/// <summary>
/// 根据主键删除作业类别及模板
/// </summary>
/// <param name="licenseTypeId"></param>
public static void DeleteTestRunLicenseTypeById(string licenseTypeId)
{
Model.Base_TestRunLicenseType newTestRunLicenseType = Funs.DB.Base_TestRunLicenseType.FirstOrDefault(e => e.LicenseTypeId == licenseTypeId);
if (newTestRunLicenseType!=null)
{
CommonService.DeleteAttachFileById(licenseTypeId);//删除附件
Funs.DB.Base_TestRunLicenseType.DeleteOnSubmit(newTestRunLicenseType);
Funs.DB.SubmitChanges();
}
}
/// <summary>
/// 获取作业类型下拉列表项
/// </summary>
/// <returns></returns>
public static List<Model.Base_TestRunLicenseType> GetTestRunLicenseTypeList()
{
return (from x in Funs.DB.Base_TestRunLicenseType orderby x.LicenseTypeCode select x).ToList();
}
/// <summary>
/// 作业类型下拉框
/// </summary>
/// <param name="dropName">下拉框名字</param>
/// <param name="projectId">项目id</param>
/// <param name="isShowPlease">是否显示请选择</param>
public static void InitLicenseTypeDropDownList(FineUIPro.DropDownList dropName, bool isShowPlease)
{
dropName.DataValueField = "LicenseTypeId";
dropName.DataTextField = "LicenseTypeName";
dropName.DataSource = GetTestRunLicenseTypeList();
dropName.DataBind();
if (isShowPlease)
{
Funs.FineUIPleaseSelect(dropName);
}
}
}
}