统一人员资质上传功能,优化风险分级动态管控功能,优化安全管理页面看板

This commit is contained in:
2024-07-04 14:01:20 +08:00
parent b1b3bd291c
commit cc3b5d045d
40 changed files with 4801 additions and 9 deletions
@@ -0,0 +1,94 @@
using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BLL
{
/// <summary>
/// 合同HSE费用额登记
/// </summary>
public class FeeRegistration
{
public static bool Insert(Model.CostGoods_FeeRegistration model)
{
try
{
Funs.DB.CostGoods_FeeRegistration.InsertOnSubmit(model);
Funs.DB.SubmitChanges();
return true;
}
catch (Exception ex)
{
ErrLogInfo.WriteLog($"插入数据失败,原因:{ex.Message}");
return false;
}
}
public static bool Update(Model.CostGoods_FeeRegistration model)
{
try
{
var result = Funs.DB.CostGoods_FeeRegistration.FirstOrDefault(a => a.Id == model.Id);
if (result != null)
{
result.UnitId = model.UnitId;
result.Cost = model.Cost;
Funs.DB.SubmitChanges();
}
return true;
}
catch (Exception ex)
{
ErrLogInfo.WriteLog($"更新表数据失败,原因:{ex.Message}");
return false;
}
}
public static bool Delete(List<string> newId)
{
try
{
var result = Funs.DB.CostGoods_FeeRegistration.Where(a => newId.Contains(a.Id)).ToList();
if (result.Count > 0)
{
Funs.DB.CostGoods_FeeRegistration.DeleteAllOnSubmit(result);
Funs.DB.SubmitChanges();
}
return true;
}
catch (Exception ex)
{
ErrLogInfo.WriteLog($"删除数据失败,原因:{ex.Message}");
return false;
}
}
public static bool Delete(string newId)
{
try
{
var result = Funs.DB.CostGoods_FeeRegistration.Where(a => a.Id == newId).ToList();
if (result.Count > 0)
{
Funs.DB.CostGoods_FeeRegistration.DeleteAllOnSubmit(result);
Funs.DB.SubmitChanges();
}
return true;
}
catch (Exception ex)
{
ErrLogInfo.WriteLog($"删除数据失败,原因:{ex.Message}");
return false;
}
}
public static Model.CostGoods_FeeRegistration Detail(string newId)
{
var result = Funs.DB.CostGoods_FeeRegistration.FirstOrDefault(a => a.Id == newId);
return result;
}
}
}