数据穿透新增页面

This commit is contained in:
2023-06-09 10:20:38 +08:00
parent 857a427be6
commit 72f0109f93
132 changed files with 15962 additions and 205 deletions
@@ -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;
}
}
}
@@ -36,6 +36,7 @@ namespace BLL
UnitId = superviseCheckReport.UnitId,
CheckTeam = superviseCheckReport.CheckTeam,
EvaluationResult = superviseCheckReport.EvaluationResult,
CheckType = superviseCheckReport.CheckType,
AttachUrl = superviseCheckReport.AttachUrl,
IsIssued = superviseCheckReport.IsIssued
};
@@ -58,6 +59,7 @@ namespace BLL
newSuperviseCheckReport.UnitId = superviseCheckReport.UnitId;
newSuperviseCheckReport.CheckTeam = superviseCheckReport.CheckTeam;
newSuperviseCheckReport.EvaluationResult = superviseCheckReport.EvaluationResult;
newSuperviseCheckReport.CheckType = superviseCheckReport.CheckType;
newSuperviseCheckReport.AttachUrl = superviseCheckReport.AttachUrl;
newSuperviseCheckReport.IsIssued = superviseCheckReport.IsIssued;
Funs.DB.SubmitChanges();