1
This commit is contained in:
@@ -0,0 +1,98 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
/// <summary>
|
||||
/// 控制点检查检测
|
||||
/// </summary>
|
||||
public static class ControlPointCheckService
|
||||
{
|
||||
/// <summary>
|
||||
/// 根据控制点检查信息
|
||||
/// </summary>
|
||||
/// <param name="inspectionId"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.CQMS_Foreign_ControlPointCheck GetControlPointCheckById(string controlPointCheckId)
|
||||
{
|
||||
return Funs.DB.CQMS_Foreign_ControlPointCheck.FirstOrDefault(e => e.ControlPointCheckId == controlPointCheckId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加控制点检查信息
|
||||
/// </summary>
|
||||
/// <param name="controlPointCheck"></param>
|
||||
public static void AddControlPointCheck(Model.CQMS_Foreign_ControlPointCheck controlPointCheck)
|
||||
{
|
||||
Model.CQMS_Foreign_ControlPointCheck newControlPointCheck = new Model.CQMS_Foreign_ControlPointCheck();
|
||||
newControlPointCheck.ControlPointCheckId = controlPointCheck.ControlPointCheckId;
|
||||
newControlPointCheck.ProjectId = controlPointCheck.ProjectId;
|
||||
newControlPointCheck.UnitId = controlPointCheck.UnitId;
|
||||
newControlPointCheck.CNProfessionalId = controlPointCheck.CNProfessionalId;
|
||||
newControlPointCheck.InspectionCode = controlPointCheck.InspectionCode;
|
||||
newControlPointCheck.UnitWorkId = controlPointCheck.UnitWorkId;
|
||||
newControlPointCheck.Branch = controlPointCheck.Branch;
|
||||
newControlPointCheck.ControlPointType = controlPointCheck.ControlPointType;
|
||||
newControlPointCheck.AcceptanceSite = controlPointCheck.AcceptanceSite;
|
||||
newControlPointCheck.IsOnceQualified = controlPointCheck.IsOnceQualified;
|
||||
newControlPointCheck.InspectionDate = controlPointCheck.InspectionDate;
|
||||
newControlPointCheck.AttachUrl = controlPointCheck.AttachUrl;
|
||||
newControlPointCheck.NoticeCode = controlPointCheck.NoticeCode;
|
||||
newControlPointCheck.ParentDivisionProjectId = controlPointCheck.ParentDivisionProjectId;
|
||||
newControlPointCheck.CheckDate = controlPointCheck.CheckDate;
|
||||
newControlPointCheck.CheckMan = controlPointCheck.CheckMan;
|
||||
newControlPointCheck.CompileMan = controlPointCheck.CompileMan;
|
||||
newControlPointCheck.CompileDate = controlPointCheck.CompileDate;
|
||||
newControlPointCheck.UnqualifiedReason = controlPointCheck.UnqualifiedReason;
|
||||
newControlPointCheck.AcceptanceCheckMan = controlPointCheck.AcceptanceCheckMan;
|
||||
Funs.DB.CQMS_Foreign_ControlPointCheck.InsertOnSubmit(newControlPointCheck);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改控制点检查信息
|
||||
/// </summary>
|
||||
/// <param name="controlPointCheck"></param>
|
||||
public static void UpdateControlPointCheck(Model.CQMS_Foreign_ControlPointCheck controlPointCheck)
|
||||
{
|
||||
Model.CQMS_Foreign_ControlPointCheck newControlPointCheck = Funs.DB.CQMS_Foreign_ControlPointCheck.FirstOrDefault(e => e.ControlPointCheckId == controlPointCheck.ControlPointCheckId);
|
||||
if (newControlPointCheck != null)
|
||||
{
|
||||
newControlPointCheck.ProjectId = controlPointCheck.ProjectId;
|
||||
newControlPointCheck.UnitId = controlPointCheck.UnitId;
|
||||
newControlPointCheck.CNProfessionalId = controlPointCheck.CNProfessionalId;
|
||||
newControlPointCheck.InspectionCode = controlPointCheck.InspectionCode;
|
||||
newControlPointCheck.UnitWorkId = controlPointCheck.UnitWorkId;
|
||||
newControlPointCheck.Branch = controlPointCheck.Branch;
|
||||
newControlPointCheck.ControlPointType = controlPointCheck.ControlPointType;
|
||||
newControlPointCheck.AcceptanceSite = controlPointCheck.AcceptanceSite;
|
||||
newControlPointCheck.IsOnceQualified = controlPointCheck.IsOnceQualified;
|
||||
newControlPointCheck.InspectionDate = controlPointCheck.InspectionDate;
|
||||
newControlPointCheck.AttachUrl = controlPointCheck.AttachUrl;
|
||||
newControlPointCheck.NoticeCode = controlPointCheck.NoticeCode;
|
||||
newControlPointCheck.ParentDivisionProjectId = controlPointCheck.ParentDivisionProjectId;
|
||||
newControlPointCheck.UnqualifiedReason = controlPointCheck.UnqualifiedReason;
|
||||
newControlPointCheck.AcceptanceCheckMan = controlPointCheck.AcceptanceCheckMan;
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键删除控制点检查信息
|
||||
/// </summary>
|
||||
/// <param name="controlPointCheckId"></param>
|
||||
public static void DeleteControlPointCheck(string controlPointCheckId)
|
||||
{
|
||||
Model.CQMS_Foreign_ControlPointCheck controlPointCheck = Funs.DB.CQMS_Foreign_ControlPointCheck.FirstOrDefault(e => e.ControlPointCheckId == controlPointCheckId);
|
||||
if (controlPointCheck != null)
|
||||
{
|
||||
Funs.DB.CQMS_Foreign_ControlPointCheck.DeleteOnSubmit(controlPointCheck);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,112 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
/// <summary>
|
||||
/// 现场ITP清单
|
||||
/// </summary>
|
||||
public static class ITPListProjectService
|
||||
{
|
||||
/// <summary>
|
||||
/// 根据主键获取ITP信息
|
||||
/// </summary>
|
||||
/// <param name="iTPListId"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.CQMS_Foreign_ITPListProject GetITPListProjectById(string iTPListId)
|
||||
{
|
||||
return Funs.DB.CQMS_Foreign_ITPListProject.FirstOrDefault(e => e.ITPListId == iTPListId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加ITP信息
|
||||
/// </summary>
|
||||
/// <param name="iTP"></param>
|
||||
public static void AddITPListProject(Model.CQMS_Foreign_ITPListProject iTP)
|
||||
{
|
||||
Model.CQMS_Foreign_ITPListProject newITP = new Model.CQMS_Foreign_ITPListProject();
|
||||
newITP.ITPListId = iTP.ITPListId;
|
||||
newITP.ProjectId = iTP.ProjectId;
|
||||
newITP.Name = iTP.Name;
|
||||
newITP.CompileMan = iTP.CompileMan;
|
||||
newITP.CompileDate = iTP.CompileDate;
|
||||
newITP.AttachUrl = iTP.AttachUrl;
|
||||
newITP.UnitId = iTP.UnitId;
|
||||
newITP.InstallationId = iTP.InstallationId;
|
||||
newITP.CNProfessionalCode = iTP.CNProfessionalCode;
|
||||
newITP.DocCode = iTP.DocCode;
|
||||
newITP.CheckLevel = iTP.CheckLevel;
|
||||
newITP.CheckContent = iTP.CheckContent;
|
||||
newITP.CheckDate = iTP.CheckDate;
|
||||
newITP.FileType = iTP.FileType;
|
||||
newITP.Memo = iTP.Memo;
|
||||
newITP.UnitWorkId = iTP.UnitWorkId;
|
||||
|
||||
|
||||
Funs.DB.CQMS_Foreign_ITPListProject.InsertOnSubmit(newITP);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改ITP信息
|
||||
/// </summary>
|
||||
/// <param name="iTP"></param>
|
||||
public static void UpdateITPListProject(Model.CQMS_Foreign_ITPListProject iTP)
|
||||
{
|
||||
Model.CQMS_Foreign_ITPListProject newITP = Funs.DB.CQMS_Foreign_ITPListProject.FirstOrDefault(e => e.ITPListId == iTP.ITPListId);
|
||||
if (newITP != null)
|
||||
{
|
||||
newITP.Name = iTP.Name;
|
||||
newITP.CompileMan = iTP.CompileMan;
|
||||
newITP.CompileDate = iTP.CompileDate;
|
||||
newITP.AttachUrl = iTP.AttachUrl;
|
||||
newITP.UnitId = iTP.UnitId;
|
||||
newITP.InstallationId = iTP.InstallationId;
|
||||
newITP.CNProfessionalCode = iTP.CNProfessionalCode;
|
||||
newITP.DocCode = iTP.DocCode;
|
||||
newITP.CheckLevel = iTP.CheckLevel;
|
||||
newITP.CheckContent = iTP.CheckContent;
|
||||
newITP.CheckDate = iTP.CheckDate;
|
||||
newITP.FileType = iTP.FileType;
|
||||
newITP.Memo = iTP.Memo;
|
||||
newITP.UnitWorkId = iTP.UnitWorkId;
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键删除ITP信息
|
||||
/// </summary>
|
||||
/// <param name="iTPListId"></param>
|
||||
public static void DeleteITPListProjectById(string iTPListId)
|
||||
{
|
||||
Model.CQMS_Foreign_ITPListProject newITP = Funs.DB.CQMS_Foreign_ITPListProject.FirstOrDefault(e => e.ITPListId == iTPListId);
|
||||
if (newITP != null)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(newITP.AttachUrl))
|
||||
{
|
||||
UploadAttachmentService.DeleteFile(Funs.RootPath, newITP.AttachUrl);
|
||||
}
|
||||
Funs.DB.CQMS_Foreign_ITPListProject.DeleteOnSubmit(newITP);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据项目删除ITP信息
|
||||
/// </summary>
|
||||
/// <param name="iTPListId"></param>
|
||||
public static void DeleteITPListProjectByProjectId(string projectId)
|
||||
{
|
||||
var newITP = from x in Funs.DB.CQMS_Foreign_ITPListProject where x.ProjectId == projectId select x;
|
||||
if (newITP != null)
|
||||
{
|
||||
Funs.DB.CQMS_Foreign_ITPListProject.DeleteAllOnSubmit(newITP);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
/// <summary>
|
||||
/// ITP清单
|
||||
/// </summary>
|
||||
public static class ITPListService
|
||||
{
|
||||
/// <summary>
|
||||
/// 根据主键获取ITP清单
|
||||
/// </summary>
|
||||
/// <param name="itpListId"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.CQMS_Foreign_ITPList GetITPListById(string itpListId)
|
||||
{
|
||||
return Funs.DB.CQMS_Foreign_ITPList.FirstOrDefault(e => e.ITPListId == itpListId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加
|
||||
/// </summary>
|
||||
/// <param name="itpList"></param>
|
||||
public static void AddITPList(Model.CQMS_Foreign_ITPList itpList)
|
||||
{
|
||||
Model.CQMS_Foreign_ITPList newITPList = new Model.CQMS_Foreign_ITPList();
|
||||
newITPList.ITPListId = itpList.ITPListId;
|
||||
newITPList.ITPName = itpList.ITPName;
|
||||
newITPList.CompileMan = itpList.CompileMan;
|
||||
newITPList.CompileDate = itpList.CompileDate;
|
||||
Funs.DB.CQMS_Foreign_ITPList.InsertOnSubmit(newITPList);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改
|
||||
/// </summary>
|
||||
/// <param name="itpList"></param>
|
||||
public static void UpdateITPList(Model.CQMS_Foreign_ITPList itpList)
|
||||
{
|
||||
Model.CQMS_Foreign_ITPList newITPList = Funs.DB.CQMS_Foreign_ITPList.FirstOrDefault(e => e.ITPListId == itpList.ITPListId);
|
||||
if (newITPList!=null)
|
||||
{
|
||||
newITPList.ITPName = itpList.ITPName;
|
||||
newITPList.CompileMan = itpList.CompileMan;
|
||||
newITPList.CompileDate = itpList.CompileDate;
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键删除ITP清单
|
||||
/// </summary>
|
||||
/// <param name="itpListId"></param>
|
||||
public static void DeleteITPListById(string itpListId)
|
||||
{
|
||||
Model.CQMS_Foreign_ITPList itpList = Funs.DB.CQMS_Foreign_ITPList.FirstOrDefault(e => e.ITPListId == itpListId);
|
||||
if (itpList != null)
|
||||
{
|
||||
Funs.DB.CQMS_Foreign_ITPList.DeleteOnSubmit(itpList);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 判断名称是否存在
|
||||
/// </summary>
|
||||
/// <param name="iTPListId"></param>
|
||||
/// <param name="name"></param>
|
||||
/// <returns></returns>
|
||||
public static bool IsExistITPName(string iTPListId, string name)
|
||||
{
|
||||
bool isExist = false;
|
||||
var q = Funs.DB.CQMS_Foreign_ITPList.FirstOrDefault(e => e.ITPName == name && e.ITPListId != iTPListId);
|
||||
if (q != null)
|
||||
{
|
||||
isExist = true;
|
||||
}
|
||||
return isExist;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user