增加数据穿透界面
This commit is contained in:
@@ -175,6 +175,7 @@
|
||||
<Compile Include="BaseInfo\QualityQuestionTypeService.cs" />
|
||||
<Compile Include="BaseInfo\QuestionTypeService.cs" />
|
||||
<Compile Include="BaseInfo\RectificationMeasureService.cs" />
|
||||
<Compile Include="BaseInfo\RiskLevelService.cs" />
|
||||
<Compile Include="BaseInfo\RulesRegulationsTypeService.cs" />
|
||||
<Compile Include="BaseInfo\SafetyMeasuresService.cs" />
|
||||
<Compile Include="BaseInfo\SolutionTempleteTypeService.cs" />
|
||||
@@ -379,6 +380,7 @@
|
||||
<Compile Include="HSSE\Check\Check_PauseNoticeService.cs" />
|
||||
<Compile Include="HSSE\Check\Check_ProjectCheckItemDetailService.cs" />
|
||||
<Compile Include="HSSE\Check\Check_ProjectCheckItemSetService.cs" />
|
||||
<Compile Include="HSSE\Check\Check_ProjectLeaderCheckService.cs" />
|
||||
<Compile Include="HSSE\Check\ContactListService.cs" />
|
||||
<Compile Include="HSSE\Check\HSECertificateService.cs" />
|
||||
<Compile Include="HSSE\Check\IncentiveNoticeService.cs" />
|
||||
@@ -427,6 +429,9 @@
|
||||
<Compile Include="HSSE\Hazard\Hazard_HazardListService.cs" />
|
||||
<Compile Include="HSSE\Hazard\Hazard_HazardSelectedItemService.cs" />
|
||||
<Compile Include="HSSE\Hazard\Hazard_OtherHazardService.cs" />
|
||||
<Compile Include="HSSE\Hazard\Hazard_PatrolPlanService.cs" />
|
||||
<Compile Include="HSSE\Hazard\Hazard_RoutingInspectionService.cs" />
|
||||
<Compile Include="HSSE\Hazard\RiskEvaluationRecordService.cs" />
|
||||
<Compile Include="HSSE\HiddenInspection\HSSE_Hazard_HazardRegisterService.cs" />
|
||||
<Compile Include="HSSE\HSSESystem\HSSEMainDutyService.cs" />
|
||||
<Compile Include="HSSE\HSSESystem\ServerSafetyInstitutionService.cs" />
|
||||
@@ -518,6 +523,7 @@
|
||||
<Compile Include="HSSE\Meeting\AttendMeetingService.cs" />
|
||||
<Compile Include="HSSE\Meeting\ClassMeetingService.cs" />
|
||||
<Compile Include="HSSE\Meeting\MonthMeetingService.cs" />
|
||||
<Compile Include="HSSE\Meeting\SafetyLeaderGroupMeetingService.cs" />
|
||||
<Compile Include="HSSE\Meeting\SpecialMeetingService.cs" />
|
||||
<Compile Include="HSSE\Meeting\WeekMeetingService.cs" />
|
||||
<Compile Include="HSSE\CostGoods\ExpenseDetailService.cs" />
|
||||
@@ -778,6 +784,8 @@
|
||||
<Compile Include="ZHGL\DataSync\SYHSEData_HiddenDangerCheckService.cs" />
|
||||
<Compile Include="ZHGL\DataSync\SYHSEData_RiskControlService.cs" />
|
||||
<Compile Include="ZHGL\DataSync\SYHSEData_SYHSEService.cs" />
|
||||
<Compile Include="ZHGL\Emergency\UnitDrillRecordListService.cs" />
|
||||
<Compile Include="ZHGL\Emergency\UnitEmergencyListService.cs" />
|
||||
<Compile Include="ZHGL\Environmental\ArchitectureReportItemService.cs" />
|
||||
<Compile Include="ZHGL\Environmental\ArchitectureReportService.cs" />
|
||||
<Compile Include="ZHGL\Environmental\ChemicalReportItemService.cs" />
|
||||
@@ -809,6 +817,9 @@
|
||||
<Compile Include="ZHGL\Information\MillionsMonthlyReportService.cs" />
|
||||
<Compile Include="ZHGL\Information\SafetyQuarterlyReportService.cs" />
|
||||
<Compile Include="ZHGL\Information\WorkSummaryReportService.cs" />
|
||||
<Compile Include="ZHGL\Meeting\CompanySafetyMeetingService.cs" />
|
||||
<Compile Include="ZHGL\Meeting\CompanySpecialMeetingService.cs" />
|
||||
<Compile Include="ZHGL\Person\CompanyBranchPersonService.cs" />
|
||||
<Compile Include="ZHGL\ProjectAccident\AccidentAnalysisItemService.cs" />
|
||||
<Compile Include="ZHGL\ProjectAccident\AccidentAnalysisService.cs" />
|
||||
<Compile Include="ZHGL\ProjectAccident\AccidentStatisticsService.cs" />
|
||||
|
||||
@@ -34,6 +34,8 @@ namespace BLL
|
||||
CertificateId = certificate.CertificateId,
|
||||
CertificateCode = certificate.CertificateCode,
|
||||
CertificateName = certificate.CertificateName,
|
||||
CertificateType = certificate.CertificateType,
|
||||
IsRegisterHSSE = certificate.IsRegisterHSSE,
|
||||
Remark = certificate.Remark
|
||||
};
|
||||
db.Base_Certificate.InsertOnSubmit(newCertificate);
|
||||
@@ -52,6 +54,8 @@ namespace BLL
|
||||
{
|
||||
newCertificate.CertificateCode = certificate.CertificateCode;
|
||||
newCertificate.CertificateName = certificate.CertificateName;
|
||||
newCertificate.CertificateType = certificate.CertificateType;
|
||||
newCertificate.IsRegisterHSSE = certificate.IsRegisterHSSE;
|
||||
newCertificate.Remark = certificate.Remark;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,122 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
/// <summary>
|
||||
/// 许可证类型
|
||||
/// </summary>
|
||||
public static class RiskLevelService
|
||||
{
|
||||
public static Model.SGGLDB db = Funs.DB;
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键获取许可证类型
|
||||
/// </summary>
|
||||
/// <param name="licenseTypeId"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.Base_RiskLevel GetRiskLevel(string riskLevelId)
|
||||
{
|
||||
return Funs.DB.Base_RiskLevel.FirstOrDefault(e => e.RiskLevelId == riskLevelId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加许可证类型
|
||||
/// </summary>
|
||||
/// <param name="licenseType"></param>
|
||||
public static void AddRiskLevel(Model.Base_RiskLevel reskLevel)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.Base_RiskLevel newreskLevel = new Model.Base_RiskLevel
|
||||
{
|
||||
RiskLevelId = reskLevel.RiskLevelId,
|
||||
RiskLevel = reskLevel.RiskLevel,
|
||||
RiskLevelName = reskLevel.RiskLevelName,
|
||||
ControlMeasures = reskLevel.ControlMeasures,
|
||||
Days = reskLevel.Days,
|
||||
Remark = reskLevel.Remark,
|
||||
MaxValue = reskLevel.MaxValue,
|
||||
MinValue = reskLevel.MinValue
|
||||
};
|
||||
db.Base_RiskLevel.InsertOnSubmit(newreskLevel);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改许可证类型
|
||||
/// </summary>
|
||||
/// <param name="licenseType"></param>
|
||||
public static void UpdateLicenseType(Model.Base_RiskLevel riskLevel)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.Base_RiskLevel newRiskLevel = db.Base_RiskLevel.FirstOrDefault(e => e.RiskLevelId == riskLevel.RiskLevelId);
|
||||
if (newRiskLevel != null)
|
||||
{
|
||||
newRiskLevel.RiskLevel = riskLevel.RiskLevel;
|
||||
newRiskLevel.RiskLevelName = riskLevel.RiskLevelName;
|
||||
newRiskLevel.MinValue = riskLevel.MinValue;
|
||||
newRiskLevel.MaxValue = riskLevel.MaxValue;
|
||||
newRiskLevel.ControlMeasures = riskLevel.ControlMeasures;
|
||||
newRiskLevel.Days = riskLevel.Days;
|
||||
newRiskLevel.Remark = riskLevel.Remark;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键删除许可证类型
|
||||
/// </summary>
|
||||
/// <param name="licenseTypeId"></param>
|
||||
public static void DeleteRiskLevelById(string riskLevelId)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.Base_RiskLevel riskLevel = db.Base_RiskLevel.FirstOrDefault(e => e.RiskLevelId== riskLevelId);
|
||||
if (riskLevel != null)
|
||||
{
|
||||
db.Base_RiskLevel.DeleteOnSubmit(riskLevel);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取许可证类型下拉选择项
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static List<Model.Base_RiskLevel> GetLicenseTypeList()
|
||||
{
|
||||
return (from x in Funs.DB.Base_RiskLevel orderby x.RiskLevel select x).ToList();
|
||||
}
|
||||
|
||||
#region 许可证类型下拉框
|
||||
/// <summary>
|
||||
/// 许可证类型下拉框
|
||||
/// </summary>
|
||||
/// <param name="dropName">下拉框名字</param>
|
||||
/// <param name="isShowPlease">是否显示请选择</param>
|
||||
public static void InitRiskLevelDropDownList(FineUIPro.DropDownList dropName, bool isShowPlease)
|
||||
{
|
||||
dropName.DataValueField = "RiskLevelId";
|
||||
dropName.DataTextField = "RiskLevelName";
|
||||
dropName.DataSource = GetLicenseTypeList();
|
||||
dropName.DataBind();
|
||||
if (isShowPlease)
|
||||
{
|
||||
Funs.FineUIPleaseSelect(dropName);
|
||||
}
|
||||
}
|
||||
public static void InitRiskLevelDropDownListByRiskLevelName(FineUIPro.DropDownList dropName, bool isShowPlease)
|
||||
{
|
||||
dropName.DataValueField = "RiskLevelName";
|
||||
dropName.DataTextField = "RiskLevelName";
|
||||
dropName.DataSource = GetLicenseTypeList();
|
||||
dropName.DataBind();
|
||||
if (isShowPlease)
|
||||
{
|
||||
Funs.FineUIPleaseSelect(dropName);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -37,6 +37,7 @@ namespace BLL
|
||||
WorkPostName = workPost.WorkPostName,
|
||||
PostType = workPost.PostType,
|
||||
IsHsse = workPost.IsHsse,
|
||||
IsCQMS = workPost.IsCQMS,
|
||||
CNCodes = workPost.CNCodes,
|
||||
Remark = workPost.Remark
|
||||
};
|
||||
@@ -59,6 +60,7 @@ namespace BLL
|
||||
newWorkPost.WorkPostName = workPost.WorkPostName;
|
||||
newWorkPost.PostType = workPost.PostType;
|
||||
newWorkPost.IsHsse = workPost.IsHsse;
|
||||
newWorkPost.IsCQMS = workPost.IsCQMS;
|
||||
newWorkPost.CNCodes = workPost.CNCodes;
|
||||
newWorkPost.Remark = workPost.Remark;
|
||||
db.SubmitChanges();
|
||||
|
||||
@@ -140,7 +140,7 @@ namespace BLL
|
||||
newDesignDetails.CompileDate = designDetails.CompileDate;
|
||||
newDesignDetails.Status = designDetails.Status;
|
||||
newDesignDetails.AuditMan = designDetails.AuditMan;
|
||||
|
||||
newDesignDetails.JoinPersonNum = designDetails.JoinPersonNum;
|
||||
|
||||
db.Comprehensive_DesignDetails.InsertOnSubmit(newDesignDetails);
|
||||
db.SubmitChanges();
|
||||
@@ -166,6 +166,7 @@ namespace BLL
|
||||
newDesignDetails.AttachUrl = designDetails.AttachUrl;
|
||||
newDesignDetails.Status = designDetails.Status;
|
||||
newDesignDetails.AuditMan = designDetails.AuditMan;
|
||||
newDesignDetails.JoinPersonNum = designDetails.JoinPersonNum;
|
||||
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
@@ -113,7 +113,7 @@ namespace BLL
|
||||
newInspectionMachine.InspectionMachineCode = inspectionMachine.InspectionMachineCode;
|
||||
newInspectionMachine.InspectionMachineName = inspectionMachine.InspectionMachineName;
|
||||
newInspectionMachine.SpecificationModel = inspectionMachine.SpecificationModel;
|
||||
|
||||
newInspectionMachine.IsCheckOK = inspectionMachine.IsCheckOK;
|
||||
newInspectionMachine.InspectionType = inspectionMachine.InspectionType;
|
||||
newInspectionMachine.NextTestDate = inspectionMachine.NextTestDate;
|
||||
newInspectionMachine.TestCycle = inspectionMachine.TestCycle;
|
||||
@@ -147,7 +147,7 @@ namespace BLL
|
||||
newInspectionMachine.InspectionMachineCode = inspectionMachine.InspectionMachineCode;
|
||||
newInspectionMachine.InspectionMachineName = inspectionMachine.InspectionMachineName;
|
||||
newInspectionMachine.SpecificationModel = inspectionMachine.SpecificationModel;
|
||||
|
||||
newInspectionMachine.IsCheckOK = inspectionMachine.IsCheckOK;
|
||||
newInspectionMachine.InspectionType = inspectionMachine.InspectionType;
|
||||
newInspectionMachine.NextTestDate = inspectionMachine.NextTestDate;
|
||||
newInspectionMachine.TestCycle = inspectionMachine.TestCycle;
|
||||
|
||||
@@ -60,6 +60,7 @@ namespace BLL
|
||||
newInspectionPerson.IsOnSite = inspectionPerson.IsOnSite;
|
||||
newInspectionPerson.UnitWorkId = inspectionPerson.UnitWorkId;
|
||||
newInspectionPerson.Status = inspectionPerson.Status;
|
||||
newInspectionPerson.IsTrain = inspectionPerson.IsTrain;
|
||||
db.Comprehensive_InspectionPerson.InsertOnSubmit(newInspectionPerson);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
@@ -90,6 +91,7 @@ namespace BLL
|
||||
newInspectionPerson.IsOnSite = inspectionPerson.IsOnSite;
|
||||
newInspectionPerson.UnitWorkId = inspectionPerson.UnitWorkId;
|
||||
newInspectionPerson.Status = inspectionPerson.Status;
|
||||
newInspectionPerson.IsTrain = inspectionPerson.IsTrain;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1002,6 +1002,10 @@ namespace BLL
|
||||
/// 执业资格证书证书
|
||||
/// </summary>
|
||||
public const string PracticeCertificateMenuId = "1390195D8-874B-4E7B-8DBF-D81A5984E973";
|
||||
/// <summary>
|
||||
/// 风险等级
|
||||
/// </summary>
|
||||
public const string RiskLevelMenuId = "E4B526CC-805E-4131-8E18-2FFA6871507E";
|
||||
#endregion
|
||||
|
||||
#region 质量基础信息
|
||||
@@ -1702,6 +1706,22 @@ namespace BLL
|
||||
/// 危险源辨识与评价清单
|
||||
/// </summary>
|
||||
public const string ProjectHazardListMenuId = "EDC50857-7762-4498-83C6-5BDE85036BAB";
|
||||
/// <summary>
|
||||
/// 风险信息库
|
||||
/// </summary>
|
||||
public const string ProjectHazardInfoMenuId = "74A6B343-5837-416B-AE9C-D2BBCA08E41F";
|
||||
/// <summary>
|
||||
/// 风险分级管控
|
||||
/// </summary>
|
||||
public const string ProjectRiskControlMenuId = "F6A6D53A-150E-43DB-A3C4-6FA18E9401E9";
|
||||
/// <summary>
|
||||
/// 风险巡检记录
|
||||
/// </summary>
|
||||
public const string ProjectRoutingInspectionMenuId = "D256E5C8-DC76-4F4D-BABE-A253418823F4";
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public const string EpidemicPersonMenuId = "E485D454-0443-461E-A521-2B9E27813B0B";
|
||||
|
||||
/// <summary>
|
||||
/// 风险提示
|
||||
@@ -1946,6 +1966,10 @@ namespace BLL
|
||||
/// </summary>
|
||||
public const string ProjectCheckColligationMenuId = "C198EBA8-9E23-4654-92E1-09C61105C522";
|
||||
/// <summary>
|
||||
/// 领导带班检查
|
||||
/// </summary>
|
||||
public const string ProjectLeaderCheckMenuId = "355265DE-901A-4110-B934-B4DA067C4334";
|
||||
/// <summary>
|
||||
/// HSSE综合检查(五环)
|
||||
/// </summary>
|
||||
public const string ProjectCheckColligationWHMenuId = "E8363923-06CD-47C2-BFE1-F18212094710";
|
||||
@@ -2060,6 +2084,10 @@ namespace BLL
|
||||
|
||||
#region HSSE会议管理
|
||||
/// <summary>
|
||||
/// 安全领导小组会议
|
||||
/// </summary>
|
||||
public const string ProjectSafetyLeaderGroupMeetingMenuId = "DFB56743-17BA-40BA-82EA-FCB9B0DBFAFF";
|
||||
/// <summary>
|
||||
/// HSSE周例会
|
||||
/// </summary>
|
||||
public const string ProjectWeekMeetingMenuId = "5236B1D9-8B57-495E-8644-231DF5D066CE";
|
||||
@@ -3093,6 +3121,14 @@ namespace BLL
|
||||
/// 施工进度报表模板
|
||||
/// </summary>
|
||||
public const string JDReportTemplateUrl = "File\\Word\\JDGL\\施工进度报表.docx";
|
||||
/// <summary>
|
||||
/// 企业总部人员模版文件原始的虚拟路径
|
||||
/// </summary>
|
||||
public const string CompanyPersonTemplateUrl = "File\\Excel\\DataIn\\企业总部人员信息模版.xls";
|
||||
/// <summary>
|
||||
/// 分支机构人员模版文件原始的虚拟路径
|
||||
/// </summary>
|
||||
public const string BranchPersonTemplateUrl = "File\\Excel\\DataIn\\分支机构人员信息模版.xls";
|
||||
#endregion
|
||||
|
||||
#region 绩效考核模板文件路径
|
||||
@@ -4619,6 +4655,45 @@ namespace BLL
|
||||
/// 项目级施工日志
|
||||
/// </summary>
|
||||
public const string WorkHandoverMenuId = "CD88CE2A-A8E2-4F07-9A90-9161BD1C345C";
|
||||
|
||||
#region 人员管理
|
||||
/// <summary>
|
||||
/// 企业总部人员
|
||||
/// </summary>
|
||||
public const string CompanyPersonMenuId = "8E229597-B2D8-407B-8192-787E65E5052E";
|
||||
|
||||
/// <summary>
|
||||
/// 分支机构人员
|
||||
/// </summary>
|
||||
public const string BranchPersonMenuId = "FE342650-9E64-4B9C-8023-34399E198B6F";
|
||||
#endregion
|
||||
|
||||
#region 公司安全会议
|
||||
/// <summary>
|
||||
/// 企业安委会
|
||||
/// </summary>
|
||||
public const string CompanySafetyMeetingMenuId = "B911B4F8-DDFD-4F37-9EAC-EB104F753432";
|
||||
|
||||
/// <summary>
|
||||
/// 企业专题会
|
||||
/// </summary>
|
||||
public const string CompanySpecialMeetingMenuId = "2497EF13-C052-4228-B388-EBC5C18963BC";
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// HSSE应急预案管理清单
|
||||
/// </summary>
|
||||
public const string UnitEmergencyListMenuId = "D12C2412-E12A-4F78-9AEF-1EE8AC84A561";
|
||||
|
||||
/// <summary>
|
||||
/// 应急演练
|
||||
/// </summary>
|
||||
public const string UnitDrillRecordListMenuId = "172F25E0-F5E2-42E3-AD67-AC824D4E0FBB";
|
||||
|
||||
/// <summary>
|
||||
/// 项目应急物资管理
|
||||
/// </summary>
|
||||
public const string ServerEmergencySupplyMenuId = "3EA741CE-66A6-4CF8-8620-0C5906AC7D94";
|
||||
#endregion
|
||||
|
||||
#region 施工综合流程定义
|
||||
|
||||
@@ -103,5 +103,50 @@ namespace BLL
|
||||
return true;//符合15位身份证标准
|
||||
}
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// 根据身份证号码获取生日
|
||||
/// </summary>
|
||||
/// <param name="IDCard"></param>
|
||||
/// <returns></returns>
|
||||
public static DateTime? getBirthByIDCard(string IDCard)
|
||||
{
|
||||
DateTime? birth = null;
|
||||
if (!string.IsNullOrEmpty(IDCard))
|
||||
{
|
||||
string birthStr = string.Empty;
|
||||
if (IDCard.Length == 18)
|
||||
{
|
||||
birthStr = IDCard.Substring(6, 8).Insert(6, "-").Insert(4, "-");
|
||||
|
||||
}
|
||||
else if (IDCard.Length == 15)
|
||||
{
|
||||
birthStr = IDCard.Substring(6, 6).Insert(4, "-").Insert(2, "-");
|
||||
}
|
||||
|
||||
DateTime time = new DateTime();
|
||||
if (DateTime.TryParse(birthStr, out time))
|
||||
{
|
||||
birth = time;
|
||||
}
|
||||
}
|
||||
|
||||
return birth;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取年龄
|
||||
/// </summary>
|
||||
/// <param name="birthDate"></param>
|
||||
/// <param name="now"></param>
|
||||
/// <returns></returns>
|
||||
public static int CalculateAgeCorrect(DateTime birthDate)
|
||||
{
|
||||
DateTime now = DateTime.Now;
|
||||
int age = now.Year - birthDate.Year;
|
||||
if (now.Month < birthDate.Month || (now.Month == birthDate.Month && now.Day < birthDate.Day)) age--;
|
||||
return age;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -46,7 +46,8 @@ namespace BLL
|
||||
FileContent = accidentPersonRecord.FileContent,
|
||||
CompileMan = accidentPersonRecord.CompileMan,
|
||||
CompileDate = accidentPersonRecord.CompileDate,
|
||||
States = accidentPersonRecord.States
|
||||
States = accidentPersonRecord.States,
|
||||
IsAttempt= accidentPersonRecord.IsAttempt,
|
||||
};
|
||||
db.Accident_AccidentPersonRecord.InsertOnSubmit(newAccidentPersonRecord);
|
||||
db.SubmitChanges();
|
||||
@@ -77,6 +78,7 @@ namespace BLL
|
||||
newAccidentPersonRecord.CompileMan = accidentPersonRecord.CompileMan;
|
||||
newAccidentPersonRecord.CompileDate = accidentPersonRecord.CompileDate;
|
||||
newAccidentPersonRecord.States = accidentPersonRecord.States;
|
||||
newAccidentPersonRecord.IsAttempt= accidentPersonRecord.IsAttempt;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -387,6 +387,7 @@ namespace BLL
|
||||
NotConfirmWorkingHoursLoss = accidentReport.NotConfirmWorkingHoursLoss,
|
||||
NotConfirmEconomicLoss = accidentReport.NotConfirmEconomicLoss,
|
||||
NotConfirmEconomicOtherLoss = accidentReport.NotConfirmEconomicOtherLoss,
|
||||
AccidentDegree = accidentReport.AccidentDegree,
|
||||
NotConfirmed = accidentReport.NotConfirmed
|
||||
};
|
||||
db.Accident_AccidentReport.InsertOnSubmit(newAccidentReport);
|
||||
@@ -430,6 +431,7 @@ namespace BLL
|
||||
newAccidentReport.IsNotConfirm = accidentReport.IsNotConfirm;
|
||||
newAccidentReport.NotConfirmWorkingHoursLoss = accidentReport.NotConfirmWorkingHoursLoss;
|
||||
newAccidentReport.NotConfirmEconomicLoss = accidentReport.NotConfirmEconomicLoss;
|
||||
newAccidentReport.AccidentDegree = accidentReport.AccidentDegree;
|
||||
newAccidentReport.NotConfirmEconomicOtherLoss = accidentReport.NotConfirmEconomicOtherLoss;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,214 @@
|
||||
using FineUIPro;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web.UI.WebControls;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
/// <summary>
|
||||
/// 领导带班检查
|
||||
/// </summary>
|
||||
public static class Check_ProjectLeaderCheckService
|
||||
{
|
||||
public static Model.SGGLDB db = Funs.DB;
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键获取领导带班检查
|
||||
/// </summary>
|
||||
/// <param name="ProjectLeaderCheckId"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.Check_ProjectLeaderCheck GetProjectLeaderCheckById(string ProjectLeaderCheckId)
|
||||
{
|
||||
return Funs.DB.Check_ProjectLeaderCheck.FirstOrDefault(e => e.ProjectLeaderCheckId == ProjectLeaderCheckId);
|
||||
}
|
||||
|
||||
#region 公司两级领导带班检查列表
|
||||
/// <summary>
|
||||
/// 记录数
|
||||
/// </summary>
|
||||
public static int count
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 定义变量
|
||||
/// </summary>
|
||||
private static IQueryable<Model.Check_ProjectLeaderCheck> getDataLists = from x in db.Check_ProjectLeaderCheck
|
||||
select x;
|
||||
|
||||
/// <summary>
|
||||
/// 数据列表
|
||||
/// </summary>
|
||||
/// <param name="unitId"></param>
|
||||
/// <param name="Grid1"></param>
|
||||
/// <returns></returns>
|
||||
public static IEnumerable getListData(string projectId, string startTime, string endTime, Grid Grid1)
|
||||
{
|
||||
IQueryable<Model.Check_ProjectLeaderCheck> getDataList = getDataLists;
|
||||
if (!string.IsNullOrEmpty(projectId))
|
||||
{
|
||||
getDataList = getDataList.Where(x => x.ProjectId == projectId);
|
||||
}
|
||||
if (!string.IsNullOrEmpty(startTime))
|
||||
{
|
||||
DateTime? startTimeD = Funs.GetNewDateTime(startTime);
|
||||
if (startTimeD.HasValue)
|
||||
{
|
||||
getDataList = getDataList.Where(x => x.CheckDate >= startTimeD);
|
||||
}
|
||||
}
|
||||
if (!string.IsNullOrEmpty(endTime))
|
||||
{
|
||||
DateTime? endTimeD = Funs.GetNewDateTime(endTime);
|
||||
if (endTimeD.HasValue)
|
||||
{
|
||||
getDataList = getDataList.Where(x => x.CheckDate <= endTimeD);
|
||||
}
|
||||
}
|
||||
count = getDataList.Count();
|
||||
if (count == 0)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
getDataList = SortConditionHelper.SortingAndPaging(getDataList, Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize);
|
||||
return from x in getDataList
|
||||
join y in db.Base_Project on x.ProjectId equals y.ProjectId
|
||||
into ps
|
||||
from y in ps.DefaultIfEmpty()
|
||||
select new
|
||||
{
|
||||
x.ProjectLeaderCheckId,
|
||||
x.ProjectId,
|
||||
db.Base_Project.First(u => u.ProjectId == x.ProjectId).ProjectName,
|
||||
x.CheckCode,
|
||||
x.UnitIds,
|
||||
x.LeaderIds,
|
||||
x.LeaderNames,
|
||||
x.QuestionDef,
|
||||
x.CheckDate,
|
||||
x.IsHoldMeet,
|
||||
IsHoldMeetName = x.IsHoldMeet == true ? "是" : "否",
|
||||
x.Requirement,
|
||||
};
|
||||
}
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// 根据日期获取领导带班检查集合
|
||||
/// </summary>
|
||||
/// <param name="startTime">开始时间</param>
|
||||
/// <param name="endTime">结束时间</param>
|
||||
/// <param name="projectId">项目号</param>
|
||||
/// <returns>领导带班检查集合</returns>
|
||||
public static List<Model.Check_ProjectLeaderCheck> GetProjectLeaderCheckListsByDate(DateTime startTime, DateTime endTime, string projectId)
|
||||
{
|
||||
return (from x in Funs.DB.Check_ProjectLeaderCheck where x.CheckDate >= startTime && x.CheckDate <= endTime && x.ProjectId == projectId orderby x.CheckDate select x).ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据时间段获取HSE领导带班检查集合
|
||||
/// </summary>
|
||||
/// <param name="startTime">开始时间</param>
|
||||
/// <param name="endTime">结束时间</param>
|
||||
/// <param name="projectId">项目Id</param>
|
||||
/// <returns>时间段内的HSE领导带班检查集合</returns>
|
||||
public static int GetCountByDate(DateTime startTime, DateTime endTime, string projectId)
|
||||
{
|
||||
return (from x in Funs.DB.Check_ProjectLeaderCheck where x.CheckDate >= startTime && x.CheckDate <= endTime && x.ProjectId == projectId select x).Count();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加领导带班检查
|
||||
/// </summary>
|
||||
/// <param name="ProjectLeaderCheck"></param>
|
||||
public static void AddProjectLeaderCheck(Model.Check_ProjectLeaderCheck ProjectLeaderCheck)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.Check_ProjectLeaderCheck newProjectLeaderCheck = new Model.Check_ProjectLeaderCheck
|
||||
{
|
||||
ProjectLeaderCheckId = ProjectLeaderCheck.ProjectLeaderCheckId,
|
||||
ProjectId = ProjectLeaderCheck.ProjectId,
|
||||
UnitIds = ProjectLeaderCheck.UnitIds,
|
||||
CheckCode = ProjectLeaderCheck.CheckCode,
|
||||
LeaderIds = ProjectLeaderCheck.LeaderIds,
|
||||
CheckDate = ProjectLeaderCheck.CheckDate,
|
||||
QuestionDef = ProjectLeaderCheck.QuestionDef,
|
||||
IsHoldMeet = ProjectLeaderCheck.IsHoldMeet,
|
||||
Requirement = ProjectLeaderCheck.Requirement,
|
||||
LeaderNames = ProjectLeaderCheck.LeaderNames,
|
||||
CompileMan = ProjectLeaderCheck.CompileMan,
|
||||
CompileDate = ProjectLeaderCheck.CompileDate,
|
||||
};
|
||||
db.Check_ProjectLeaderCheck.InsertOnSubmit(newProjectLeaderCheck);
|
||||
db.SubmitChanges();
|
||||
CodeRecordsService.InsertCodeRecordsByMenuIdProjectIdUnitId(Const.ProjectLeaderCheckMenuId, ProjectLeaderCheck.ProjectId, null, ProjectLeaderCheck.ProjectLeaderCheckId, ProjectLeaderCheck.CheckDate);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改领导带班检查
|
||||
/// </summary>
|
||||
/// <param name="ProjectLeaderCheck"></param>
|
||||
public static void UpdateProjectLeaderCheck(Model.Check_ProjectLeaderCheck ProjectLeaderCheck)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.Check_ProjectLeaderCheck newProjectLeaderCheck = db.Check_ProjectLeaderCheck.FirstOrDefault(e => e.ProjectLeaderCheckId == ProjectLeaderCheck.ProjectLeaderCheckId);
|
||||
if (newProjectLeaderCheck != null)
|
||||
{
|
||||
newProjectLeaderCheck.UnitIds = ProjectLeaderCheck.UnitIds;
|
||||
newProjectLeaderCheck.CheckCode = ProjectLeaderCheck.CheckCode;
|
||||
newProjectLeaderCheck.LeaderIds = ProjectLeaderCheck.LeaderIds;
|
||||
newProjectLeaderCheck.CheckDate = ProjectLeaderCheck.CheckDate;
|
||||
newProjectLeaderCheck.QuestionDef = ProjectLeaderCheck.QuestionDef;
|
||||
newProjectLeaderCheck.IsHoldMeet = ProjectLeaderCheck.IsHoldMeet;
|
||||
newProjectLeaderCheck.Requirement = ProjectLeaderCheck.Requirement;
|
||||
newProjectLeaderCheck.LeaderNames = ProjectLeaderCheck.LeaderNames;
|
||||
newProjectLeaderCheck.CompileMan = ProjectLeaderCheck.CompileMan;
|
||||
newProjectLeaderCheck.CompileDate = ProjectLeaderCheck.CompileDate;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键删除领导带班检查
|
||||
/// </summary>
|
||||
/// <param name="ProjectLeaderCheckId"></param>
|
||||
public static void DeleteProjectLeaderCheckById(string ProjectLeaderCheckId)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.Check_ProjectLeaderCheck ProjectLeaderCheck = db.Check_ProjectLeaderCheck.FirstOrDefault(e => e.ProjectLeaderCheckId == ProjectLeaderCheckId);
|
||||
if (ProjectLeaderCheck != null)
|
||||
{
|
||||
CodeRecordsService.DeleteCodeRecordsByDataId(ProjectLeaderCheckId);
|
||||
////删除附件表
|
||||
BLL.CommonService.DeleteAttachFileById(ProjectLeaderCheckId);
|
||||
db.Check_ProjectLeaderCheck.DeleteOnSubmit(ProjectLeaderCheck);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
public static string getLeaderName(object ProjectLeaderCheckId)
|
||||
{
|
||||
string name = string.Empty;
|
||||
if (ProjectLeaderCheckId != null)
|
||||
{
|
||||
var getData = Check_ProjectLeaderCheckService.GetProjectLeaderCheckById(ProjectLeaderCheckId.ToString());
|
||||
if (getData != null)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(getData.LeaderIds))
|
||||
{
|
||||
name = UserService.getUserNamesUserIds(getData.LeaderIds);
|
||||
}
|
||||
if (!string.IsNullOrEmpty(getData.LeaderNames))
|
||||
{
|
||||
name += "," + getData.LeaderNames;
|
||||
}
|
||||
}
|
||||
}
|
||||
return name;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -104,6 +104,16 @@ namespace BLL
|
||||
return db.Hazard_HazardSelectedItem.FirstOrDefault(x => x.HazardId == hazardId && x.HazardListId == hazardListId && x.WorkStage == workStage);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据危险源辨识与评价清单Id获取一个危险源辨识与评价清单审批信息
|
||||
/// </summary>
|
||||
/// <param name="hazardId">危险源辨识与评价清单Id</param>
|
||||
/// <returns>一个危险源辨识与评价清单审批实体</returns>
|
||||
public static Model.Hazard_HazardSelectedItem GetHazardSelectedItemByHazardSelectedItemId(string hazardSelectedItemId)
|
||||
{
|
||||
return db.Hazard_HazardSelectedItem.FirstOrDefault(x => x.HazardSelectedItemId == hazardSelectedItemId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据危险源辨识与评价清单Id获取一个危险源辨识与评价清单审批信息
|
||||
/// </summary>
|
||||
@@ -156,11 +166,13 @@ namespace BLL
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.Hazard_HazardSelectedItem newHazardSelectedItem = new Model.Hazard_HazardSelectedItem
|
||||
{
|
||||
HazardSelectedItemId = hazardSelectedItem.HazardSelectedItemId,
|
||||
HazardId = hazardSelectedItem.HazardId,
|
||||
HazardListTypeId = hazardSelectedItem.HazardListTypeId,
|
||||
HazardListId = hazardSelectedItem.HazardListId,
|
||||
HazardItems = hazardSelectedItem.HazardItems,
|
||||
DefectsType = hazardSelectedItem.DefectsType,
|
||||
ProjectId = hazardSelectedItem.ProjectId,
|
||||
MayLeadAccidents = hazardSelectedItem.MayLeadAccidents,
|
||||
HelperMethod = hazardSelectedItem.HelperMethod,
|
||||
HazardJudge_L = hazardSelectedItem.HazardJudge_L,
|
||||
@@ -171,8 +183,10 @@ namespace BLL
|
||||
ControlMeasures = hazardSelectedItem.ControlMeasures,
|
||||
IsResponse = hazardSelectedItem.IsResponse,
|
||||
ResponseRecode = hazardSelectedItem.ResponseRecode,
|
||||
DutyPerson = hazardSelectedItem.DutyPerson,
|
||||
PromptTime = hazardSelectedItem.PromptTime,
|
||||
Remark = hazardSelectedItem.Remark,
|
||||
State = hazardSelectedItem.State,
|
||||
WorkStage = hazardSelectedItem.WorkStage
|
||||
};
|
||||
|
||||
@@ -187,7 +201,7 @@ namespace BLL
|
||||
public static void UpdateHazardSelectedItem(Model.Hazard_HazardSelectedItem hazardSelectedItem)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.Hazard_HazardSelectedItem newHazardSelectedItem = db.Hazard_HazardSelectedItem.FirstOrDefault(e => e.HazardId == hazardSelectedItem.HazardId && e.HazardListId == hazardSelectedItem.HazardListId && e.WorkStage == hazardSelectedItem.WorkStage);
|
||||
Model.Hazard_HazardSelectedItem newHazardSelectedItem = db.Hazard_HazardSelectedItem.FirstOrDefault(e => e.HazardSelectedItemId == hazardSelectedItem.HazardSelectedItemId);
|
||||
if (newHazardSelectedItem != null)
|
||||
{
|
||||
newHazardSelectedItem.HazardListTypeId = hazardSelectedItem.HazardListTypeId;
|
||||
@@ -204,9 +218,15 @@ namespace BLL
|
||||
newHazardSelectedItem.ControlMeasures = hazardSelectedItem.ControlMeasures;
|
||||
newHazardSelectedItem.IsResponse = hazardSelectedItem.IsResponse;
|
||||
newHazardSelectedItem.ResponseRecode = hazardSelectedItem.ResponseRecode;
|
||||
newHazardSelectedItem.DutyPerson = hazardSelectedItem.DutyPerson;
|
||||
newHazardSelectedItem.PromptTime = hazardSelectedItem.PromptTime;
|
||||
newHazardSelectedItem.Remark = hazardSelectedItem.Remark;
|
||||
newHazardSelectedItem.WorkStage = hazardSelectedItem.WorkStage;
|
||||
newHazardSelectedItem.CheckStartDate = hazardSelectedItem.CheckStartDate;
|
||||
newHazardSelectedItem.IsStart = hazardSelectedItem.IsStart;
|
||||
newHazardSelectedItem.State = hazardSelectedItem.State;
|
||||
newHazardSelectedItem.PlanExistDate = hazardSelectedItem.PlanExistDate;
|
||||
newHazardSelectedItem.QRCodeAttachUrl = hazardSelectedItem.QRCodeAttachUrl;
|
||||
|
||||
db.SubmitChanges();
|
||||
}
|
||||
@@ -222,8 +242,30 @@ namespace BLL
|
||||
var q = (from x in db.Hazard_HazardSelectedItem where x.HazardListId == hazardListId select x).ToList();
|
||||
if (q.Count() > 0)
|
||||
{
|
||||
foreach (var item in q)
|
||||
{
|
||||
var h = db.Hazard_RiskEvaluationRecord.Where(x => x.DataId == item.HazardSelectedItemId);
|
||||
if (h.Count() > 0)
|
||||
{
|
||||
db.Hazard_RiskEvaluationRecord.DeleteAllOnSubmit(h);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
var p = db.Hazard_PatrolPlan.Where(x => x.HazardSelectedItemId == item.HazardSelectedItemId);
|
||||
if (p.Count() > 0)
|
||||
{
|
||||
db.Hazard_PatrolPlan.DeleteAllOnSubmit(p);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
var r = db.Hazard_RoutingInspection.Where(x => x.HazardSelectedItemId == item.HazardSelectedItemId);
|
||||
if (r.Count() > 0)
|
||||
{
|
||||
db.Hazard_RoutingInspection.DeleteAllOnSubmit(r);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
db.Hazard_HazardSelectedItem.DeleteAllOnSubmit(q);
|
||||
db.SubmitChanges();
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,96 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
/// <summary>
|
||||
/// 巡检计划表
|
||||
/// </summary>
|
||||
public static class Hazard_PatrolPlanService
|
||||
{
|
||||
/// <summary>
|
||||
/// 根据巡检计划ID获取巡检计划信息
|
||||
/// </summary>
|
||||
/// <param name="PatrolPlanName"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.Hazard_PatrolPlan GetPatrolPlanByPatrolPlanId(string PatrolPlanId)
|
||||
{
|
||||
return Funs.DB.Hazard_PatrolPlan.FirstOrDefault(e => e.PatrolPlanId == PatrolPlanId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据风险ID和巡检时限获取巡检计划信息
|
||||
/// </summary>
|
||||
/// <param name="PatrolPlanName"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.Hazard_PatrolPlan GetPatrolPlanByHazardSelectedItemIdAndLimitCheckDate(string hazardSelectedItemId, DateTime? limitCheckDate)
|
||||
{
|
||||
return Funs.DB.Hazard_PatrolPlan.FirstOrDefault(e => e.HazardSelectedItemId == hazardSelectedItemId && e.LimitCheckDate == limitCheckDate);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据巡检日期获取之前未巡检计划信息集合
|
||||
/// </summary>
|
||||
/// <param name="PatrolPlanName"></param>
|
||||
/// <returns></returns>
|
||||
public static List<Model.Hazard_PatrolPlan> GetBeforePatrolPlansByCheckDate(string hazardSelectedItemId, DateTime checkDate)
|
||||
{
|
||||
return (from x in Funs.DB.Hazard_PatrolPlan where x.HazardSelectedItemId == hazardSelectedItemId && x.LimitCheckDate < checkDate select x).ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加安全巡检计划
|
||||
/// </summary>
|
||||
/// <param name="patrolPlan"></param>
|
||||
public static void AddPatrolPlan(Model.Hazard_PatrolPlan patrolPlan)
|
||||
{
|
||||
Model.Hazard_PatrolPlan newPatrolPlan = new Model.Hazard_PatrolPlan
|
||||
{
|
||||
PatrolPlanId = patrolPlan.PatrolPlanId,
|
||||
HazardSelectedItemId = patrolPlan.HazardSelectedItemId,
|
||||
HazardLevel = patrolPlan.HazardLevel,
|
||||
DutyPerson = patrolPlan.DutyPerson,
|
||||
Days = patrolPlan.Days,
|
||||
CheckStartDate = patrolPlan.CheckStartDate,
|
||||
LimitCheckDate = patrolPlan.LimitCheckDate,
|
||||
CheckDate = patrolPlan.CheckDate,
|
||||
State = patrolPlan.State
|
||||
};
|
||||
|
||||
Funs.DB.Hazard_PatrolPlan.InsertOnSubmit(newPatrolPlan);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改安全巡检计划
|
||||
/// </summary>
|
||||
/// <param name="patrolPlan"></param>
|
||||
public static void UpdatePatrolPlan(Model.Hazard_PatrolPlan patrolPlan)
|
||||
{
|
||||
Model.Hazard_PatrolPlan newPatrolPlan = Funs.DB.Hazard_PatrolPlan.FirstOrDefault(e => e.PatrolPlanId == patrolPlan.PatrolPlanId);
|
||||
if (newPatrolPlan != null)
|
||||
{
|
||||
newPatrolPlan.CheckDate = patrolPlan.CheckDate;
|
||||
newPatrolPlan.State = patrolPlan.State;
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据巡检计划ID删除对应巡检计划记录信息
|
||||
/// </summary>
|
||||
/// <param name="superviseCheckReportId"></param>
|
||||
public static void DeletePatrolPlan(string PatrolPlanId)
|
||||
{
|
||||
var q = (from x in Funs.DB.Hazard_PatrolPlan where x.PatrolPlanId == PatrolPlanId select x).FirstOrDefault();
|
||||
if (q != null)
|
||||
{
|
||||
Funs.DB.Hazard_PatrolPlan.DeleteOnSubmit(q);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,95 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
/// <summary>
|
||||
/// 巡检记录表
|
||||
/// </summary>
|
||||
public static class Hazard_RoutingInspectionService
|
||||
{
|
||||
/// <summary>
|
||||
/// 根据巡检记录ID获取巡检记录信息
|
||||
/// </summary>
|
||||
/// <param name="RoutingInspectionName"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.Hazard_RoutingInspection GetRoutingInspectionByRoutingInspectionId(string RoutingInspectionId)
|
||||
{
|
||||
return Funs.DB.Hazard_RoutingInspection.FirstOrDefault(e => e.RoutingInspectionId == RoutingInspectionId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据巡检计划ID获取巡检记录信息
|
||||
/// </summary>
|
||||
/// <param name="RoutingInspectionName"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.Hazard_RoutingInspection GetRoutingInspectionByPatrolPlanId(string PatrolPlanId)
|
||||
{
|
||||
return Funs.DB.Hazard_RoutingInspection.FirstOrDefault(e => e.PatrolPlanId == PatrolPlanId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加安全巡检记录
|
||||
/// </summary>
|
||||
/// <param name="RoutingInspection"></param>
|
||||
public static void AddRoutingInspection(Model.Hazard_RoutingInspection RoutingInspection)
|
||||
{
|
||||
Model.Hazard_RoutingInspection newRoutingInspection = new Model.Hazard_RoutingInspection
|
||||
{
|
||||
RoutingInspectionId = RoutingInspection.RoutingInspectionId,
|
||||
HazardSelectedItemId = RoutingInspection.HazardSelectedItemId,
|
||||
PatrolManId = RoutingInspection.PatrolManId,
|
||||
PatrolTime = RoutingInspection.PatrolTime,
|
||||
PatrolResult = RoutingInspection.PatrolResult,
|
||||
OldRiskLevel = RoutingInspection.OldRiskLevel,
|
||||
PohotoUrl = RoutingInspection.PohotoUrl,
|
||||
ControlMeasures = RoutingInspection.ControlMeasures,
|
||||
DealReason = RoutingInspection.DealReason,
|
||||
RiskManId = RoutingInspection.RiskManId,
|
||||
PatrolPlanId = RoutingInspection.PatrolPlanId
|
||||
};
|
||||
|
||||
Funs.DB.Hazard_RoutingInspection.InsertOnSubmit(newRoutingInspection);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改安全巡检记录
|
||||
/// </summary>
|
||||
/// <param name="RoutingInspection"></param>
|
||||
public static void UpdateRoutingInspection(Model.Hazard_RoutingInspection RoutingInspection)
|
||||
{
|
||||
Model.Hazard_RoutingInspection newRoutingInspection = Funs.DB.Hazard_RoutingInspection.FirstOrDefault(e => e.RoutingInspectionId == RoutingInspection.RoutingInspectionId);
|
||||
if (newRoutingInspection != null)
|
||||
{
|
||||
newRoutingInspection.PatrolManId = RoutingInspection.PatrolManId;
|
||||
newRoutingInspection.PatrolTime = RoutingInspection.PatrolTime;
|
||||
newRoutingInspection.PatrolResult = RoutingInspection.PatrolResult;
|
||||
newRoutingInspection.OldRiskLevel = RoutingInspection.OldRiskLevel;
|
||||
newRoutingInspection.PohotoUrl = RoutingInspection.PohotoUrl;
|
||||
newRoutingInspection.ControlMeasures = RoutingInspection.ControlMeasures;
|
||||
newRoutingInspection.DealReason = RoutingInspection.DealReason;
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据巡检记录ID删除对应巡检记录记录信息
|
||||
/// </summary>
|
||||
/// <param name="superviseCheckReportId"></param>
|
||||
public static void DeleteRoutingInspection(string RoutingInspectionId)
|
||||
{
|
||||
var q = (from x in Funs.DB.Hazard_RoutingInspection where x.RoutingInspectionId == RoutingInspectionId select x).FirstOrDefault();
|
||||
if (q != null)
|
||||
{
|
||||
///删除附件
|
||||
BLL.CommonService.DeleteAttachFileById(RoutingInspectionId);
|
||||
Funs.DB.Hazard_RoutingInspection.DeleteOnSubmit(q);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,109 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
public static class RiskEvaluationRecordService
|
||||
{
|
||||
public static Model.SGGLDB db = Funs.DB;
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键获取风险评价记录
|
||||
/// </summary>
|
||||
/// <param name="hazardId"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.Hazard_RiskEvaluationRecord GetRiskEvaluationRecordByLECItemRecordId(string LECItemRecordId)
|
||||
{
|
||||
return Funs.DB.Hazard_RiskEvaluationRecord.FirstOrDefault(e => e.LECItemRecordId == LECItemRecordId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据风险主键获取风险评价记录
|
||||
/// </summary>
|
||||
/// <param name="hazardId"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.Hazard_RiskEvaluationRecord GetRiskEvaluationRecordByDataIdAndEvaluatorDate(string dataId)
|
||||
{
|
||||
return Funs.DB.Hazard_RiskEvaluationRecord.FirstOrDefault(e => e.DataId == dataId && e.EvaluatorDate == null);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据整理人获取风险评价记录
|
||||
/// </summary>
|
||||
/// <param name="compileMan"></param>
|
||||
/// <returns></returns>
|
||||
public static List<Model.Hazard_RiskEvaluationRecord> GetRiskEvaluationRecordByDataId(string dataId)
|
||||
{
|
||||
return (from x in Funs.DB.Hazard_RiskEvaluationRecord where x.DataId == dataId select x).ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加风险评价记录
|
||||
/// </summary>
|
||||
/// <param name="RiskEvaluationRecord"></param>
|
||||
public static void AddRiskEvaluationRecord(Model.Hazard_RiskEvaluationRecord RiskEvaluationRecord)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.Hazard_RiskEvaluationRecord newRiskEvaluationRecord = new Model.Hazard_RiskEvaluationRecord
|
||||
{
|
||||
LECItemRecordId = RiskEvaluationRecord.LECItemRecordId,
|
||||
DataId = RiskEvaluationRecord.DataId,
|
||||
DataType = RiskEvaluationRecord.DataType,
|
||||
Evaluatorld = RiskEvaluationRecord.Evaluatorld,
|
||||
EvaluatorDate = RiskEvaluationRecord.EvaluatorDate,
|
||||
L = RiskEvaluationRecord.L,
|
||||
E = RiskEvaluationRecord.E,
|
||||
C = RiskEvaluationRecord.C,
|
||||
D = RiskEvaluationRecord.D,
|
||||
RiskLevel = RiskEvaluationRecord.RiskLevel,
|
||||
ControlMeasures = RiskEvaluationRecord.ControlMeasures,
|
||||
Remark = RiskEvaluationRecord.Remark,
|
||||
};
|
||||
db.Hazard_RiskEvaluationRecord.InsertOnSubmit(newRiskEvaluationRecord);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改风险评价记录
|
||||
/// </summary>
|
||||
/// <param name="RiskEvaluationRecord"></param>
|
||||
public static void UpdateRiskEvaluationRecord(Model.Hazard_RiskEvaluationRecord RiskEvaluationRecord)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.Hazard_RiskEvaluationRecord newRiskEvaluationRecord = db.Hazard_RiskEvaluationRecord.FirstOrDefault(e => e.LECItemRecordId == RiskEvaluationRecord.LECItemRecordId);
|
||||
if (newRiskEvaluationRecord != null)
|
||||
{
|
||||
newRiskEvaluationRecord.DataId = RiskEvaluationRecord.DataId;
|
||||
newRiskEvaluationRecord.DataType = RiskEvaluationRecord.DataType;
|
||||
newRiskEvaluationRecord.Evaluatorld = RiskEvaluationRecord.Evaluatorld;
|
||||
newRiskEvaluationRecord.EvaluatorDate = RiskEvaluationRecord.EvaluatorDate;
|
||||
newRiskEvaluationRecord.L = RiskEvaluationRecord.L;
|
||||
newRiskEvaluationRecord.E = RiskEvaluationRecord.E;
|
||||
newRiskEvaluationRecord.C = RiskEvaluationRecord.C;
|
||||
newRiskEvaluationRecord.D = RiskEvaluationRecord.D;
|
||||
newRiskEvaluationRecord.RiskLevel = RiskEvaluationRecord.RiskLevel;
|
||||
newRiskEvaluationRecord.ControlMeasures = RiskEvaluationRecord.ControlMeasures;
|
||||
newRiskEvaluationRecord.Remark = RiskEvaluationRecord.Remark;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键删除风险评价记录
|
||||
/// </summary>
|
||||
/// <param name="LECItemRecordId"></param>
|
||||
public static void DeleteRiskEvaluationRecordByLECItemRecordId(string LECItemRecordId)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.Hazard_RiskEvaluationRecord RiskEvaluationRecord = db.Hazard_RiskEvaluationRecord.FirstOrDefault(e => e.LECItemRecordId == LECItemRecordId);
|
||||
if (RiskEvaluationRecord != null)
|
||||
{
|
||||
db.Hazard_RiskEvaluationRecord.DeleteOnSubmit(RiskEvaluationRecord);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -68,6 +68,7 @@ namespace BLL
|
||||
newHazardRegister.CutPayment = hazardRegister.CutPayment;
|
||||
newHazardRegister.ProblemTypes = hazardRegister.ProblemTypes;
|
||||
newHazardRegister.DIC_ID = hazardRegister.DIC_ID;
|
||||
newHazardRegister.Risk_Level = hazardRegister.Risk_Level;
|
||||
db.HSSE_Hazard_HazardRegister.InsertOnSubmit(newHazardRegister);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
@@ -52,7 +52,8 @@ namespace BLL
|
||||
RegistrationNum = equipmentInItem.RegistrationNum,
|
||||
OperationQualificationNum = equipmentInItem.OperationQualificationNum,
|
||||
InsuranceNum = equipmentInItem.InsuranceNum,
|
||||
CommercialInsuranceNum = equipmentInItem.CommercialInsuranceNum
|
||||
CommercialInsuranceNum = equipmentInItem.CommercialInsuranceNum,
|
||||
IsUsed = equipmentInItem.IsUsed,
|
||||
};
|
||||
db.InApproveManager_EquipmentInItem.InsertOnSubmit(newEquipmentItem);
|
||||
db.SubmitChanges();
|
||||
@@ -79,6 +80,7 @@ namespace BLL
|
||||
newEquipmentItem.OperationQualificationNum = equipmentInItem.OperationQualificationNum;
|
||||
newEquipmentItem.InsuranceNum = equipmentInItem.InsuranceNum;
|
||||
newEquipmentItem.CommercialInsuranceNum = equipmentInItem.CommercialInsuranceNum;
|
||||
newEquipmentItem.IsUsed = equipmentInItem.IsUsed;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,7 +44,8 @@ namespace BLL
|
||||
SpecialEquipmentId = generalEquipmentInItem.SpecialEquipmentId,
|
||||
SizeModel = generalEquipmentInItem.SizeModel,
|
||||
OwnerCheck = generalEquipmentInItem.OwnerCheck,
|
||||
CertificateNum = generalEquipmentInItem.CertificateNum
|
||||
CertificateNum = generalEquipmentInItem.CertificateNum,
|
||||
IsUsed = generalEquipmentInItem.IsUsed,
|
||||
};
|
||||
db.InApproveManager_GeneralEquipmentInItem.InsertOnSubmit(newEquipmentItem);
|
||||
db.SubmitChanges();
|
||||
@@ -65,6 +66,7 @@ namespace BLL
|
||||
newGeneralEquipmentInItem.SizeModel = generalEquipmentInItem.SizeModel;
|
||||
newGeneralEquipmentInItem.OwnerCheck = generalEquipmentInItem.OwnerCheck;
|
||||
newGeneralEquipmentInItem.CertificateNum = generalEquipmentInItem.CertificateNum;
|
||||
newGeneralEquipmentInItem.IsUsed = generalEquipmentInItem.IsUsed;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,152 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
/// <summary>
|
||||
/// 安全领导小组会议
|
||||
/// </summary>
|
||||
public static class SafetyLeaderGroupMeetingService
|
||||
{
|
||||
public static Model.SGGLDB db = Funs.DB;
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键获取安全领导小组会议
|
||||
/// </summary>
|
||||
/// <param name="SafetyLeaderGroupMeetingId"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.Meeting_SafetyLeaderGroupMeeting GetSafetyLeaderGroupMeetingById(string SafetyLeaderGroupMeetingId)
|
||||
{
|
||||
return Funs.DB.Meeting_SafetyLeaderGroupMeeting.FirstOrDefault(e => e.SafetyLeaderGroupMeetingId == SafetyLeaderGroupMeetingId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据时间段获取安全领导小组会议集合
|
||||
/// </summary>
|
||||
/// <param name="startTime"></param>
|
||||
/// <param name="endTime"></param>
|
||||
/// <param name="projectId"></param>
|
||||
/// <returns></returns>
|
||||
public static int GetCountByTime(DateTime startTime, DateTime endTime, string projectId)
|
||||
{
|
||||
return (from x in Funs.DB.Meeting_SafetyLeaderGroupMeeting where x.SafetyLeaderGroupMeetingDate >= startTime && x.SafetyLeaderGroupMeetingDate < endTime && x.ProjectId == projectId && x.States == BLL.Const.State_2 select x).Count();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据时间段获取安全领导小组会议参会人数
|
||||
/// </summary>
|
||||
/// <param name="startTime"></param>
|
||||
/// <param name="endTime"></param>
|
||||
/// <param name="projectId"></param>
|
||||
/// <returns></returns>
|
||||
public static int? GetSumAttentPersonNumByMeetingDate(DateTime startTime, DateTime endTime, string projectId)
|
||||
{
|
||||
int? sumAttentPersonNum = (from x in Funs.DB.Meeting_SafetyLeaderGroupMeeting where x.SafetyLeaderGroupMeetingDate >= startTime && x.SafetyLeaderGroupMeetingDate < endTime && x.ProjectId == projectId && x.States == BLL.Const.State_2 select x.AttentPersonNum).Sum();
|
||||
if (sumAttentPersonNum == null)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
return sumAttentPersonNum;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据日期和类型获取会议记录集合
|
||||
/// </summary>
|
||||
/// <param name="startTime">开始时间</param>
|
||||
/// <param name="endTime">结束时间</param>
|
||||
/// <param name="projectId">项目号</param>
|
||||
/// <returns>会议记录集合</returns>
|
||||
public static List<Model.Meeting_SafetyLeaderGroupMeeting> GetMeetingListsByDate(DateTime startTime, DateTime endTime, string projectId)
|
||||
{
|
||||
return (from x in Funs.DB.Meeting_SafetyLeaderGroupMeeting where x.SafetyLeaderGroupMeetingDate >= startTime && x.SafetyLeaderGroupMeetingDate <= endTime && x.ProjectId == projectId orderby x.SafetyLeaderGroupMeetingDate select x).ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加安全领导小组会议
|
||||
/// </summary>
|
||||
/// <param name="SafetyLeaderGroupMeeting"></param>
|
||||
public static void AddSafetyLeaderGroupMeeting(Model.Meeting_SafetyLeaderGroupMeeting SafetyLeaderGroupMeeting)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.Meeting_SafetyLeaderGroupMeeting newSafetyLeaderGroupMeeting = new Model.Meeting_SafetyLeaderGroupMeeting
|
||||
{
|
||||
SafetyLeaderGroupMeetingId = SafetyLeaderGroupMeeting.SafetyLeaderGroupMeetingId,
|
||||
ProjectId = SafetyLeaderGroupMeeting.ProjectId,
|
||||
UnitId = SafetyLeaderGroupMeeting.UnitId,
|
||||
SafetyLeaderGroupMeetingCode = SafetyLeaderGroupMeeting.SafetyLeaderGroupMeetingCode,
|
||||
SafetyLeaderGroupMeetingName = SafetyLeaderGroupMeeting.SafetyLeaderGroupMeetingName,
|
||||
SafetyLeaderGroupMeetingDate = SafetyLeaderGroupMeeting.SafetyLeaderGroupMeetingDate,
|
||||
CompileMan = SafetyLeaderGroupMeeting.CompileMan,
|
||||
SafetyLeaderGroupMeetingContents = SafetyLeaderGroupMeeting.SafetyLeaderGroupMeetingContents,
|
||||
CompileDate = SafetyLeaderGroupMeeting.CompileDate,
|
||||
States = SafetyLeaderGroupMeeting.States,
|
||||
AttentPersonNum = SafetyLeaderGroupMeeting.AttentPersonNum,
|
||||
MeetingHours = SafetyLeaderGroupMeeting.MeetingHours,
|
||||
MeetingHostMan = SafetyLeaderGroupMeeting.MeetingHostMan,
|
||||
AttentPerson = SafetyLeaderGroupMeeting.AttentPerson,
|
||||
MeetingPlace = SafetyLeaderGroupMeeting.MeetingPlace,
|
||||
MeetingHostManId = SafetyLeaderGroupMeeting.MeetingHostManId,
|
||||
AttentPersonIds = SafetyLeaderGroupMeeting.AttentPersonIds,
|
||||
MeetingHostManOther = SafetyLeaderGroupMeeting.MeetingHostManOther
|
||||
};
|
||||
db.Meeting_SafetyLeaderGroupMeeting.InsertOnSubmit(newSafetyLeaderGroupMeeting);
|
||||
db.SubmitChanges();
|
||||
////增加一条编码记录
|
||||
BLL.CodeRecordsService.InsertCodeRecordsByMenuIdProjectIdUnitId(BLL.Const.ProjectSafetyLeaderGroupMeetingMenuId, SafetyLeaderGroupMeeting.ProjectId, null, SafetyLeaderGroupMeeting.SafetyLeaderGroupMeetingId, SafetyLeaderGroupMeeting.CompileDate);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改安全领导小组会议
|
||||
/// </summary>
|
||||
/// <param name="SafetyLeaderGroupMeeting"></param>
|
||||
public static void UpdateSafetyLeaderGroupMeeting(Model.Meeting_SafetyLeaderGroupMeeting SafetyLeaderGroupMeeting)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.Meeting_SafetyLeaderGroupMeeting newSafetyLeaderGroupMeeting = db.Meeting_SafetyLeaderGroupMeeting.FirstOrDefault(e => e.SafetyLeaderGroupMeetingId == SafetyLeaderGroupMeeting.SafetyLeaderGroupMeetingId);
|
||||
if (newSafetyLeaderGroupMeeting != null)
|
||||
{
|
||||
//newSafetyLeaderGroupMeeting.ProjectId = SafetyLeaderGroupMeeting.ProjectId;
|
||||
newSafetyLeaderGroupMeeting.UnitId = SafetyLeaderGroupMeeting.UnitId;
|
||||
newSafetyLeaderGroupMeeting.SafetyLeaderGroupMeetingCode = SafetyLeaderGroupMeeting.SafetyLeaderGroupMeetingCode;
|
||||
newSafetyLeaderGroupMeeting.SafetyLeaderGroupMeetingName = SafetyLeaderGroupMeeting.SafetyLeaderGroupMeetingName;
|
||||
newSafetyLeaderGroupMeeting.SafetyLeaderGroupMeetingDate = SafetyLeaderGroupMeeting.SafetyLeaderGroupMeetingDate;
|
||||
newSafetyLeaderGroupMeeting.CompileMan = SafetyLeaderGroupMeeting.CompileMan;
|
||||
newSafetyLeaderGroupMeeting.SafetyLeaderGroupMeetingContents = SafetyLeaderGroupMeeting.SafetyLeaderGroupMeetingContents;
|
||||
newSafetyLeaderGroupMeeting.CompileDate = SafetyLeaderGroupMeeting.CompileDate;
|
||||
newSafetyLeaderGroupMeeting.States = SafetyLeaderGroupMeeting.States;
|
||||
newSafetyLeaderGroupMeeting.AttentPersonNum = SafetyLeaderGroupMeeting.AttentPersonNum;
|
||||
newSafetyLeaderGroupMeeting.MeetingHours = SafetyLeaderGroupMeeting.MeetingHours;
|
||||
newSafetyLeaderGroupMeeting.MeetingHostMan = SafetyLeaderGroupMeeting.MeetingHostMan;
|
||||
newSafetyLeaderGroupMeeting.AttentPerson = SafetyLeaderGroupMeeting.AttentPerson;
|
||||
newSafetyLeaderGroupMeeting.MeetingPlace = SafetyLeaderGroupMeeting.MeetingPlace;
|
||||
newSafetyLeaderGroupMeeting.MeetingHostManId = SafetyLeaderGroupMeeting.MeetingHostManId;
|
||||
newSafetyLeaderGroupMeeting.AttentPersonIds = SafetyLeaderGroupMeeting.AttentPersonIds;
|
||||
newSafetyLeaderGroupMeeting.MeetingHostManOther = SafetyLeaderGroupMeeting.MeetingHostManOther;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键删除安全领导小组会议
|
||||
/// </summary>
|
||||
/// <param name="SafetyLeaderGroupMeetingId"></param>
|
||||
public static void DeleteSafetyLeaderGroupMeetingById(string SafetyLeaderGroupMeetingId)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.Meeting_SafetyLeaderGroupMeeting SafetyLeaderGroupMeeting = db.Meeting_SafetyLeaderGroupMeeting.FirstOrDefault(e => e.SafetyLeaderGroupMeetingId == SafetyLeaderGroupMeetingId);
|
||||
if (SafetyLeaderGroupMeeting != null)
|
||||
{
|
||||
///删除编码表记录
|
||||
BLL.CodeRecordsService.DeleteCodeRecordsByDataId(SafetyLeaderGroupMeetingId);
|
||||
BLL.CommonService.DeleteAttachFileById(SafetyLeaderGroupMeetingId);
|
||||
////删除流程表
|
||||
BLL.CommonService.DeleteFlowOperateByID(SafetyLeaderGroupMeeting.SafetyLeaderGroupMeetingId);
|
||||
db.Meeting_SafetyLeaderGroupMeeting.DeleteOnSubmit(SafetyLeaderGroupMeeting);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -13,6 +13,93 @@ namespace BLL
|
||||
{
|
||||
public static Model.SGGLDB db = Funs.DB;
|
||||
|
||||
#region 劳务人员列表
|
||||
/// <summary>
|
||||
/// 记录数
|
||||
/// </summary>
|
||||
public static int count2
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 定义变量
|
||||
/// </summary>
|
||||
private static IQueryable<Model.View_SitePerson_Person> getDataLists = from x in db.View_SitePerson_Person
|
||||
select x;
|
||||
|
||||
/// <summary>
|
||||
/// 数据列表
|
||||
/// </summary>
|
||||
/// <param name="projetcId"></param>
|
||||
/// <param name="unitId"></param>
|
||||
/// <param name="workPostId"></param>
|
||||
/// <param name="name"></param>
|
||||
/// <param name="idCard"></param>
|
||||
/// <param name="states"></param>
|
||||
/// <param name="Grid1"></param>
|
||||
/// <returns></returns>
|
||||
public static IEnumerable getListData(string projetcId, string unitId, string workPostId, string name, string idCard, string states, Grid Grid1)
|
||||
{
|
||||
IQueryable<Model.View_SitePerson_Person> getDataList = getDataLists.OrderBy(x => x.ProjectId).ThenBy(x => x.UnitId);
|
||||
if (!string.IsNullOrEmpty(projetcId) && projetcId != Const._Null)
|
||||
{
|
||||
getDataList = getDataList.Where(e => e.ProjectId == projetcId);
|
||||
}
|
||||
if (!string.IsNullOrEmpty(unitId) && unitId != Const._Null)
|
||||
{
|
||||
getDataList = getDataList.Where(e => e.UnitId == unitId);
|
||||
}
|
||||
if (!string.IsNullOrEmpty(workPostId) && workPostId != Const._Null)
|
||||
{
|
||||
getDataList = getDataList.Where(e => e.WorkPostId == workPostId);
|
||||
}
|
||||
if (!string.IsNullOrEmpty(states) && states != "-2")
|
||||
{
|
||||
getDataList = getDataList.Where(e => e.IsUsed == Convert.ToBoolean(states));
|
||||
}
|
||||
if (!string.IsNullOrEmpty(name))
|
||||
{
|
||||
getDataList = getDataList.Where(e => e.PersonName.Contains(name));
|
||||
}
|
||||
if (!string.IsNullOrEmpty(idCard))
|
||||
{
|
||||
getDataList = getDataList.Where(e => e.IdentityCard.Contains(idCard));
|
||||
}
|
||||
count2 = getDataList.Count();
|
||||
if (count2 == 0)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
getDataList = SortConditionHelper.SortingAndPaging(getDataList, Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize);
|
||||
return from x in getDataList
|
||||
select new
|
||||
{
|
||||
x.PersonId,
|
||||
x.PersonName,
|
||||
x.CardNo,
|
||||
x.IdentityCard,
|
||||
x.Sex,
|
||||
x.SexName,
|
||||
x.UnitId,
|
||||
x.UnitName,
|
||||
x.WorkPostId,
|
||||
x.WorkPostName,
|
||||
x.ProjectId,
|
||||
ProjectName = db.Base_Project.First(u => u.ProjectId == x.ProjectId).ProjectName,
|
||||
ShortName = db.Base_Project.First(u => u.ProjectId == x.ProjectId).ShortName,
|
||||
NativePlace = x.CountryName ?? "" + x.ProvinceName ?? "",
|
||||
x.TeamGroupId,
|
||||
x.TeamGroupName,
|
||||
x.InTime,
|
||||
x.OutTime,
|
||||
x.IsUsed,
|
||||
OutName = (x.IsUsed == false ? "是" : "否"),
|
||||
};
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 获取列表
|
||||
/// <summary>
|
||||
/// 记录数
|
||||
@@ -437,6 +524,7 @@ namespace BLL
|
||||
CountryCode = person.CountryCode,
|
||||
ProvinceCode = person.ProvinceCode,
|
||||
IsCardNoOK=IDCardValid.CheckIDCard(person.IdentityCard),
|
||||
IsSafetyMonitoring = person.IsSafetyMonitoring,
|
||||
};
|
||||
newPerson.RawPassword = Funs.getInitialPassword(person.UnitId, person.IdentityCard);
|
||||
newPerson.Password = Funs.EncryptionPassword(newPerson.RawPassword);
|
||||
@@ -502,6 +590,7 @@ namespace BLL
|
||||
newPerson.MaritalStatus = person.MaritalStatus;
|
||||
newPerson.DepartId = person.DepartId;
|
||||
newPerson.QRCodeAttachUrl = person.QRCodeAttachUrl;
|
||||
newPerson.IsSafetyMonitoring = person.IsSafetyMonitoring;
|
||||
newPerson.Password = GetPersonPassWord(person.IdentityCard);
|
||||
if (!newPerson.OutTime.HasValue)
|
||||
{
|
||||
|
||||
@@ -41,6 +41,8 @@ namespace BLL
|
||||
RecardMan = largerHazard.RecardMan,
|
||||
Remark = largerHazard.Remark,
|
||||
States = largerHazard.States,
|
||||
TrainPersonNum = largerHazard.TrainPersonNum,
|
||||
IsSuperLargerHazard = largerHazard.IsSuperLargerHazard,
|
||||
Descriptions = largerHazard.Descriptions
|
||||
};
|
||||
|
||||
@@ -68,6 +70,8 @@ namespace BLL
|
||||
newLargerHazard.IsArgument = largerHazard.IsArgument;
|
||||
newLargerHazard.Remark = largerHazard.Remark;
|
||||
newLargerHazard.States = largerHazard.States;
|
||||
newLargerHazard.TrainPersonNum = largerHazard.TrainPersonNum;
|
||||
newLargerHazard.IsSuperLargerHazard = largerHazard.IsSuperLargerHazard;
|
||||
newLargerHazard.Descriptions = largerHazard.Descriptions;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
@@ -551,5 +551,28 @@
|
||||
}
|
||||
return code;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取施工中项目集合
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static List<Model.Base_Project> GetProjectWorkList(string unitId)
|
||||
{
|
||||
var getDatas = from x in Funs.DB.Base_Project
|
||||
where (x.ProjectState == null || x.ProjectState == BLL.Const.ProjectState_1)
|
||||
select x;
|
||||
|
||||
if (unitId == BLL.Const.UnitId_CWCEC)
|
||||
{
|
||||
getDatas = getDatas.Where(x => x.UnitId == unitId || x.UnitId == null);
|
||||
}
|
||||
else
|
||||
{
|
||||
getDatas = getDatas.Where(x => x.UnitId == unitId);
|
||||
}
|
||||
var list = getDatas.OrderBy(x => x.ProjectName).ToList();
|
||||
|
||||
return list;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -77,7 +77,7 @@ namespace BLL
|
||||
IdcardNumber = unit.IdcardNumber,
|
||||
LinkMobile = unit.LinkMobile,
|
||||
CollCropStatus = unit.CollCropStatus,
|
||||
RealNamePushTime=null,
|
||||
RealNamePushTime = null,
|
||||
};
|
||||
db.Base_Unit.InsertOnSubmit(newUnit);
|
||||
db.SubmitChanges();
|
||||
@@ -266,7 +266,7 @@ namespace BLL
|
||||
var q = (from x in db.Base_Unit
|
||||
join y in db.Project_ProjectUnit
|
||||
on x.UnitId equals y.UnitId
|
||||
where y.ProjectId == projectId && y.UnitType == unitType
|
||||
where y.ProjectId == projectId && (y.UnitType == unitType || string.IsNullOrEmpty(unitType))
|
||||
orderby x.UnitCode
|
||||
select x).ToList();
|
||||
return q;
|
||||
@@ -662,9 +662,9 @@ namespace BLL
|
||||
{
|
||||
return Funs.DB.Base_Unit.FirstOrDefault(e => e.UnitName == unitName);
|
||||
}
|
||||
public static Model.Base_Unit getUnitByCollCropCodeUnitName(string CollCropCode,string unitName)
|
||||
{
|
||||
var getUnit= Funs.DB.Base_Unit.FirstOrDefault(e => e.CollCropCode == CollCropCode);
|
||||
public static Model.Base_Unit getUnitByCollCropCodeUnitName(string CollCropCode, string unitName)
|
||||
{
|
||||
var getUnit = Funs.DB.Base_Unit.FirstOrDefault(e => e.CollCropCode == CollCropCode);
|
||||
if (getUnit != null)
|
||||
{
|
||||
return getUnit;
|
||||
@@ -708,5 +708,30 @@ namespace BLL
|
||||
|
||||
return name;
|
||||
}
|
||||
|
||||
public static void InitNoThisAllUnitDownList(FineUIPro.DropDownList dropName, bool isShowPlease)
|
||||
{
|
||||
dropName.DataValueField = "UnitId";
|
||||
dropName.DataTextField = "UnitName";
|
||||
dropName.DataSource = GetNoThisAllUnitList();
|
||||
dropName.DataBind();
|
||||
if (isShowPlease)
|
||||
{
|
||||
Funs.FineUIPleaseSelect(dropName);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取除本单位外的所有单位名称下拉选择项
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static List<Model.Base_Unit> GetNoThisAllUnitList()
|
||||
{
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
var q = (from x in db.Base_Unit where x.UnitId != BLL.Const.UnitId_CWCEC orderby x.UnitCode select x).ToList();
|
||||
return q;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,6 +19,16 @@ namespace BLL
|
||||
return Funs.DB.Sys_User.FirstOrDefault(e => e.UserId == userId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取用户信息
|
||||
/// </summary>
|
||||
/// <param name="userId">用户Id</param>
|
||||
/// <returns>用户信息</returns>
|
||||
public static Model.Sys_User GetUserByIdentityCard(string identityCard)
|
||||
{
|
||||
return Funs.DB.Sys_User.FirstOrDefault(e => e.IdentityCard == identityCard);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///根据用户名获取用户信息
|
||||
/// </summary>
|
||||
|
||||
@@ -0,0 +1,155 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
/// <summary>
|
||||
/// 应急演练
|
||||
/// </summary>
|
||||
public static class UnitDrillRecordListService
|
||||
{
|
||||
public static Model.SGGLDB db = Funs.DB;
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键获取应急演练
|
||||
/// </summary>
|
||||
/// <param name="DrillRecordListId"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.Emergency_DrillRecordList_Unit GetDrillRecordListById(string DrillRecordListId)
|
||||
{
|
||||
return Funs.DB.Emergency_DrillRecordList_Unit.FirstOrDefault(e => e.DrillRecordListId == DrillRecordListId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据时间获取应急演练信息
|
||||
/// </summary>
|
||||
/// <param name="startTime">开始时间</param>
|
||||
/// <param name="endTime">结束时间</param>
|
||||
/// <returns>应急演练信息</returns>
|
||||
public static List<Model.Emergency_DrillRecordList_Unit> GetDrillRecordListsByDrillRecordDate(DateTime startTime, DateTime endTime, string projectId)
|
||||
{
|
||||
return (from x in Funs.DB.Emergency_DrillRecordList_Unit where x.DrillRecordDate >= startTime && x.DrillRecordDate < endTime && x.ProjectId == projectId && x.States == BLL.Const.State_2 select x).ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据时间段获取HSE应急演练
|
||||
/// </summary>
|
||||
/// <param name="startTime">开始时间</param>
|
||||
/// <param name="endTime">结束时间</param>
|
||||
/// <param name="projectId">项目Id</param>
|
||||
/// <returns>时间段内的HSE应急演练数量</returns>
|
||||
public static int GetCountByDate(DateTime startTime, DateTime endTime, string projectId)
|
||||
{
|
||||
return (from x in Funs.DB.Emergency_DrillRecordList_Unit where x.DrillRecordDate >= startTime && x.DrillRecordDate <= endTime && x.ProjectId == projectId select x).Count();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据时间段获取HSE应急演练
|
||||
/// </summary>
|
||||
/// <param name="startTime">开始时间</param>
|
||||
/// <param name="endTime">结束时间</param>
|
||||
/// <param name="projectId">项目Id</param>
|
||||
/// <returns>时间段内的HSE应急演练数量</returns>
|
||||
public static int GetCountByDate2(DateTime startTime, DateTime endTime, string projectId)
|
||||
{
|
||||
return (from x in Funs.DB.Emergency_DrillRecordList_Unit where x.DrillRecordDate >= startTime && x.DrillRecordDate < endTime && x.ProjectId == projectId select x).Count();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取HSE应急演练
|
||||
/// </summary>
|
||||
/// <param name="startTime">开始时间</param>
|
||||
/// <param name="endTime">结束时间</param>
|
||||
/// <param name="projectId">项目Id</param>
|
||||
/// <returns>时间段内的HSE应急演练数量</returns>
|
||||
public static int GetCount(string projectId)
|
||||
{
|
||||
return (from x in Funs.DB.Emergency_DrillRecordList_Unit where x.ProjectId == projectId select x).Count();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加应急演练
|
||||
/// </summary>
|
||||
/// <param name="DrillRecordList"></param>
|
||||
public static void AddDrillRecordList(Model.Emergency_DrillRecordList_Unit DrillRecordList)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.Emergency_DrillRecordList_Unit newDrillRecordList = new Model.Emergency_DrillRecordList_Unit
|
||||
{
|
||||
DrillRecordListId = DrillRecordList.DrillRecordListId,
|
||||
ProjectId = DrillRecordList.ProjectId,
|
||||
DrillRecordCode = DrillRecordList.DrillRecordCode,
|
||||
DrillRecordName = DrillRecordList.DrillRecordName,
|
||||
UnitIds = DrillRecordList.UnitIds,
|
||||
UnitNames = DrillRecordList.UnitNames,
|
||||
UserIds = DrillRecordList.UserIds,
|
||||
UserNames = DrillRecordList.UserNames,
|
||||
DrillRecordDate = DrillRecordList.DrillRecordDate,
|
||||
DrillRecordContents = DrillRecordList.DrillRecordContents,
|
||||
CompileMan = DrillRecordList.CompileMan,
|
||||
CompileDate = System.DateTime.Now,
|
||||
States = DrillRecordList.States,
|
||||
AttachUrl = DrillRecordList.AttachUrl,
|
||||
DrillRecordType = DrillRecordList.DrillRecordType,
|
||||
JointPersonNum = DrillRecordList.JointPersonNum,
|
||||
DrillCost = DrillRecordList.DrillCost
|
||||
};
|
||||
db.Emergency_DrillRecordList_Unit.InsertOnSubmit(newDrillRecordList);
|
||||
db.SubmitChanges();
|
||||
////增加一条编码记录
|
||||
BLL.CodeRecordsService.InsertCodeRecordsByMenuIdProjectIdUnitId(BLL.Const.ProjectDrillRecordListMenuId, DrillRecordList.ProjectId, null, DrillRecordList.DrillRecordListId, DrillRecordList.DrillRecordDate);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改应急演练
|
||||
/// </summary>
|
||||
/// <param name="DrillRecordList"></param>
|
||||
public static void UpdateDrillRecordList(Model.Emergency_DrillRecordList_Unit DrillRecordList)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.Emergency_DrillRecordList_Unit newDrillRecordList = db.Emergency_DrillRecordList_Unit.FirstOrDefault(e => e.DrillRecordListId == DrillRecordList.DrillRecordListId);
|
||||
if (newDrillRecordList != null)
|
||||
{
|
||||
newDrillRecordList.DrillRecordCode = DrillRecordList.DrillRecordCode;
|
||||
newDrillRecordList.DrillRecordName = DrillRecordList.DrillRecordName;
|
||||
newDrillRecordList.UnitIds = DrillRecordList.UnitIds;
|
||||
newDrillRecordList.UnitNames = DrillRecordList.UnitNames;
|
||||
newDrillRecordList.UserIds = DrillRecordList.UserIds;
|
||||
newDrillRecordList.UserNames = DrillRecordList.UserNames;
|
||||
newDrillRecordList.DrillRecordDate = DrillRecordList.DrillRecordDate;
|
||||
newDrillRecordList.DrillRecordContents = DrillRecordList.DrillRecordContents;
|
||||
newDrillRecordList.CompileMan = DrillRecordList.CompileMan;
|
||||
//newDrillRecordList.CompileDate = DrillRecordList.CompileDate;
|
||||
newDrillRecordList.States = DrillRecordList.States;
|
||||
newDrillRecordList.AttachUrl = DrillRecordList.AttachUrl;
|
||||
newDrillRecordList.DrillRecordType = DrillRecordList.DrillRecordType;
|
||||
newDrillRecordList.JointPersonNum = DrillRecordList.JointPersonNum;
|
||||
newDrillRecordList.DrillCost = DrillRecordList.DrillCost;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键删除应急演练
|
||||
/// </summary>
|
||||
/// <param name="DrillRecordListId"></param>
|
||||
public static void DeleteDrillRecordListById(string DrillRecordListId)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.Emergency_DrillRecordList_Unit DrillRecordList = db.Emergency_DrillRecordList_Unit.FirstOrDefault(e => e.DrillRecordListId == DrillRecordListId);
|
||||
if (DrillRecordList != null)
|
||||
{
|
||||
///删除编码表记录
|
||||
BLL.CodeRecordsService.DeleteCodeRecordsByDataId(DrillRecordList.DrillRecordListId);
|
||||
////删除附件表
|
||||
BLL.CommonService.DeleteAttachFileById(DrillRecordList.DrillRecordListId);
|
||||
////删除流程表
|
||||
BLL.CommonService.DeleteFlowOperateByID(DrillRecordList.DrillRecordListId);
|
||||
db.Emergency_DrillRecordList_Unit.DeleteOnSubmit(DrillRecordList);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,150 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
/// <summary>
|
||||
/// 应急预案管理
|
||||
/// </summary>
|
||||
public static class UnitEmergencyListService
|
||||
{
|
||||
public static Model.SGGLDB db = Funs.DB;
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键获取应急预案管理
|
||||
/// </summary>
|
||||
/// <param name="EmergencyListId"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.Emergency_EmergencyList_Unit GetEmergencyListById(string EmergencyListId)
|
||||
{
|
||||
return Funs.DB.Emergency_EmergencyList_Unit.FirstOrDefault(e => e.EmergencyListId == EmergencyListId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取时间段文件、方案修编情况说明
|
||||
/// </summary>
|
||||
/// <param name="projectId"></param>
|
||||
/// <param name="startTime"></param>
|
||||
/// <param name="endTime"></param>
|
||||
/// <returns></returns>
|
||||
public static List<Model.Emergency_EmergencyList_Unit> GetEmergencyListByDate(string projectId, DateTime startTime, DateTime endTime)
|
||||
{
|
||||
return (from x in Funs.DB.Emergency_EmergencyList_Unit where x.ProjectId == projectId && x.CompileDate >= startTime && x.CompileDate <= endTime select x).ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据应急预案类型获取应急预案信息集合
|
||||
/// </summary>
|
||||
/// <param name="emergencyType">应急预案类型</param>
|
||||
/// <param name="projectId">项目号</param>
|
||||
/// <returns>应急预案实体集合</returns>
|
||||
public static List<Model.Emergency_EmergencyList_Unit> GetEmergencyListsByEmergencyType(string emergencyType, string projectId, DateTime startTime, DateTime endTime)
|
||||
{
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
return (from x in db.Emergency_EmergencyList_Unit
|
||||
join y in db.Base_EmergencyType
|
||||
on x.EmergencyTypeId equals y.EmergencyTypeId
|
||||
where y.EmergencyTypeName.Contains(emergencyType) && x.ProjectId == projectId && x.CompileDate >= startTime && x.CompileDate < endTime
|
||||
select x).ToList();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据应急预案类型获取其他应急预案信息集合
|
||||
/// </summary>
|
||||
/// <param name="emergencyType">应急预案类型</param>
|
||||
/// <param name="projectId">项目号</param>
|
||||
/// <returns>其他应急预案实体集合</returns>
|
||||
public static List<Model.Emergency_EmergencyList_Unit> GetOtherEmergencyListsByEmergencyType(string emergencyType, string projectId, DateTime startTime, DateTime endTime)
|
||||
{
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
return (from x in db.Emergency_EmergencyList_Unit
|
||||
join y in db.Base_EmergencyType
|
||||
on x.EmergencyTypeId equals y.EmergencyTypeId
|
||||
where !y.EmergencyTypeName.Contains(emergencyType) && x.ProjectId == projectId && x.CompileDate >= startTime && x.CompileDate < endTime
|
||||
select x).ToList();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加应急预案管理
|
||||
/// </summary>
|
||||
/// <param name="EmergencyList"></param>
|
||||
public static void AddEmergencyList(Model.Emergency_EmergencyList_Unit EmergencyList)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.Emergency_EmergencyList_Unit newEmergencyList = new Model.Emergency_EmergencyList_Unit
|
||||
{
|
||||
EmergencyListId = EmergencyList.EmergencyListId,
|
||||
ProjectId = EmergencyList.ProjectId,
|
||||
EmergencyCode = EmergencyList.EmergencyCode,
|
||||
EmergencyName = EmergencyList.EmergencyName,
|
||||
UnitId = EmergencyList.UnitId,
|
||||
EmergencyTypeId = EmergencyList.EmergencyTypeId,
|
||||
VersionCode = EmergencyList.VersionCode,
|
||||
EmergencyContents = EmergencyList.EmergencyContents,
|
||||
CompileMan = EmergencyList.CompileMan,
|
||||
CompileDate = EmergencyList.CompileDate,
|
||||
States = EmergencyList.States,
|
||||
AttachUrl = EmergencyList.AttachUrl,
|
||||
AuditMan = EmergencyList.AuditMan,
|
||||
ApproveMan = EmergencyList.ApproveMan
|
||||
};
|
||||
db.Emergency_EmergencyList_Unit.InsertOnSubmit(newEmergencyList);
|
||||
db.SubmitChanges();
|
||||
////增加一条编码记录
|
||||
BLL.CodeRecordsService.InsertCodeRecordsByMenuIdProjectIdUnitId(BLL.Const.ProjectEmergencyListMenuId, EmergencyList.ProjectId, null, EmergencyList.EmergencyListId, EmergencyList.CompileDate);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改应急预案管理
|
||||
/// </summary>
|
||||
/// <param name="EmergencyList"></param>
|
||||
public static void UpdateEmergencyList(Model.Emergency_EmergencyList_Unit EmergencyList)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.Emergency_EmergencyList_Unit newEmergencyList = db.Emergency_EmergencyList_Unit.FirstOrDefault(e => e.EmergencyListId == EmergencyList.EmergencyListId);
|
||||
if (newEmergencyList != null)
|
||||
{
|
||||
newEmergencyList.EmergencyCode = EmergencyList.EmergencyCode;
|
||||
newEmergencyList.EmergencyName = EmergencyList.EmergencyName;
|
||||
newEmergencyList.UnitId = EmergencyList.UnitId;
|
||||
newEmergencyList.EmergencyTypeId = EmergencyList.EmergencyTypeId;
|
||||
newEmergencyList.VersionCode = EmergencyList.VersionCode;
|
||||
newEmergencyList.EmergencyContents = EmergencyList.EmergencyContents;
|
||||
newEmergencyList.CompileMan = EmergencyList.CompileMan;
|
||||
newEmergencyList.CompileDate = EmergencyList.CompileDate;
|
||||
newEmergencyList.States = EmergencyList.States;
|
||||
newEmergencyList.AttachUrl = EmergencyList.AttachUrl;
|
||||
newEmergencyList.AuditMan = EmergencyList.AuditMan;
|
||||
newEmergencyList.ApproveMan = EmergencyList.ApproveMan;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键删除应急预案管理
|
||||
/// </summary>
|
||||
/// <param name="EmergencyListId"></param>
|
||||
public static void DeleteEmergencyListById(string EmergencyListId)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.Emergency_EmergencyList_Unit EmergencyList = db.Emergency_EmergencyList_Unit.FirstOrDefault(e => e.EmergencyListId == EmergencyListId);
|
||||
if (EmergencyList != null)
|
||||
{
|
||||
///删除编码表记录
|
||||
BLL.CodeRecordsService.DeleteCodeRecordsByDataId(EmergencyList.EmergencyListId);
|
||||
////删除附件表
|
||||
BLL.CommonService.DeleteAttachFileById(EmergencyList.EmergencyListId);
|
||||
////删除流程表
|
||||
BLL.CommonService.DeleteFlowOperateByID(EmergencyList.EmergencyListId);
|
||||
db.Emergency_EmergencyList_Unit.DeleteOnSubmit(EmergencyList);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,142 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
/// <summary>
|
||||
/// 企业安委会
|
||||
/// </summary>
|
||||
public static class CompanySafetyMeetingService
|
||||
{
|
||||
public static Model.SGGLDB db = Funs.DB;
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键获取企业安委会
|
||||
/// </summary>
|
||||
/// <param name="CompanySafetyMeetingId"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.Meeting_CompanySafetyMeeting GetCompanySafetyMeetingById(string CompanySafetyMeetingId)
|
||||
{
|
||||
return Funs.DB.Meeting_CompanySafetyMeeting.FirstOrDefault(e => e.CompanySafetyMeetingId == CompanySafetyMeetingId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据时间段获取月例会集合
|
||||
/// </summary>
|
||||
/// <param name="startTime"></param>
|
||||
/// <param name="endTime"></param>
|
||||
/// <param name="projectId"></param>
|
||||
/// <returns></returns>
|
||||
public static int GetCountByTime(DateTime startTime, DateTime endTime)
|
||||
{
|
||||
return (from x in Funs.DB.Meeting_CompanySafetyMeeting where x.CompanySafetyMeetingDate >= startTime && x.CompanySafetyMeetingDate < endTime select x).Count();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据时间段获取月例会参会人数
|
||||
/// </summary>
|
||||
/// <param name="startTime"></param>
|
||||
/// <param name="endTime"></param>
|
||||
/// <param name="projectId"></param>
|
||||
/// <returns></returns>
|
||||
public static int? GetSumAttentPersonNumByMeetingDate(DateTime startTime, DateTime endTime)
|
||||
{
|
||||
int? sumAttentPersonNum = (from x in Funs.DB.Meeting_CompanySafetyMeeting where x.CompanySafetyMeetingDate >= startTime && x.CompanySafetyMeetingDate < endTime select x.AttentPersonNum).Sum();
|
||||
if (sumAttentPersonNum == null)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
return sumAttentPersonNum;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据日期和类型获取会议记录集合
|
||||
/// </summary>
|
||||
/// <param name="startTime">开始时间</param>
|
||||
/// <param name="endTime">结束时间</param>
|
||||
/// <param name="projectId">项目号</param>
|
||||
/// <returns>会议记录集合</returns>
|
||||
public static List<Model.Meeting_CompanySafetyMeeting> GetMeetingListsByDate(DateTime startTime, DateTime endTime)
|
||||
{
|
||||
return (from x in Funs.DB.Meeting_CompanySafetyMeeting where x.CompanySafetyMeetingDate >= startTime && x.CompanySafetyMeetingDate <= endTime orderby x.CompanySafetyMeetingDate select x).ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加企业安委会
|
||||
/// </summary>
|
||||
/// <param name="CompanySafetyMeeting"></param>
|
||||
public static void AddCompanySafetyMeeting(Model.Meeting_CompanySafetyMeeting CompanySafetyMeeting)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.Meeting_CompanySafetyMeeting newCompanySafetyMeeting = new Model.Meeting_CompanySafetyMeeting
|
||||
{
|
||||
CompanySafetyMeetingId = CompanySafetyMeeting.CompanySafetyMeetingId,
|
||||
CompanySafetyMeetingCode = CompanySafetyMeeting.CompanySafetyMeetingCode,
|
||||
CompanySafetyMeetingName = CompanySafetyMeeting.CompanySafetyMeetingName,
|
||||
CompanySafetyMeetingDate = CompanySafetyMeeting.CompanySafetyMeetingDate,
|
||||
CompileMan = CompanySafetyMeeting.CompileMan,
|
||||
CompanySafetyMeetingContents = CompanySafetyMeeting.CompanySafetyMeetingContents,
|
||||
CompileDate = CompanySafetyMeeting.CompileDate,
|
||||
AttentPersonNum = CompanySafetyMeeting.AttentPersonNum,
|
||||
MeetingHours = CompanySafetyMeeting.MeetingHours,
|
||||
MeetingHostMan = CompanySafetyMeeting.MeetingHostMan,
|
||||
AttentPerson = CompanySafetyMeeting.AttentPerson,
|
||||
MeetingPlace = CompanySafetyMeeting.MeetingPlace,
|
||||
MeetingHostManId = CompanySafetyMeeting.MeetingHostManId,
|
||||
AttentPersonIds = CompanySafetyMeeting.AttentPersonIds,
|
||||
MeetingHostManOther = CompanySafetyMeeting.MeetingHostManOther
|
||||
};
|
||||
db.Meeting_CompanySafetyMeeting.InsertOnSubmit(newCompanySafetyMeeting);
|
||||
db.SubmitChanges();
|
||||
////增加一条编码记录
|
||||
BLL.CodeRecordsService.InsertCodeRecordsByMenuIdProjectIdUnitId(BLL.Const.CompanySafetyMeetingMenuId, null, null, CompanySafetyMeeting.CompanySafetyMeetingId, CompanySafetyMeeting.CompileDate);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改企业安委会
|
||||
/// </summary>
|
||||
/// <param name="CompanySafetyMeeting"></param>
|
||||
public static void UpdateCompanySafetyMeeting(Model.Meeting_CompanySafetyMeeting CompanySafetyMeeting)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.Meeting_CompanySafetyMeeting newCompanySafetyMeeting = db.Meeting_CompanySafetyMeeting.FirstOrDefault(e => e.CompanySafetyMeetingId == CompanySafetyMeeting.CompanySafetyMeetingId);
|
||||
if (newCompanySafetyMeeting != null)
|
||||
{
|
||||
newCompanySafetyMeeting.CompanySafetyMeetingCode = CompanySafetyMeeting.CompanySafetyMeetingCode;
|
||||
newCompanySafetyMeeting.CompanySafetyMeetingName = CompanySafetyMeeting.CompanySafetyMeetingName;
|
||||
newCompanySafetyMeeting.CompanySafetyMeetingDate = CompanySafetyMeeting.CompanySafetyMeetingDate;
|
||||
newCompanySafetyMeeting.CompileMan = CompanySafetyMeeting.CompileMan;
|
||||
newCompanySafetyMeeting.CompanySafetyMeetingContents = CompanySafetyMeeting.CompanySafetyMeetingContents;
|
||||
newCompanySafetyMeeting.CompileDate = CompanySafetyMeeting.CompileDate;
|
||||
newCompanySafetyMeeting.AttentPersonNum = CompanySafetyMeeting.AttentPersonNum;
|
||||
newCompanySafetyMeeting.MeetingHours = CompanySafetyMeeting.MeetingHours;
|
||||
newCompanySafetyMeeting.MeetingHostMan = CompanySafetyMeeting.MeetingHostMan;
|
||||
newCompanySafetyMeeting.AttentPerson = CompanySafetyMeeting.AttentPerson;
|
||||
newCompanySafetyMeeting.MeetingPlace = CompanySafetyMeeting.MeetingPlace;
|
||||
newCompanySafetyMeeting.MeetingHostManId = CompanySafetyMeeting.MeetingHostManId;
|
||||
newCompanySafetyMeeting.AttentPersonIds = CompanySafetyMeeting.AttentPersonIds;
|
||||
newCompanySafetyMeeting.MeetingHostManOther = CompanySafetyMeeting.MeetingHostManOther;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键删除企业安委会
|
||||
/// </summary>
|
||||
/// <param name="CompanySafetyMeetingId"></param>
|
||||
public static void DeleteCompanySafetyMeetingById(string CompanySafetyMeetingId)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.Meeting_CompanySafetyMeeting CompanySafetyMeeting = db.Meeting_CompanySafetyMeeting.FirstOrDefault(e => e.CompanySafetyMeetingId == CompanySafetyMeetingId);
|
||||
if (CompanySafetyMeeting != null)
|
||||
{
|
||||
///删除编码表记录
|
||||
BLL.CodeRecordsService.DeleteCodeRecordsByDataId(CompanySafetyMeetingId);
|
||||
BLL.CommonService.DeleteAttachFileById(CompanySafetyMeetingId);
|
||||
db.Meeting_CompanySafetyMeeting.DeleteOnSubmit(CompanySafetyMeeting);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,142 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
/// <summary>
|
||||
/// 企业专题会
|
||||
/// </summary>
|
||||
public static class CompanySpecialMeetingService
|
||||
{
|
||||
public static Model.SGGLDB db = Funs.DB;
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键获取企业专题会
|
||||
/// </summary>
|
||||
/// <param name="CompanySpecialMeetingId"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.Meeting_CompanySpecialMeeting GetCompanySpecialMeetingById(string CompanySpecialMeetingId)
|
||||
{
|
||||
return Funs.DB.Meeting_CompanySpecialMeeting.FirstOrDefault(e => e.CompanySpecialMeetingId == CompanySpecialMeetingId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据时间段获取月例会集合
|
||||
/// </summary>
|
||||
/// <param name="startTime"></param>
|
||||
/// <param name="endTime"></param>
|
||||
/// <param name="projectId"></param>
|
||||
/// <returns></returns>
|
||||
public static int GetCountByTime(DateTime startTime, DateTime endTime)
|
||||
{
|
||||
return (from x in Funs.DB.Meeting_CompanySpecialMeeting where x.CompanySpecialMeetingDate >= startTime && x.CompanySpecialMeetingDate < endTime select x).Count();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据时间段获取月例会参会人数
|
||||
/// </summary>
|
||||
/// <param name="startTime"></param>
|
||||
/// <param name="endTime"></param>
|
||||
/// <param name="projectId"></param>
|
||||
/// <returns></returns>
|
||||
public static int? GetSumAttentPersonNumByMeetingDate(DateTime startTime, DateTime endTime)
|
||||
{
|
||||
int? sumAttentPersonNum = (from x in Funs.DB.Meeting_CompanySpecialMeeting where x.CompanySpecialMeetingDate >= startTime && x.CompanySpecialMeetingDate < endTime select x.AttentPersonNum).Sum();
|
||||
if (sumAttentPersonNum == null)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
return sumAttentPersonNum;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据日期和类型获取会议记录集合
|
||||
/// </summary>
|
||||
/// <param name="startTime">开始时间</param>
|
||||
/// <param name="endTime">结束时间</param>
|
||||
/// <param name="projectId">项目号</param>
|
||||
/// <returns>会议记录集合</returns>
|
||||
public static List<Model.Meeting_CompanySpecialMeeting> GetMeetingListsByDate(DateTime startTime, DateTime endTime)
|
||||
{
|
||||
return (from x in Funs.DB.Meeting_CompanySpecialMeeting where x.CompanySpecialMeetingDate >= startTime && x.CompanySpecialMeetingDate <= endTime orderby x.CompanySpecialMeetingDate select x).ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加企业专题会
|
||||
/// </summary>
|
||||
/// <param name="CompanySpecialMeeting"></param>
|
||||
public static void AddCompanySpecialMeeting(Model.Meeting_CompanySpecialMeeting CompanySpecialMeeting)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.Meeting_CompanySpecialMeeting newCompanySpecialMeeting = new Model.Meeting_CompanySpecialMeeting
|
||||
{
|
||||
CompanySpecialMeetingId = CompanySpecialMeeting.CompanySpecialMeetingId,
|
||||
CompanySpecialMeetingCode = CompanySpecialMeeting.CompanySpecialMeetingCode,
|
||||
CompanySpecialMeetingName = CompanySpecialMeeting.CompanySpecialMeetingName,
|
||||
CompanySpecialMeetingDate = CompanySpecialMeeting.CompanySpecialMeetingDate,
|
||||
CompileMan = CompanySpecialMeeting.CompileMan,
|
||||
CompanySpecialMeetingContents = CompanySpecialMeeting.CompanySpecialMeetingContents,
|
||||
CompileDate = CompanySpecialMeeting.CompileDate,
|
||||
AttentPersonNum = CompanySpecialMeeting.AttentPersonNum,
|
||||
MeetingHours = CompanySpecialMeeting.MeetingHours,
|
||||
MeetingHostMan = CompanySpecialMeeting.MeetingHostMan,
|
||||
AttentPerson = CompanySpecialMeeting.AttentPerson,
|
||||
MeetingPlace = CompanySpecialMeeting.MeetingPlace,
|
||||
MeetingHostManId = CompanySpecialMeeting.MeetingHostManId,
|
||||
AttentPersonIds = CompanySpecialMeeting.AttentPersonIds,
|
||||
MeetingHostManOther = CompanySpecialMeeting.MeetingHostManOther
|
||||
};
|
||||
db.Meeting_CompanySpecialMeeting.InsertOnSubmit(newCompanySpecialMeeting);
|
||||
db.SubmitChanges();
|
||||
////增加一条编码记录
|
||||
BLL.CodeRecordsService.InsertCodeRecordsByMenuIdProjectIdUnitId(BLL.Const.CompanySpecialMeetingMenuId, null, null, CompanySpecialMeeting.CompanySpecialMeetingId, CompanySpecialMeeting.CompileDate);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改企业专题会
|
||||
/// </summary>
|
||||
/// <param name="CompanySpecialMeeting"></param>
|
||||
public static void UpdateCompanySpecialMeeting(Model.Meeting_CompanySpecialMeeting CompanySpecialMeeting)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.Meeting_CompanySpecialMeeting newCompanySpecialMeeting = db.Meeting_CompanySpecialMeeting.FirstOrDefault(e => e.CompanySpecialMeetingId == CompanySpecialMeeting.CompanySpecialMeetingId);
|
||||
if (newCompanySpecialMeeting != null)
|
||||
{
|
||||
newCompanySpecialMeeting.CompanySpecialMeetingCode = CompanySpecialMeeting.CompanySpecialMeetingCode;
|
||||
newCompanySpecialMeeting.CompanySpecialMeetingName = CompanySpecialMeeting.CompanySpecialMeetingName;
|
||||
newCompanySpecialMeeting.CompanySpecialMeetingDate = CompanySpecialMeeting.CompanySpecialMeetingDate;
|
||||
newCompanySpecialMeeting.CompileMan = CompanySpecialMeeting.CompileMan;
|
||||
newCompanySpecialMeeting.CompanySpecialMeetingContents = CompanySpecialMeeting.CompanySpecialMeetingContents;
|
||||
newCompanySpecialMeeting.CompileDate = CompanySpecialMeeting.CompileDate;
|
||||
newCompanySpecialMeeting.AttentPersonNum = CompanySpecialMeeting.AttentPersonNum;
|
||||
newCompanySpecialMeeting.MeetingHours = CompanySpecialMeeting.MeetingHours;
|
||||
newCompanySpecialMeeting.MeetingHostMan = CompanySpecialMeeting.MeetingHostMan;
|
||||
newCompanySpecialMeeting.AttentPerson = CompanySpecialMeeting.AttentPerson;
|
||||
newCompanySpecialMeeting.MeetingPlace = CompanySpecialMeeting.MeetingPlace;
|
||||
newCompanySpecialMeeting.MeetingHostManId = CompanySpecialMeeting.MeetingHostManId;
|
||||
newCompanySpecialMeeting.AttentPersonIds = CompanySpecialMeeting.AttentPersonIds;
|
||||
newCompanySpecialMeeting.MeetingHostManOther = CompanySpecialMeeting.MeetingHostManOther;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键删除企业专题会
|
||||
/// </summary>
|
||||
/// <param name="CompanySpecialMeetingId"></param>
|
||||
public static void DeleteCompanySpecialMeetingById(string CompanySpecialMeetingId)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.Meeting_CompanySpecialMeeting CompanySpecialMeeting = db.Meeting_CompanySpecialMeeting.FirstOrDefault(e => e.CompanySpecialMeetingId == CompanySpecialMeetingId);
|
||||
if (CompanySpecialMeeting != null)
|
||||
{
|
||||
///删除编码表记录
|
||||
BLL.CodeRecordsService.DeleteCodeRecordsByDataId(CompanySpecialMeetingId);
|
||||
BLL.CommonService.DeleteAttachFileById(CompanySpecialMeetingId);
|
||||
db.Meeting_CompanySpecialMeeting.DeleteOnSubmit(CompanySpecialMeeting);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,117 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
/// <summary>
|
||||
/// 公司分支机构人员
|
||||
/// </summary>
|
||||
public static class CompanyBranchPersonService
|
||||
{
|
||||
public static Model.SGGLDB db = Funs.DB;
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键获取公司分支机构人员
|
||||
/// </summary>
|
||||
/// <param name="CompanyBranchPersonId"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.Person_CompanyBranchPerson GetCompanyBranchPersonById(string CompanyBranchPersonId)
|
||||
{
|
||||
return Funs.DB.Person_CompanyBranchPerson.FirstOrDefault(e => e.CompanyBranchPersonId == CompanyBranchPersonId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据身份证号Id获取人员的数量
|
||||
/// </summary>
|
||||
/// <param name="identityCard">身份证号</param>
|
||||
/// <returns>人员的数量</returns>
|
||||
public static Model.Person_CompanyBranchPerson GetPersonCountByIdentityCard(string identityCard)
|
||||
{
|
||||
var q = Funs.DB.Person_CompanyBranchPerson.FirstOrDefault(x => x.IdentityCard == identityCard);
|
||||
return q;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加公司分支机构人员
|
||||
/// </summary>
|
||||
/// <param name="CompanyBranchPerson"></param>
|
||||
public static void AddCompanyBranchPerson(Model.Person_CompanyBranchPerson CompanyBranchPerson)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.Person_CompanyBranchPerson newCompanyBranchPerson = new Model.Person_CompanyBranchPerson
|
||||
{
|
||||
CompanyBranchPersonId = CompanyBranchPerson.CompanyBranchPersonId,
|
||||
UnitId = CompanyBranchPerson.UnitId,
|
||||
PersonName = CompanyBranchPerson.PersonName,
|
||||
Sex = CompanyBranchPerson.Sex,
|
||||
IdentityCard = CompanyBranchPerson.IdentityCard,
|
||||
WorkPostId = CompanyBranchPerson.WorkPostId,
|
||||
Telephone = CompanyBranchPerson.Telephone,
|
||||
Address = CompanyBranchPerson.Address,
|
||||
IsOnJob = CompanyBranchPerson.IsOnJob,
|
||||
Remark = CompanyBranchPerson.Remark,
|
||||
};
|
||||
db.Person_CompanyBranchPerson.InsertOnSubmit(newCompanyBranchPerson);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改公司分支机构人员
|
||||
/// </summary>
|
||||
/// <param name="CompanyBranchPerson"></param>
|
||||
public static void UpdateCompanyBranchPerson(Model.Person_CompanyBranchPerson CompanyBranchPerson)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.Person_CompanyBranchPerson newCompanyBranchPerson = db.Person_CompanyBranchPerson.FirstOrDefault(e => e.CompanyBranchPersonId == CompanyBranchPerson.CompanyBranchPersonId);
|
||||
if (newCompanyBranchPerson != null)
|
||||
{
|
||||
newCompanyBranchPerson.UnitId = CompanyBranchPerson.UnitId;
|
||||
newCompanyBranchPerson.PersonName = CompanyBranchPerson.PersonName;
|
||||
newCompanyBranchPerson.Sex = CompanyBranchPerson.Sex;
|
||||
newCompanyBranchPerson.IdentityCard = CompanyBranchPerson.IdentityCard;
|
||||
newCompanyBranchPerson.WorkPostId = CompanyBranchPerson.WorkPostId;
|
||||
newCompanyBranchPerson.Telephone = CompanyBranchPerson.Telephone;
|
||||
newCompanyBranchPerson.Address = CompanyBranchPerson.Address;
|
||||
newCompanyBranchPerson.IsOnJob = CompanyBranchPerson.IsOnJob;
|
||||
newCompanyBranchPerson.Remark = CompanyBranchPerson.Remark;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键删除公司分支机构人员
|
||||
/// </summary>
|
||||
/// <param name="CompanyBranchPersonId"></param>
|
||||
public static void DeleteCompanyBranchPersonById(string CompanyBranchPersonId)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.Person_CompanyBranchPerson CompanyBranchPerson = db.Person_CompanyBranchPerson.FirstOrDefault(e => e.CompanyBranchPersonId == CompanyBranchPersonId);
|
||||
if (CompanyBranchPerson != null)
|
||||
{
|
||||
BLL.CommonService.DeleteAttachFileById(CompanyBranchPersonId);
|
||||
db.Person_CompanyBranchPerson.DeleteOnSubmit(CompanyBranchPerson);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取公司分支机构人员是否存在
|
||||
/// </summary>
|
||||
/// <param name="userId">用户id</param>
|
||||
/// <param name="identityCard">身份证号码</param>
|
||||
/// <returns>是否存在</returns>
|
||||
public static bool IsExistPersonIdentityCard(string companyBranchPersonId, string identityCard)
|
||||
{
|
||||
bool isExist = false;
|
||||
var role = Funs.DB.Person_CompanyBranchPerson.FirstOrDefault(x => x.IdentityCard == identityCard && (x.CompanyBranchPersonId != companyBranchPersonId || (companyBranchPersonId == null && x.CompanyBranchPersonId != null)));
|
||||
if (role != null)
|
||||
{
|
||||
isExist = true;
|
||||
}
|
||||
return isExist;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -35,6 +35,7 @@ namespace BLL
|
||||
ProjectId = superviseCheckReport.ProjectId,
|
||||
UnitId = superviseCheckReport.UnitId,
|
||||
CheckTeam = superviseCheckReport.CheckTeam,
|
||||
CheckType = superviseCheckReport.CheckType,
|
||||
EvaluationResult = superviseCheckReport.EvaluationResult,
|
||||
AttachUrl = superviseCheckReport.AttachUrl,
|
||||
IsIssued = superviseCheckReport.IsIssued
|
||||
@@ -57,6 +58,7 @@ namespace BLL
|
||||
newSuperviseCheckReport.ProjectId = superviseCheckReport.ProjectId;
|
||||
newSuperviseCheckReport.UnitId = superviseCheckReport.UnitId;
|
||||
newSuperviseCheckReport.CheckTeam = superviseCheckReport.CheckTeam;
|
||||
newSuperviseCheckReport.CheckType = superviseCheckReport.CheckType;
|
||||
newSuperviseCheckReport.EvaluationResult = superviseCheckReport.EvaluationResult;
|
||||
newSuperviseCheckReport.AttachUrl = superviseCheckReport.AttachUrl;
|
||||
newSuperviseCheckReport.IsIssued = superviseCheckReport.IsIssued;
|
||||
|
||||
Reference in New Issue
Block a user