20220905代码初始化
This commit is contained in:
@@ -0,0 +1,328 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
/// <summary>
|
||||
/// 检查通知单
|
||||
/// </summary>
|
||||
public static class CheckNoticeService
|
||||
{
|
||||
/// <summary>
|
||||
/// 根据主键获取检查通知单
|
||||
/// </summary>
|
||||
/// <param name="checkNoticeId"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.ProjectSupervision_CheckNotice GetCheckNoticeById(string checkNoticeId)
|
||||
{
|
||||
return Funs.DB.ProjectSupervision_CheckNotice.FirstOrDefault(e => e.CheckNoticeId == checkNoticeId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加检查通知单
|
||||
/// </summary>
|
||||
/// <param name="checkNotice"></param>
|
||||
public static void AddCheckNotice(Model.ProjectSupervision_CheckNotice checkNotice)
|
||||
{
|
||||
Model.ProjectSupervision_CheckNotice newCheckNotice = new Model.ProjectSupervision_CheckNotice();
|
||||
newCheckNotice.CheckNoticeId = checkNotice.CheckNoticeId;
|
||||
//newCheckNotice.SubjectUnitId = checkNotice.SubjectUnitId;
|
||||
newCheckNotice.SubjectUnitAdd = checkNotice.SubjectUnitAdd;
|
||||
newCheckNotice.SubjectUnitMan = checkNotice.SubjectUnitMan;
|
||||
newCheckNotice.SubjectUnitTel = checkNotice.SubjectUnitTel;
|
||||
newCheckNotice.CheckStartTime = checkNotice.CheckStartTime;
|
||||
newCheckNotice.CheckEndTime = checkNotice.CheckEndTime;
|
||||
//newCheckNotice.SubjectObject = checkNotice.SubjectObject;
|
||||
newCheckNotice.CheckTeamLeader = checkNotice.CheckTeamLeader;
|
||||
newCheckNotice.CompileMan = checkNotice.CompileMan;
|
||||
newCheckNotice.CompileDate = checkNotice.CompileDate;
|
||||
newCheckNotice.CheckTeamLeaderName = checkNotice.CheckTeamLeaderName;
|
||||
newCheckNotice.UnitId = checkNotice.UnitId;
|
||||
newCheckNotice.SexName = checkNotice.SexName;
|
||||
newCheckNotice.SubjectProjectId = checkNotice.SubjectProjectId;
|
||||
Funs.DB.ProjectSupervision_CheckNotice.InsertOnSubmit(newCheckNotice);
|
||||
Funs.DB.SubmitChanges();
|
||||
|
||||
////组长不为空时 自动将组长添加到检查组
|
||||
if (!string.IsNullOrEmpty(newCheckNotice.CheckTeamLeader))
|
||||
{
|
||||
Model.ProjectSupervision_CheckTeam newCheckTeam = new Model.ProjectSupervision_CheckTeam
|
||||
{
|
||||
CheckTeamId = SQLHelper.GetNewID(typeof(Model.ProjectSupervision_CheckTeam))
|
||||
};
|
||||
;
|
||||
newCheckTeam.CheckNoticeId = newCheckNotice.CheckNoticeId;
|
||||
newCheckTeam.UserId = newCheckNotice.CheckTeamLeader;
|
||||
newCheckTeam.SortIndex = 1;
|
||||
newCheckTeam.CheckPostName = "组长";
|
||||
newCheckTeam.CheckDate = newCheckNotice.CheckStartTime;
|
||||
newCheckTeam.UserName = newCheckNotice.CheckTeamLeaderName;
|
||||
newCheckTeam.UnitId = newCheckNotice.UnitId;
|
||||
newCheckTeam.SexName = newCheckNotice.SexName;
|
||||
BLL.CheckTeamService.AddCheckTeam(newCheckTeam);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改检查通知单
|
||||
/// </summary>
|
||||
/// <param name="checkNotice"></param>
|
||||
public static void UpdateCheckNotice(Model.ProjectSupervision_CheckNotice checkNotice)
|
||||
{
|
||||
Model.ProjectSupervision_CheckNotice newCheckNotice = Funs.DB.ProjectSupervision_CheckNotice.FirstOrDefault(e => e.CheckNoticeId == checkNotice.CheckNoticeId);
|
||||
if (newCheckNotice != null)
|
||||
{
|
||||
//newCheckNotice.SubjectUnitId = checkNotice.SubjectUnitId;
|
||||
newCheckNotice.SubjectUnitAdd = checkNotice.SubjectUnitAdd;
|
||||
newCheckNotice.SubjectUnitMan = checkNotice.SubjectUnitMan;
|
||||
newCheckNotice.SubjectUnitTel = checkNotice.SubjectUnitTel;
|
||||
newCheckNotice.CheckStartTime = checkNotice.CheckStartTime;
|
||||
newCheckNotice.CheckEndTime = checkNotice.CheckEndTime;
|
||||
//newCheckNotice.SubjectObject = checkNotice.SubjectObject;
|
||||
newCheckNotice.CheckTeamLeader = checkNotice.CheckTeamLeader;
|
||||
newCheckNotice.CompileMan = checkNotice.CompileMan;
|
||||
newCheckNotice.CompileDate = checkNotice.CompileDate;
|
||||
newCheckNotice.CheckTeamLeaderName = checkNotice.CheckTeamLeaderName;
|
||||
newCheckNotice.UnitId = checkNotice.UnitId;
|
||||
newCheckNotice.SexName = checkNotice.SexName;
|
||||
newCheckNotice.SubjectProjectId = checkNotice.SubjectProjectId;
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据检查通知Id删除检查通知信息
|
||||
/// </summary>
|
||||
/// <param name="checkNoticeId"></param>
|
||||
public static void DeleteCheckNoticeByCheckNoticeId(string checkNoticeId)
|
||||
{
|
||||
Model.ProjectSupervision_CheckNotice checkNotice = Funs.DB.ProjectSupervision_CheckNotice.FirstOrDefault(e => e.CheckNoticeId == checkNoticeId);
|
||||
if (checkNotice != null)
|
||||
{
|
||||
var checkTeams = from x in Funs.DB.ProjectSupervision_CheckTeam where x.CheckNoticeId == checkNoticeId select x;
|
||||
if (checkTeams.Count() > 0)
|
||||
{
|
||||
foreach (var item in checkTeams)
|
||||
{
|
||||
BLL.CheckTeamService.DeleteCheckTeamByCheckTeamId(item.CheckTeamId);
|
||||
}
|
||||
}
|
||||
Funs.DB.ProjectSupervision_CheckNotice.DeleteOnSubmit(checkNotice);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取监督检查信息
|
||||
/// </summary>
|
||||
/// <param name="CheckInfoName"></param>
|
||||
/// <returns></returns>
|
||||
public static List<Model.ProjectSupervision_CheckNotice> GetCheckInfoList(string unitId, string userId, string roleId)
|
||||
{
|
||||
List<Model.ProjectSupervision_CheckNotice> checkInfoLists = new List<Model.ProjectSupervision_CheckNotice>();
|
||||
var role = BLL.RoleService.GetRoleByRoleId(roleId);
|
||||
if (userId == BLL.Const.sysglyId || (BLL.CommonService.IsMainUnitOrAdmin(unitId) && role != null))
|
||||
{
|
||||
checkInfoLists = (from x in Funs.DB.ProjectSupervision_CheckNotice orderby x.CheckStartTime select x).ToList();
|
||||
}
|
||||
else
|
||||
{
|
||||
var checkInfoIdList = (from x in Funs.DB.ProjectSupervision_CheckTeam
|
||||
where x.UserId == userId && x.UnitId == unitId
|
||||
select x.CheckNoticeId).Distinct().ToList();
|
||||
if (checkInfoIdList.Count() > 0)
|
||||
{
|
||||
checkInfoLists = (from x in Funs.DB.ProjectSupervision_CheckNotice
|
||||
where checkInfoIdList.Contains(x.CheckNoticeId)
|
||||
orderby x.CheckStartTime
|
||||
select x).ToList();
|
||||
}
|
||||
|
||||
var checkInfoIdList1 = (from x in Funs.DB.ProjectSupervision_CheckNotice
|
||||
where x.CompileMan == userId
|
||||
orderby x.CheckStartTime
|
||||
select x).ToList();
|
||||
if (checkInfoIdList1.Count() > 0)
|
||||
{
|
||||
if (checkInfoLists.Count() > 0)
|
||||
{
|
||||
checkInfoLists.AddRange(checkInfoIdList1);
|
||||
}
|
||||
else
|
||||
{
|
||||
checkInfoLists = checkInfoIdList1;
|
||||
}
|
||||
}
|
||||
|
||||
checkInfoLists = checkInfoLists.Distinct().ToList();
|
||||
}
|
||||
return checkInfoLists;
|
||||
}
|
||||
|
||||
#region 根据检查ID得到检查内容项
|
||||
/// <summary>
|
||||
/// 根据检查ID得到检查内容项
|
||||
/// </summary>
|
||||
/// <param name="checkInfoId"></param>
|
||||
/// <returns></returns>
|
||||
public static List<Model.SpCheckInfoItem> GetSpCheckInfoItemByCheckInfoId(string checkInfoId)
|
||||
{
|
||||
List<Model.SpCheckInfoItem> spCheckInfoItems = new List<Model.SpCheckInfoItem>();
|
||||
//var checkItems = BLL.ConstValue.drpConstItemList(BLL.ConstValue.Group_CheckItem);
|
||||
//if (checkItems.Count() > 0)
|
||||
//{
|
||||
// foreach (var item in checkItems)
|
||||
// {
|
||||
//Model.SpCheckInfoItem spCheckInfoItem = new Model.SpCheckInfoItem
|
||||
//{
|
||||
// ID = item.ID,
|
||||
// SortIndex = item.SortIndex,
|
||||
// CheckItemName = item.ConstText
|
||||
//};
|
||||
//if (item.ConstValue == "1")
|
||||
//{
|
||||
// var table1 = Funs.DB.Check_CheckInfo_Table1.FirstOrDefault(x => x.CheckInfoId == checkInfoId);
|
||||
// if (table1 != null)
|
||||
// {
|
||||
// spCheckInfoItem.CheckItemId = table1.CheckItemId;
|
||||
// var units = BLL.UnitService.GetUnitById(table1.SubjectUnitId);
|
||||
// if (units != null)
|
||||
// {
|
||||
// spCheckInfoItem.CheckObject = "企业名称:" + units.UnitName;
|
||||
// }
|
||||
// spCheckInfoItem.CheckDate = table1.CheckDate;
|
||||
// spCheckInfoItem.CheckResult = "评定得分:" + table1.TotalLastScore.ToString() + ";评定结论:" + table1.EvaluationResult;
|
||||
// spCheckInfoItems.Add(spCheckInfoItem);
|
||||
// }
|
||||
//}
|
||||
//if (item.ConstValue == "2")
|
||||
//{
|
||||
// var table2 = Funs.DB.Check_CheckInfo_Table2.FirstOrDefault(x => x.CheckInfoId == checkInfoId);
|
||||
// if (table2 != null)
|
||||
// {
|
||||
// spCheckInfoItem.CheckItemId = table2.CheckItemId;
|
||||
// var units = BLL.UnitService.GetUnitById(table2.SubjectUnitId);
|
||||
// if (units != null)
|
||||
// {
|
||||
// spCheckInfoItem.CheckObject = "企业名称:" + units.UnitName;
|
||||
// }
|
||||
// spCheckInfoItem.CheckDate = table2.CheckDate;
|
||||
// spCheckInfoItem.CheckResult = "评定得分:" + table2.TotalLastScore.ToString() + ";评定结论:" + table2.EvaluationResult;
|
||||
// spCheckInfoItems.Add(spCheckInfoItem);
|
||||
// }
|
||||
//}
|
||||
//if (item.ConstValue == "3")
|
||||
//{
|
||||
// var table3 = Funs.DB.Check_CheckInfo_Table3.FirstOrDefault(x => x.CheckInfoId == checkInfoId);
|
||||
// if (table3 != null)
|
||||
// {
|
||||
// spCheckInfoItem.CheckItemId = table3.CheckItemId;
|
||||
// spCheckInfoItem.CheckObject = "项目经理部:" + table3.ProjectManagerName + ";项目名称:" + table3.ProjectName;
|
||||
// spCheckInfoItem.CheckDate = table3.CheckDate;
|
||||
// spCheckInfoItem.CheckResult = "评定得分:" + table3.TotalLastScore.ToString() + ";评定结论:" + table3.EvaluationResult;
|
||||
// spCheckInfoItems.Add(spCheckInfoItem);
|
||||
// }
|
||||
//}
|
||||
//if (item.ConstValue == "4")
|
||||
//{
|
||||
// var table4 = Funs.DB.Check_CheckInfo_Table4.FirstOrDefault(x => x.CheckInfoId == checkInfoId);
|
||||
// if (table4 != null)
|
||||
// {
|
||||
// spCheckInfoItem.CheckItemId = table4.CheckItemId;
|
||||
// spCheckInfoItem.CheckObject = "项目经理部:" + table4.ProjectManagerName + ";项目名称:" + table4.ProjectName;
|
||||
// spCheckInfoItem.CheckDate = table4.CheckDate;
|
||||
// spCheckInfoItem.CheckResult = "评定得分:" + table4.TotalLastScore.ToString() + ";评定结论:" + table4.EvaluationResult;
|
||||
// spCheckInfoItems.Add(spCheckInfoItem);
|
||||
// }
|
||||
//}
|
||||
//if (item.ConstValue == "5")
|
||||
//{
|
||||
// var table5 = Funs.DB.Check_CheckInfo_Table5.FirstOrDefault(x => x.CheckInfoId == checkInfoId);
|
||||
// if (table5 != null)
|
||||
// {
|
||||
// spCheckInfoItem.CheckItemId = table5.CheckItemId;
|
||||
// var units = BLL.UnitService.GetUnitById(table5.SubjectUnitId);
|
||||
// if (units != null)
|
||||
// {
|
||||
// spCheckInfoItem.CheckObject = "受检单位:" + units.UnitName;
|
||||
// }
|
||||
// spCheckInfoItem.CheckDate = table5.CheckDate;
|
||||
// var table5Item = (from x in Funs.DB.Check_CheckInfo_Table5Item where x.CheckInfoId == checkInfoId select x);
|
||||
// var isTable5Item = table5Item.Where(x => x.IsProject == true);
|
||||
// spCheckInfoItem.CheckResult = "隐患: " + table5Item.Count().ToString() + "条。立项整改: " + isTable5Item.Count().ToString() + "条。";
|
||||
// if (table5.IsIssued == true)
|
||||
// {
|
||||
// spCheckInfoItem.CheckResult += "已生成整改单。";
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// spCheckInfoItem.CheckResult += "整改单未生成或未发布。";
|
||||
// }
|
||||
// spCheckInfoItems.Add(spCheckInfoItem);
|
||||
// }
|
||||
//}
|
||||
//if (item.ConstValue == "6")
|
||||
//{
|
||||
// var table6 = Funs.DB.Check_CheckInfo_Table6.FirstOrDefault(x => x.CheckInfoId == checkInfoId);
|
||||
// if (table6 != null)
|
||||
// {
|
||||
// spCheckInfoItem.CheckItemId = table6.CheckItemId;
|
||||
// var units = BLL.UnitService.GetUnitById(table6.SubjectUnitId);
|
||||
// if (units != null)
|
||||
// {
|
||||
// spCheckInfoItem.CheckObject = "受检单位:" + units.UnitName;
|
||||
// }
|
||||
// spCheckInfoItem.CheckDate = table6.CheckDate;
|
||||
// if (table6.TotalDeletScore.HasValue)
|
||||
// {
|
||||
// spCheckInfoItem.CheckResult = "罚分: " + table6.TotalDeletScore.ToString() + ";罚金:" + (table6.TotalDeletScore * 500).ToString() + "元。";
|
||||
// }
|
||||
// spCheckInfoItems.Add(spCheckInfoItem);
|
||||
// }
|
||||
//}
|
||||
//if (item.ConstValue == "7")
|
||||
//{
|
||||
// var table7 = Funs.DB.Check_CheckInfo_Table7.FirstOrDefault(x => x.CheckInfoId == checkInfoId);
|
||||
// if (table7 != null)
|
||||
// {
|
||||
// spCheckInfoItem.CheckItemId = table7.CheckItemId;
|
||||
// var units = BLL.UnitService.GetUnitById(table7.SubjectUnitId);
|
||||
// if (units != null)
|
||||
// {
|
||||
// spCheckInfoItem.CheckObject = "受检单位:" + units.UnitName;
|
||||
// }
|
||||
// spCheckInfoItem.CheckDate = table7.CheckDate;
|
||||
// if (table7.TotalDeletScore.HasValue)
|
||||
// {
|
||||
// spCheckInfoItem.CheckResult = "罚分: " + table7.TotalDeletScore.ToString() + ";罚金:" + (table7.TotalDeletScore * 500).ToString() + "元。";
|
||||
// }
|
||||
// spCheckInfoItems.Add(spCheckInfoItem);
|
||||
// }
|
||||
//}
|
||||
//if (item.ConstValue == "8")
|
||||
//{
|
||||
// var table8 = Funs.DB.Check_CheckInfo_Table8.FirstOrDefault(x => x.CheckInfoId == checkInfoId);
|
||||
// if (table8 != null)
|
||||
// {
|
||||
// var info = BLL.CheckInfoService.GetCheckInfoByCheckInfoId(checkInfoId);
|
||||
// if (info != null)
|
||||
// {
|
||||
// spCheckInfoItem.CheckItemId = table8.CheckItemId;
|
||||
// var units = BLL.UnitService.GetUnitById(info.SubjectUnitId);
|
||||
// if (units != null)
|
||||
// {
|
||||
// spCheckInfoItem.CheckObject = "受检单位:" + units.UnitName;
|
||||
// }
|
||||
// spCheckInfoItem.CheckDate = info.CheckStartTime;
|
||||
// spCheckInfoItem.CheckResult = table8.Values7;
|
||||
// spCheckInfoItems.Add(spCheckInfoItem);
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
// }
|
||||
//}
|
||||
return spCheckInfoItems;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
using System.Linq;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
/// <summary>
|
||||
/// 检查报告明细
|
||||
/// </summary>
|
||||
public static class CheckReportItemService
|
||||
{
|
||||
/// <summary>
|
||||
/// 添加检查报告明细
|
||||
/// </summary>
|
||||
/// <param name="checkReportItem"></param>
|
||||
public static void AddCheckReportItem(Model.ProjectSupervision_CheckReportItem checkReportItem)
|
||||
{
|
||||
Model.ProjectSupervision_CheckReportItem newCheckItem = new Model.ProjectSupervision_CheckReportItem();
|
||||
newCheckItem.CheckReportItemId = checkReportItem.CheckReportItemId;
|
||||
newCheckItem.CheckReportId = checkReportItem.CheckReportId;
|
||||
newCheckItem.CheckReportCode = checkReportItem.CheckReportCode;
|
||||
newCheckItem.UnConformItem = checkReportItem.UnConformItem;
|
||||
Funs.DB.ProjectSupervision_CheckReportItem.InsertOnSubmit(newCheckItem);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据检查报告Id删除相关明细信息
|
||||
/// </summary>
|
||||
/// <param name="checkReportId"></param>
|
||||
public static void DeleteCheckReportItemByCheckReportId(string checkReportId)
|
||||
{
|
||||
var q = (from x in Funs.DB.ProjectSupervision_CheckReportItem where x.CheckReportId == checkReportId select x).ToList();
|
||||
if (q != null)
|
||||
{
|
||||
Funs.DB.ProjectSupervision_CheckReportItem.DeleteAllOnSubmit(q);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
using System.Linq;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
/// <summary>
|
||||
/// 检查报告
|
||||
/// </summary>
|
||||
public static class CheckReportService
|
||||
{
|
||||
/// <summary>
|
||||
/// 根据检查Id获取检查报告
|
||||
/// </summary>
|
||||
/// <param name="checkNoticeId"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.ProjectSupervision_CheckReport GetCheckReportByCheckNoticeId(string checkNoticeId)
|
||||
{
|
||||
return Funs.DB.ProjectSupervision_CheckReport.FirstOrDefault(e => e.CheckNoticeId == checkNoticeId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加检查报告
|
||||
/// </summary>
|
||||
/// <param name="checkReport"></param>
|
||||
public static void AddCheckReport(Model.ProjectSupervision_CheckReport checkReport)
|
||||
{
|
||||
Model.ProjectSupervision_CheckReport newCheckReport = new Model.ProjectSupervision_CheckReport();
|
||||
newCheckReport.CheckReportId = checkReport.CheckReportId;
|
||||
newCheckReport.CheckNoticeId = checkReport.CheckNoticeId;
|
||||
newCheckReport.CheckPurpose = checkReport.CheckPurpose;
|
||||
newCheckReport.Basis = checkReport.Basis;
|
||||
newCheckReport.BasicInfo = checkReport.BasicInfo;
|
||||
newCheckReport.ConformItem = checkReport.ConformItem;
|
||||
newCheckReport.Opinion = checkReport.Opinion;
|
||||
newCheckReport.CheckResult = checkReport.CheckResult;
|
||||
Funs.DB.ProjectSupervision_CheckReport.InsertOnSubmit(newCheckReport);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改检查报告
|
||||
/// </summary>
|
||||
/// <param name="checkReport"></param>
|
||||
public static void UpdateCheckReport(Model.ProjectSupervision_CheckReport checkReport)
|
||||
{
|
||||
Model.ProjectSupervision_CheckReport newCheckReport = Funs.DB.ProjectSupervision_CheckReport.FirstOrDefault(e => e.CheckReportId == checkReport.CheckReportId);
|
||||
if (newCheckReport != null)
|
||||
{
|
||||
newCheckReport.CheckPurpose = checkReport.CheckPurpose;
|
||||
newCheckReport.Basis = checkReport.Basis;
|
||||
newCheckReport.BasicInfo = checkReport.BasicInfo;
|
||||
newCheckReport.ConformItem = checkReport.ConformItem;
|
||||
newCheckReport.Opinion = checkReport.Opinion;
|
||||
newCheckReport.CheckResult = checkReport.CheckResult;
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据检查主键删除检查报告信息
|
||||
/// </summary>
|
||||
/// <param name="checkNoticeId"></param>
|
||||
public static void DeleteCheckReportByCheckNoticeId(string checkNoticeId)
|
||||
{
|
||||
Model.ProjectSupervision_CheckReport checkReport = Funs.DB.ProjectSupervision_CheckReport.FirstOrDefault(e => e.CheckNoticeId == checkNoticeId);
|
||||
if (checkReport != null)
|
||||
{
|
||||
Funs.DB.ProjectSupervision_CheckReport.DeleteOnSubmit(checkReport);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
using System.Linq;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
public static class CheckTable1Service
|
||||
{
|
||||
public static Model.ProjectSupervision_CheckTable1 GetCheckTable1ByCheckNoticeId(string checkNoticeId)
|
||||
{
|
||||
return Funs.DB.ProjectSupervision_CheckTable1.FirstOrDefault(e => e.CheckNoticeId == checkNoticeId);
|
||||
}
|
||||
|
||||
public static void AddCheckTable1(Model.ProjectSupervision_CheckTable1 table1)
|
||||
{
|
||||
Model.ProjectSupervision_CheckTable1 newTable1 = new Model.ProjectSupervision_CheckTable1();
|
||||
newTable1.CheckItemId = table1.CheckItemId;
|
||||
newTable1.CheckNoticeId = table1.CheckNoticeId;
|
||||
newTable1.SubjectProjectId = table1.SubjectProjectId;
|
||||
newTable1.CheckMan = table1.CheckMan;
|
||||
newTable1.CheckLeader = table1.CheckLeader;
|
||||
newTable1.CheckDate = table1.CheckDate;
|
||||
newTable1.SubjectUnitMan = table1.SubjectUnitMan;
|
||||
newTable1.SubjectUnitDate = table1.SubjectUnitDate;
|
||||
newTable1.TotalBaseScore = table1.TotalBaseScore;
|
||||
newTable1.TotalDeletScore = table1.TotalDeletScore;
|
||||
newTable1.TotalGetScore = table1.TotalGetScore;
|
||||
newTable1.Total100Score = table1.Total100Score;
|
||||
newTable1.TotalLastScore = table1.TotalLastScore;
|
||||
newTable1.EvaluationResult = table1.EvaluationResult;
|
||||
Funs.DB.ProjectSupervision_CheckTable1.InsertOnSubmit(newTable1);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
|
||||
public static void DeleteCheckTable1ByNoticeId(string noticeId)
|
||||
{
|
||||
Model.ProjectSupervision_CheckTable1 table1 = Funs.DB.ProjectSupervision_CheckTable1.FirstOrDefault(e => e.CheckNoticeId == noticeId);
|
||||
if (table1 != null)
|
||||
{
|
||||
Funs.DB.ProjectSupervision_CheckTable1.DeleteOnSubmit(table1);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,107 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
/// <summary>
|
||||
/// 检查组长
|
||||
/// </summary>
|
||||
public static class CheckTeamService
|
||||
{
|
||||
/// <summary>
|
||||
/// 根据主键获取检查组长
|
||||
/// </summary>
|
||||
/// <param name="CheckTeamId"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.ProjectSupervision_CheckTeam GetCheckTeamByCheckTeamId(string CheckTeamId)
|
||||
{
|
||||
return Funs.DB.ProjectSupervision_CheckTeam.FirstOrDefault(e => e.CheckTeamId == CheckTeamId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据检查通知ID获取所有检查组长
|
||||
/// </summary>
|
||||
/// <param name="checkNoticeId"></param>
|
||||
/// <returns></returns>
|
||||
public static List<Model.ProjectSupervision_CheckTeam> GetCheckTeamListByCheckNoticeId(string checkNoticeId)
|
||||
{
|
||||
return (from x in Funs.DB.ProjectSupervision_CheckTeam where x.CheckNoticeId == checkNoticeId select x).ToList();
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 添加检查组长信息
|
||||
/// </summary>
|
||||
/// <param name="CheckTeam"></param>
|
||||
public static void AddCheckTeam(Model.ProjectSupervision_CheckTeam CheckTeam)
|
||||
{
|
||||
Model.ProjectSupervision_CheckTeam newCheckTeam = new Model.ProjectSupervision_CheckTeam
|
||||
{
|
||||
CheckTeamId = CheckTeam.CheckTeamId,
|
||||
CheckNoticeId = CheckTeam.CheckNoticeId,
|
||||
UserId = CheckTeam.UserId,
|
||||
SortIndex = CheckTeam.SortIndex,
|
||||
PostName = CheckTeam.PostName,
|
||||
WorkTitle = CheckTeam.WorkTitle,
|
||||
CheckPostName = CheckTeam.CheckPostName,
|
||||
CheckDate = CheckTeam.CheckDate,
|
||||
UserName = CheckTeam.UserName,
|
||||
UnitId = CheckTeam.UnitId,
|
||||
SexName = CheckTeam.SexName,
|
||||
};
|
||||
Funs.DB.ProjectSupervision_CheckTeam.InsertOnSubmit(newCheckTeam);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改检查组长信息
|
||||
/// </summary>
|
||||
/// <param name="CheckTeam"></param>
|
||||
public static void UpdateCheckTeam(Model.ProjectSupervision_CheckTeam CheckTeam)
|
||||
{
|
||||
Model.ProjectSupervision_CheckTeam newCheckTeam = Funs.DB.ProjectSupervision_CheckTeam.FirstOrDefault(e => e.CheckTeamId == CheckTeam.CheckTeamId);
|
||||
if (newCheckTeam != null)
|
||||
{
|
||||
newCheckTeam.UserId = CheckTeam.UserId;
|
||||
newCheckTeam.SortIndex = CheckTeam.SortIndex;
|
||||
newCheckTeam.PostName = CheckTeam.PostName;
|
||||
newCheckTeam.WorkTitle = CheckTeam.WorkTitle;
|
||||
newCheckTeam.CheckPostName = CheckTeam.CheckPostName;
|
||||
newCheckTeam.CheckDate = CheckTeam.CheckDate;
|
||||
newCheckTeam.UserName = CheckTeam.UserName;
|
||||
newCheckTeam.UnitId = CheckTeam.UnitId;
|
||||
newCheckTeam.SexName = CheckTeam.SexName;
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键删除检查组长信息
|
||||
/// </summary>
|
||||
/// <param name="checkTeamId"></param>
|
||||
public static void DeleteCheckTeamByCheckTeamId(string checkTeamId)
|
||||
{
|
||||
Model.ProjectSupervision_CheckTeam CheckTeam = Funs.DB.ProjectSupervision_CheckTeam.FirstOrDefault(e => e.CheckTeamId == checkTeamId);
|
||||
if (CheckTeam != null)
|
||||
{
|
||||
Funs.DB.ProjectSupervision_CheckTeam.DeleteOnSubmit(CheckTeam);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 排序值加1
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static int ReturCheckTeamSortIndex(string checkNoticeId)
|
||||
{
|
||||
int SortIndex = 1;
|
||||
var maxSortIndex = Funs.DB.ProjectSupervision_CheckTeam.Where(x => x.CheckNoticeId == checkNoticeId).Max(x => x.SortIndex);
|
||||
if (maxSortIndex.HasValue)
|
||||
{
|
||||
SortIndex = maxSortIndex.Value + 1;
|
||||
}
|
||||
return SortIndex;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
public static class ProjectSupervision_Check1Service
|
||||
{
|
||||
|
||||
public static Model.ProjectSupervision_Check1 GetCheck1ByCheckItem(string checkItem, string checkNoticeId)
|
||||
{
|
||||
return Funs.DB.ProjectSupervision_Check1.FirstOrDefault(e => e.CheckItem == checkItem && e.CheckNoticeId == checkNoticeId);
|
||||
}
|
||||
|
||||
public static List<Model.ProjectSupervision_Check1> GetCheckLists(string checkItem, string checkNoticeId)
|
||||
{
|
||||
return (from x in Funs.DB.ProjectSupervision_Check1 where x.CheckItem == checkItem && x.CheckNoticeId == checkNoticeId select x).ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 新增
|
||||
/// </summary>
|
||||
/// <param name="check"></param>
|
||||
public static void AddCheck1(Model.ProjectSupervision_Check1 check)
|
||||
{
|
||||
Model.ProjectSupervision_Check1 newCheck = new Model.ProjectSupervision_Check1();
|
||||
newCheck.ID = check.ID;
|
||||
newCheck.SortIndex = check.SortIndex;
|
||||
newCheck.CheckItem = check.CheckItem;
|
||||
newCheck.CheckStandard = check.CheckStandard;
|
||||
newCheck.CheckMethod = check.CheckMethod;
|
||||
newCheck.CheckResult = check.CheckResult;
|
||||
newCheck.BaseScore = check.BaseScore;
|
||||
newCheck.DeletScore = check.DeletScore;
|
||||
newCheck.GetScore = check.GetScore;
|
||||
newCheck.Type = check.Type;
|
||||
newCheck.CheckNoticeId = check.CheckNoticeId;
|
||||
Funs.DB.ProjectSupervision_Check1.InsertOnSubmit(newCheck);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据检查主表Id删除相关的检查项
|
||||
/// </summary>
|
||||
/// <param name="noticeId"></param>
|
||||
public static void DeleteCheckByNoticeId(string noticeId)
|
||||
{
|
||||
var q = (from x in Funs.DB.ProjectSupervision_Check1 where x.CheckNoticeId == noticeId select x).ToList();
|
||||
if (q != null)
|
||||
{
|
||||
Funs.DB.ProjectSupervision_Check1.DeleteAllOnSubmit(q);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
public static class ProjectSupervision_RectifyItemService
|
||||
{
|
||||
/// <summary>
|
||||
/// 根据主键获取整改明细
|
||||
/// </summary>
|
||||
/// <param name="itemId"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.ProjectSupervision_RectifyItem GeRectifyItemById(string itemId)
|
||||
{
|
||||
return Funs.DB.ProjectSupervision_RectifyItem.FirstOrDefault(e => e.RectifyItemId == itemId);
|
||||
}
|
||||
|
||||
public static List<Model.ProjectSupervision_RectifyItem> GetRectifyItemByRectifyId(string rectifyId)
|
||||
{
|
||||
return (from x in Funs.DB.ProjectSupervision_RectifyItem where x.RectifyId == rectifyId select x).ToList();
|
||||
}
|
||||
|
||||
public static void AddRectifyItem(Model.ProjectSupervision_RectifyItem rectifyItem)
|
||||
{
|
||||
Model.ProjectSupervision_RectifyItem newRectifyItem = new Model.ProjectSupervision_RectifyItem();
|
||||
newRectifyItem.RectifyItemId = rectifyItem.RectifyItemId;
|
||||
newRectifyItem.RectifyId = rectifyItem.RectifyId;
|
||||
newRectifyItem.WrongContent = rectifyItem.WrongContent;
|
||||
newRectifyItem.Requirement = rectifyItem.Requirement;
|
||||
newRectifyItem.LimitTime = rectifyItem.LimitTime;
|
||||
newRectifyItem.RectifyResults = rectifyItem.RectifyResults;
|
||||
newRectifyItem.IsRectify = rectifyItem.IsRectify;
|
||||
Funs.DB.ProjectSupervision_RectifyItem.InsertOnSubmit(newRectifyItem);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
|
||||
public static void DeleteRectifyItemByRectifyId(string rectifyId)
|
||||
{
|
||||
var q = (from x in Funs.DB.ProjectSupervision_RectifyItem where x.RectifyId == rectifyId select x).ToList();
|
||||
if (q != null)
|
||||
{
|
||||
Funs.DB.ProjectSupervision_RectifyItem.DeleteAllOnSubmit(q);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
public static void DeleteRectifyItemById(string id)
|
||||
{
|
||||
Model.ProjectSupervision_RectifyItem item = Funs.DB.ProjectSupervision_RectifyItem.FirstOrDefault(e => e.RectifyItemId == id);
|
||||
if (item != null)
|
||||
{
|
||||
Funs.DB.ProjectSupervision_RectifyItem.DeleteOnSubmit(item);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
using System.Linq;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
/// <summary>
|
||||
/// 隐患整改
|
||||
/// </summary>
|
||||
public static class ProjectSupervision_RectifyService
|
||||
{
|
||||
/// <summary>
|
||||
/// 根据主键获取隐患整改
|
||||
/// </summary>
|
||||
/// <param name="rectifyId"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.ProjectSupervision_Rectify GetRectifyById(string rectifyId)
|
||||
{
|
||||
return Funs.DB.ProjectSupervision_Rectify.FirstOrDefault(e => e.RectifyId == rectifyId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据检查通知Id获取隐患整改
|
||||
/// </summary>
|
||||
/// <param name="checkNoticeId"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.ProjectSupervision_Rectify GetRectifyByCheckNoticeId(string checkNoticeId)
|
||||
{
|
||||
return Funs.DB.ProjectSupervision_Rectify.FirstOrDefault(e => e.CheckNoticeId == checkNoticeId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加隐患整改
|
||||
/// </summary>
|
||||
/// <param name="rectify"></param>
|
||||
public static void AddRectify(Model.ProjectSupervision_Rectify rectify)
|
||||
{
|
||||
Model.ProjectSupervision_Rectify newRectify = new Model.ProjectSupervision_Rectify();
|
||||
newRectify.RectifyId = rectify.RectifyId;
|
||||
newRectify.RectifyCode = rectify.RectifyCode;
|
||||
newRectify.ProjectId = rectify.ProjectId;
|
||||
newRectify.CheckManIds = rectify.CheckManIds;
|
||||
newRectify.CheckManNames = rectify.CheckManNames;
|
||||
newRectify.CheckedDate = rectify.CheckedDate;
|
||||
newRectify.HiddenHazardType = rectify.HiddenHazardType;
|
||||
newRectify.SignPerson = rectify.SignPerson;
|
||||
newRectify.CheckNoticeId = rectify.CheckNoticeId;
|
||||
newRectify.States = rectify.States;
|
||||
Funs.DB.ProjectSupervision_Rectify.InsertOnSubmit(newRectify);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改
|
||||
/// </summary>
|
||||
/// <param name="rectify"></param>
|
||||
public static void UpdateRectify(Model.ProjectSupervision_Rectify rectify)
|
||||
{
|
||||
Model.ProjectSupervision_Rectify newRectify = Funs.DB.ProjectSupervision_Rectify.FirstOrDefault(e => e.RectifyId == rectify.RectifyId);
|
||||
if (newRectify != null)
|
||||
{
|
||||
newRectify.RectifyCode = rectify.RectifyCode;
|
||||
newRectify.ProjectId = rectify.ProjectId;
|
||||
newRectify.CheckManIds = rectify.CheckManIds;
|
||||
newRectify.CheckManNames = rectify.CheckManNames;
|
||||
newRectify.CheckedDate = rectify.CheckedDate;
|
||||
newRectify.HiddenHazardType = rectify.HiddenHazardType;
|
||||
newRectify.SignPerson = rectify.SignPerson;
|
||||
newRectify.States = rectify.States;
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据检查通知Id获取隐患整改信息
|
||||
/// </summary>
|
||||
/// <param name="checkNoticeId"></param>
|
||||
public static void DeleteRectifyByCheckNoticeId(string checkNoticeId)
|
||||
{
|
||||
Model.ProjectSupervision_Rectify newRectify = Funs.DB.ProjectSupervision_Rectify.FirstOrDefault(e => e.CheckNoticeId == checkNoticeId);
|
||||
if (newRectify != null)
|
||||
{
|
||||
Funs.DB.ProjectSupervision_Rectify.DeleteOnSubmit(newRectify);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user