20210430
This commit is contained in:
@@ -0,0 +1,174 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
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 checkFiles = from x in db.Check_CheckInfo_CheckFile where x.CheckInfoId == checkInfoId select x;
|
||||
//if (checkFiles.Count() > 0)
|
||||
//{
|
||||
// foreach (var item in checkFiles)
|
||||
// {
|
||||
// BLL.CheckFileService.DeleteCheckFileByCheckFileId(item.CheckFileId);
|
||||
// }
|
||||
//}
|
||||
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 sysUser = BLL.UserService.GetUserByUserId(userId);
|
||||
if (sysUser != null)
|
||||
{
|
||||
var checkInfoIdList = (from x in Funs.DB.ProjectSupervision_CheckTeam
|
||||
where x.UserName == sysUser.UserName && x.UnitId == sysUser.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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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,47 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
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,57 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
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,60 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
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,91 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
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