修改项目安全实施计划
This commit is contained in:
@@ -80,11 +80,11 @@
|
||||
var getUser = db.Person_Persons.FirstOrDefault(x => x.PersonId == personId);
|
||||
if (getUser != null && !string.IsNullOrEmpty(getUser.OpenId))
|
||||
{
|
||||
if (thing2.Length > 20)
|
||||
if (!string.IsNullOrEmpty(thing2) && thing2.Length > 20)
|
||||
{
|
||||
thing2 = thing2.Substring(0, 20);
|
||||
}
|
||||
if (name1.Length > 10)
|
||||
if (!string.IsNullOrEmpty(name1) && name1.Length > 10)
|
||||
{
|
||||
name1 = name1.Substring(0, 10);
|
||||
}
|
||||
|
||||
@@ -50,18 +50,18 @@ namespace BLL
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 根据personId获取人员信息
|
||||
#region 根据personId获取人员信息 -项目人员 及人员信息
|
||||
/// <summary>
|
||||
/// 根据personId获取人员信息
|
||||
/// </summary>
|
||||
/// <param name="sitePersonId"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.PersonItem getPersonBySitePersonId(string sitePersonId)
|
||||
public static Model.PersonItem getPersonBySitePersonId(string sitePersonId, string projectId, string idcard)
|
||||
{
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
Model.PersonItem person = new Model.PersonItem();
|
||||
var getProjectPerson = db.SitePerson_Person.FirstOrDefault(x => x.SitePersonId == sitePersonId);
|
||||
var getProjectPerson = db.SitePerson_Person.FirstOrDefault(x => x.SitePersonId == sitePersonId || (x.ProjectId == projectId && x.IdentityCard == idcard));
|
||||
if (getProjectPerson != null)
|
||||
{
|
||||
person.SitePersonId = getProjectPerson.SitePersonId;
|
||||
@@ -70,6 +70,7 @@ namespace BLL
|
||||
person.CardNo = getProjectPerson.CardNo;
|
||||
person.PersonName = getProjectPerson.PersonName;
|
||||
person.IdentityCard = getProjectPerson.IdentityCard;
|
||||
idcard = getProjectPerson.IdentityCard;
|
||||
person.ProjectId = getProjectPerson.ProjectId;
|
||||
var getProject = db.Base_Project.FirstOrDefault(x => x.ProjectId == getProjectPerson.ProjectId);
|
||||
if (getProject != null)
|
||||
@@ -124,73 +125,87 @@ namespace BLL
|
||||
{
|
||||
person.AuditorId = getA.PersonId;
|
||||
person.AuditorName = getA.PersonName;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
person.AuditorDate = string.Format("{0:yyyy-MM-dd}", getProjectPerson.AuditorDate);
|
||||
person.AttachUrl2 = APIUpLoadFileService.getFileUrl(getProjectPerson.PersonId + "#2", null);
|
||||
person.AttachUrl3 = APIUpLoadFileService.getFileUrl(getProjectPerson.PersonId + "#3", null);
|
||||
person.AttachUrl4 = getAttachUrl4(getProjectPerson.PersonId);
|
||||
//person.AttachUrl5 = APIUpLoadFileService.getFileUrl(personId + "#5", null);
|
||||
|
||||
var getPerson = db.Person_Persons.FirstOrDefault(x => x.PersonId == getProjectPerson.PersonId);
|
||||
if (getPerson != null)
|
||||
person.AttachUrl5 = APIUpLoadFileService.getFileUrl(getProjectPerson.PersonId + "#5", null);
|
||||
}
|
||||
var getPerson = db.Person_Persons.FirstOrDefault(x => x.IdentityCard == idcard);
|
||||
if (getPerson != null)
|
||||
{
|
||||
person.PersonId = getPerson.PersonId;
|
||||
person.PersonName = getPerson.PersonName;
|
||||
person.IdentityCard = getPerson.IdentityCard;
|
||||
person.Sex = getPerson.Sex;
|
||||
person.SexName = getPerson.Sex == "1" ? "男" : "女";
|
||||
person.Address = getPerson.Address;
|
||||
person.Telephone = getPerson.Telephone;
|
||||
person.PhotoUrl = getPerson.PhotoUrl;
|
||||
person.IsForeign = getPerson.IsForeign.HasValue ? getPerson.IsForeign : false;
|
||||
person.PersonType = getPerson.PersonType;
|
||||
person.PersonTypeName = DropListService.getPersonTypeNameByValue(getPerson.PersonType);
|
||||
person.AttachUrl1 = getPerson.IDCardUrl == null ? APIUpLoadFileService.getFileUrl(getProjectPerson.PersonId + "#1", null) : getPerson.IDCardUrl.Replace('\\', '/');
|
||||
person.AttachUrl5 = getPerson.IDCardBackUrl == null ? APIUpLoadFileService.getFileUrl(getProjectPerson.PersonId + "#5", null) : getPerson.IDCardBackUrl.Replace('\\', '/');
|
||||
person.IdcardType = getPerson.IdcardType;
|
||||
person.IdcardTypeName = "身份证";
|
||||
person.IdcardStartDate = string.Format("{0:yyyy-MM-dd}", getPerson.IdcardStartDate);
|
||||
person.IdcardEndDate = string.Format("{0:yyyy-MM-dd}", getPerson.IdcardEndDate);
|
||||
person.IdcardForever = getPerson.IdcardForever;
|
||||
person.IdcardForeverStr = getPerson.IdcardForever == "Y" ? "是" : "否";
|
||||
person.PoliticsStatus = getPerson.PoliticsStatus;
|
||||
person.UnitId = getPerson.UnitId;
|
||||
var gettUnit = db.Base_Unit.FirstOrDefault(x => x.UnitId == getPerson.UnitId);
|
||||
if (gettUnit != null)
|
||||
{
|
||||
person.Sex = getPerson.Sex;
|
||||
person.SexName = getPerson.Sex == "1" ? "男" : "女";
|
||||
person.Address = getPerson.Address;
|
||||
person.Telephone = getPerson.Telephone;
|
||||
person.PhotoUrl = getPerson.PhotoUrl;
|
||||
person.IsForeign = getPerson.IsForeign.HasValue ? getPerson.IsForeign : false;
|
||||
person.PersonType = getPerson.PersonType;
|
||||
person.PersonTypeName = DropListService.getPersonTypeNameByValue(getPerson.PersonType);
|
||||
person.AttachUrl1 = getPerson.IDCardUrl == null ? APIUpLoadFileService.getFileUrl(getProjectPerson.PersonId + "#1", null) : getPerson.IDCardUrl.Replace('\\', '/');
|
||||
person.AttachUrl5 = getPerson.IDCardBackUrl == null ? APIUpLoadFileService.getFileUrl(getProjectPerson.PersonId + "#5", null) : getPerson.IDCardBackUrl.Replace('\\', '/');
|
||||
person.IdcardType = getPerson.IdcardType;
|
||||
person.IdcardTypeName = "身份证";
|
||||
person.IdcardStartDate = string.Format("{0:yyyy-MM-dd}", getPerson.IdcardStartDate);
|
||||
person.IdcardEndDate = string.Format("{0:yyyy-MM-dd}", getPerson.IdcardEndDate);
|
||||
person.IdcardForever = getPerson.IdcardForever;
|
||||
person.IdcardForeverStr = getPerson.IdcardForever == "Y" ? "是" : "否";
|
||||
person.PoliticsStatus = getPerson.PoliticsStatus;
|
||||
var getRealName_BasicData = db.RealName_BasicData.FirstOrDefault(x => x.DictCode == getPerson.PoliticsStatus);
|
||||
if (getRealName_BasicData != null)
|
||||
{
|
||||
person.PoliticsStatusName = getRealName_BasicData.DictName;
|
||||
}
|
||||
person.IdcardAddress = getPerson.IdcardAddress;
|
||||
person.Nation = getPerson.Nation;
|
||||
var getRealName_BasicData1 = db.RealName_BasicData.FirstOrDefault(x => x.DictCode == getPerson.Nation);
|
||||
if (getRealName_BasicData1 != null)
|
||||
{
|
||||
person.NationName = getRealName_BasicData1.DictName;
|
||||
}
|
||||
person.EduLevel = getPerson.EduLevel;
|
||||
var getRealName_BasicData2 = db.RealName_BasicData.FirstOrDefault(x => x.DictCode == getPerson.EduLevel);
|
||||
if (getRealName_BasicData2 != null)
|
||||
{
|
||||
person.EduLevelName = getRealName_BasicData1.DictName;
|
||||
}
|
||||
person.MaritalStatus = getPerson.MaritalStatus;
|
||||
var getRealName_BasicData3 = db.RealName_BasicData.FirstOrDefault(x => x.DictCode == getPerson.MaritalStatus);
|
||||
if (getRealName_BasicData3 != null)
|
||||
{
|
||||
person.MaritalStatusName = getRealName_BasicData1.DictName;
|
||||
}
|
||||
person.CountryCode = getPerson.CountryCode;
|
||||
var getRealName_Country = db.RealName_Country.FirstOrDefault(x => x.CountryId == getPerson.CountryCode);
|
||||
if (getRealName_Country != null)
|
||||
{
|
||||
person.CountryName = getRealName_Country.Cname;
|
||||
}
|
||||
person.ProvinceCode = getPerson.ProvinceCode;
|
||||
var getRealName_City = db.RealName_City.FirstOrDefault(x => x.CountryId == getPerson.CountryCode && x.ProvinceCode == getPerson.ProvinceCode);
|
||||
if (getRealName_City != null)
|
||||
{
|
||||
person.ProvinceName = getRealName_City.Cname;
|
||||
}
|
||||
|
||||
person.UnitCode = gettUnit.UnitCode;
|
||||
person.UnitName = gettUnit.UnitName;
|
||||
}
|
||||
person.WorkPostId = getPerson.WorkPostId;
|
||||
var getWorkPost = db.Base_WorkPost.FirstOrDefault(x => x.WorkPostId == getPerson.WorkPostId);
|
||||
if (getWorkPost != null)
|
||||
{
|
||||
person.WorkPostName = getWorkPost.WorkPostName;
|
||||
}
|
||||
var getRealName_BasicData = db.RealName_BasicData.FirstOrDefault(x => x.DictCode == getPerson.PoliticsStatus);
|
||||
if (getRealName_BasicData != null)
|
||||
{
|
||||
person.PoliticsStatusName = getRealName_BasicData.DictName;
|
||||
}
|
||||
person.IdcardAddress = getPerson.IdcardAddress;
|
||||
person.Nation = getPerson.Nation;
|
||||
var getRealName_BasicData1 = db.RealName_BasicData.FirstOrDefault(x => x.DictCode == getPerson.Nation);
|
||||
if (getRealName_BasicData1 != null)
|
||||
{
|
||||
person.NationName = getRealName_BasicData1.DictName;
|
||||
}
|
||||
person.EduLevel = getPerson.EduLevel;
|
||||
var getRealName_BasicData2 = db.RealName_BasicData.FirstOrDefault(x => x.DictCode == getPerson.EduLevel);
|
||||
if (getRealName_BasicData2 != null)
|
||||
{
|
||||
person.EduLevelName = getRealName_BasicData2.DictName;
|
||||
}
|
||||
person.MaritalStatus = getPerson.MaritalStatus;
|
||||
var getRealName_BasicData3 = db.RealName_BasicData.FirstOrDefault(x => x.DictCode == getPerson.MaritalStatus);
|
||||
if (getRealName_BasicData3 != null)
|
||||
{
|
||||
person.MaritalStatusName = getRealName_BasicData3.DictName;
|
||||
}
|
||||
person.CountryCode = getPerson.CountryCode;
|
||||
var getRealName_Country = db.RealName_Country.FirstOrDefault(x => x.CountryId == getPerson.CountryCode);
|
||||
if (getRealName_Country != null)
|
||||
{
|
||||
person.CountryName = getRealName_Country.Cname;
|
||||
}
|
||||
person.ProvinceCode = getPerson.ProvinceCode;
|
||||
var getRealName_City = db.RealName_City.FirstOrDefault(x => x.CountryId == getPerson.CountryCode && x.ProvinceCode == getPerson.ProvinceCode);
|
||||
if (getRealName_City != null)
|
||||
{
|
||||
person.ProvinceName = getRealName_City.Cname;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -228,28 +243,6 @@ namespace BLL
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 根据personId获取人员信息
|
||||
/// <summary>
|
||||
/// 根据personId获取人员信息
|
||||
/// </summary>
|
||||
/// <param name="personId"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.PersonItem getPersonByProjectIdIdentityCard(string projectId, string identityCard)
|
||||
{
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
var getPerson = db.SitePerson_Person.FirstOrDefault(x => x.ProjectId == projectId && (x.PersonId == identityCard || x.IdentityCard == identityCard));
|
||||
if (getPerson != null)
|
||||
{
|
||||
return getPersonBySitePersonId(getPerson.SitePersonId);
|
||||
}
|
||||
else
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 根据projectId、unitid获取人员信息
|
||||
/// <summary>
|
||||
@@ -749,6 +742,15 @@ namespace BLL
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
var getPerson = db.Person_Persons.FirstOrDefault(x => x.IdentityCard == person.IdentityCard || x.PersonId == person.PersonId);
|
||||
if (getPerson == null)
|
||||
{
|
||||
var getSitePerson = db.SitePerson_Person.FirstOrDefault(x => x.SitePersonId ==person.PersonId);
|
||||
if (getSitePerson != null)
|
||||
{
|
||||
getPerson = db.Person_Persons.FirstOrDefault(x => x.IdentityCard == getSitePerson.IdentityCard || x.PersonId == getSitePerson.PersonId);
|
||||
}
|
||||
}
|
||||
|
||||
if (getPerson != null)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(person.PhotoUrl))
|
||||
|
||||
@@ -403,6 +403,7 @@
|
||||
<Compile Include="HSSE\Check\Check_CheckSpecialDetailService.cs" />
|
||||
<Compile Include="HSSE\Check\Check_CheckSpecialService.cs" />
|
||||
<Compile Include="HSSE\Check\Check_PauseNoticeService.cs" />
|
||||
<Compile Include="HSSE\Check\Check_ProjectLeaderCheckService.cs" />
|
||||
<Compile Include="HSSE\Check\IncentiveNoticeService.cs" />
|
||||
<Compile Include="HSSE\Check\PunishNoticeService.cs" />
|
||||
<Compile Include="HSSE\Check\RectifyNoticesService.cs" />
|
||||
@@ -479,6 +480,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" />
|
||||
@@ -591,6 +593,7 @@
|
||||
<Compile Include="PHTGL\ContractCompile\AttachUrl9_SubStaffingService.cs" />
|
||||
<Compile Include="PHTGL\ContractCompile\AttachUrlService.cs" />
|
||||
<Compile Include="PHTGL\ContractCompile\ContractReviewService.cs" />
|
||||
<Compile Include="PHTGL\ContractCompile\ContractStandingBookService.cs" />
|
||||
<Compile Include="PHTGL\ContractCompile\ContractService.cs" />
|
||||
<Compile Include="PHTGL\ContractCompile\PHTGL_ApproveService.cs" />
|
||||
<Compile Include="PHTGL\ContractCompile\PHTGL_SpecialTermsConditionsService.cs" />
|
||||
@@ -672,6 +675,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" />
|
||||
@@ -699,6 +704,8 @@
|
||||
<Compile Include="ZHGL\Information\SafetyQuarterlyReportService.cs" />
|
||||
<Compile Include="ZHGL\Information\UrgeReportService.cs" />
|
||||
<Compile Include="ZHGL\Information\WorkSummaryReportService.cs" />
|
||||
<Compile Include="ZHGL\Meeting\CompanySafetyMeetingService.cs" />
|
||||
<Compile Include="ZHGL\Meeting\CompanySpecialMeetingService.cs" />
|
||||
<Compile Include="ZHGL\RealName\BasicDataService.cs" />
|
||||
<Compile Include="ZHGL\RealName\CityService.cs" />
|
||||
<Compile Include="ZHGL\RealName\CountryService.cs" />
|
||||
@@ -706,6 +713,12 @@
|
||||
<Compile Include="ZHGL\RealName\RealNameMonitorService.cs" />
|
||||
<Compile Include="ZHGL\RealName\RealName_ProjectService.cs" />
|
||||
<Compile Include="ZHGL\RealName\SynchroSetService.cs" />
|
||||
<Compile Include="ZHGL\Supervise\SubUnitCheckRectifyItemService.cs" />
|
||||
<Compile Include="ZHGL\Supervise\SubUnitCheckRectifyService.cs" />
|
||||
<Compile Include="ZHGL\Supervise\SuperviseCheckRectifyItemService.cs" />
|
||||
<Compile Include="ZHGL\Supervise\SuperviseCheckRectifyService.cs" />
|
||||
<Compile Include="ZHGL\Supervise\SuperviseCheckReportItemService.cs" />
|
||||
<Compile Include="ZHGL\Supervise\SuperviseCheckReportService.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Model\Model.csproj">
|
||||
|
||||
@@ -32,6 +32,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);
|
||||
@@ -50,6 +52,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();
|
||||
}
|
||||
|
||||
@@ -436,6 +436,34 @@ namespace BLL
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 判断文件类型是否支持的预览
|
||||
/// </summary>
|
||||
/// <param name="FiletExtension"></param>
|
||||
/// <returns></returns>
|
||||
public static bool IsSupportFileType(string FiletExtension)
|
||||
{
|
||||
bool result = false;
|
||||
List<String> list = new List<string>();
|
||||
list.Add(".doc");
|
||||
list.Add(".docx");
|
||||
list.Add(".pdf");
|
||||
list.Add(".txt");
|
||||
list.Add(".xlsx");
|
||||
list.Add(".xls");
|
||||
foreach (var item in list)
|
||||
{
|
||||
if (item == FiletExtension)
|
||||
{
|
||||
result = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
|
||||
}
|
||||
|
||||
#region 根据图片路径转换为base64
|
||||
/// <summary>
|
||||
/// 根据图片路径转换为base64
|
||||
|
||||
@@ -327,6 +327,29 @@ namespace BLL
|
||||
}
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// 是否赛鼎或分公司
|
||||
/// </summary>
|
||||
/// <param name="unitId"></param>
|
||||
/// <returns></returns>
|
||||
public static bool IsSedinOrSub(string unitId)
|
||||
{
|
||||
bool result = false;
|
||||
if (unitId == Const.UnitId_SEDIN)
|
||||
{
|
||||
result = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
var uinit =UnitService.GetUnitByUnitId(unitId);
|
||||
if (uinit != null && uinit.IsBranch ==true)
|
||||
{
|
||||
result = true;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
#region 根据用户Id判断是否为本单位用户或管理员
|
||||
/// <summary>
|
||||
/// 根据用户UnitId判断是否为本单位用户或管理员
|
||||
|
||||
@@ -351,6 +351,7 @@
|
||||
/// 无损检测工岗位Id
|
||||
/// </summary>
|
||||
public static string WorkPost_Checker = "595999E9-75A8-4064-9BD1-9EE02F236297";
|
||||
|
||||
#endregion
|
||||
|
||||
#region 系统环境设置常量
|
||||
@@ -413,6 +414,19 @@
|
||||
/// 系统管理员
|
||||
/// </summary>
|
||||
public const string SystemManager = "4001f8c8-7f55-4660-822a-6b129ecf0342";
|
||||
/// <summary>
|
||||
/// 赛鼎施工管理部合同管理(能看到所有信息)
|
||||
/// </summary>
|
||||
public const string SedinHTGLManager = "58994640-5469-4cb0-b725-b6bec4e710ae";
|
||||
/// <summary>
|
||||
/// 赛鼎其他部门合同管理(只能看见本部门)
|
||||
/// </summary>
|
||||
public const string SedinHTGLDepartManager = "46e1ec69-4bae-4972-b278-a40185986876";
|
||||
/// <summary>
|
||||
/// 分子公司合同管理(只能看见要公司信息)
|
||||
/// </summary>
|
||||
public const string OtherHTGLManager = "65073269-0a14-4655-8f9e-981104b37de9";
|
||||
|
||||
#endregion
|
||||
|
||||
#region 内置项目角色定义
|
||||
@@ -775,11 +789,18 @@
|
||||
/// </summary>
|
||||
public const string CheckNoticeMenuId = "C502FC6D-DE43-4646-AE28-168D8C7BF4C0";
|
||||
|
||||
/// <summary>
|
||||
/// 公司两级领导带班检查
|
||||
/// </summary>
|
||||
public const string ServerCheckTwolevelMenuId = "6CBF1000-5E3C-4FBD-A7EC-965765F6F52D";
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 发起检查
|
||||
/// </summary>
|
||||
public const string CheckInfoMenuId = "6090DD54-FE59-4011-92EE-9906C9BC69B6";
|
||||
public const string Base_FactoryMenuId = "CD167198-1667-4552-9876-E768C2542C30";
|
||||
|
||||
/// <summary>
|
||||
/// 实业
|
||||
/// </summary>
|
||||
@@ -893,6 +914,16 @@
|
||||
/// </summary>
|
||||
public const string ProjectEnergyReportMenuId = "9DE996D9-A2CF-40C8-86D3-6A472AB30E5D";
|
||||
|
||||
/// <summary>
|
||||
/// HSSE应急预案管理清单
|
||||
/// </summary>
|
||||
public const string UnitEmergencyListMenuId = "D12C2412-E12A-4F78-9AEF-1EE8AC84A561";
|
||||
|
||||
/// <summary>
|
||||
/// 应急演练
|
||||
/// </summary>
|
||||
public const string UnitDrillRecordListMenuId = "172F25E0-F5E2-42E3-AD67-AC824D4E0FBB";
|
||||
|
||||
#region 系统设置
|
||||
/// <summary>
|
||||
/// 单位设置
|
||||
@@ -1675,6 +1706,18 @@
|
||||
/// </summary>
|
||||
public const string ServerTestRankingMenuId = "19FB0C6D-E2CA-4352-B635-060347D45C4A";
|
||||
#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
|
||||
#endregion
|
||||
|
||||
#region 人员管理
|
||||
@@ -1723,7 +1766,6 @@
|
||||
|
||||
#region 项目菜单
|
||||
|
||||
|
||||
#region 安全体系
|
||||
/// <summary>
|
||||
/// 安全组织机构
|
||||
@@ -2112,6 +2154,10 @@
|
||||
/// 联系单
|
||||
/// </summary>
|
||||
public const string ProjectContactListMenuId = "F057C207-4549-48AE-B838-A1920E5709D8";
|
||||
/// <summary>
|
||||
/// 领导带班检查
|
||||
/// </summary>
|
||||
public const string ProjectLeaderCheckMenuId = "355265DE-901A-4110-B934-B4DA067C4334";
|
||||
#endregion
|
||||
|
||||
#region APP检查管理
|
||||
@@ -2198,6 +2244,10 @@
|
||||
/// 班前会
|
||||
/// </summary>
|
||||
public const string ProjectClassMeetingMenuId = "F8ADCDBC-AAAD-4884-9935-2B63562E4779";
|
||||
/// <summary>
|
||||
/// 安全领导小组会议
|
||||
/// </summary>
|
||||
public const string ProjectSafetyLeaderGroupMeetingMenuId = "DFB56743-17BA-40BA-82EA-FCB9B0DBFAFF";
|
||||
#endregion
|
||||
|
||||
#region 出入场管理
|
||||
@@ -3044,6 +3094,10 @@
|
||||
/// 招标工作台账
|
||||
/// </summary>
|
||||
public const string ProjectBidDocumentsStandingBookMenuId = "11f4f882-28a9-4610-a657-6a58336097d2";
|
||||
/// <summary>
|
||||
/// 合同台账
|
||||
/// </summary>
|
||||
public const string ContractStandingBookMenuId = "0A5DF9F5-B6B5-41B8-8951-C203C5749495";
|
||||
|
||||
|
||||
|
||||
@@ -4521,6 +4575,7 @@
|
||||
/// 招标文件台账模板
|
||||
/// </summary>
|
||||
public const string BidDocumentsStandingBookIn = "File\\Excel\\DataIn\\BidDocumentsStandingBookIn.xlsx";
|
||||
public const string ContractStandingBookIn = "File\\Excel\\DataIn\\ContractStandingBookIn.xlsx";
|
||||
|
||||
/// <summary>
|
||||
/// 附件1
|
||||
|
||||
@@ -43,6 +43,7 @@ namespace BLL
|
||||
FileContent = accidentPersonRecord.FileContent,
|
||||
CompileMan = accidentPersonRecord.CompileMan,
|
||||
CompileDate = accidentPersonRecord.CompileDate,
|
||||
IsAttempt = accidentPersonRecord.IsAttempt,
|
||||
States = accidentPersonRecord.States
|
||||
};
|
||||
db.Accident_AccidentPersonRecord.InsertOnSubmit(newAccidentPersonRecord);
|
||||
@@ -73,6 +74,7 @@ namespace BLL
|
||||
newAccidentPersonRecord.FileContent = accidentPersonRecord.FileContent;
|
||||
newAccidentPersonRecord.CompileMan = accidentPersonRecord.CompileMan;
|
||||
newAccidentPersonRecord.CompileDate = accidentPersonRecord.CompileDate;
|
||||
newAccidentPersonRecord.IsAttempt = accidentPersonRecord.IsAttempt;
|
||||
newAccidentPersonRecord.States = accidentPersonRecord.States;
|
||||
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 = Person_PersonsService.getPersonsNamesPersonIds(getData.LeaderIds);
|
||||
}
|
||||
if (!string.IsNullOrEmpty(getData.LeaderNames))
|
||||
{
|
||||
name += "," + getData.LeaderNames;
|
||||
}
|
||||
}
|
||||
}
|
||||
return name;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,126 +1,87 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using WIA;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
public class ExpenseDetailService
|
||||
{
|
||||
public static decimal? GetSumCostMoneyByExpenseId(string expenseId)
|
||||
{
|
||||
return (from x in Funs.DB.CostGoods_ExpenseDetail where x.ExpenseId == expenseId select x.CostMoney).Sum();
|
||||
}
|
||||
|
||||
public static List<Model.CostGoods_ExpenseDetail> GetExpenseDetailsByExpenseId(string expenseId)
|
||||
{
|
||||
return (from x in Funs.DB.CostGoods_ExpenseDetail where x.ExpenseId == expenseId select x).ToList();
|
||||
}
|
||||
|
||||
public static decimal GetSumCostMoneyByExpenseIdAndType(string expenseId, string costType)
|
||||
{
|
||||
Model.CostGoods_ExpenseDetail detail = (from x in Funs.DB.CostGoods_ExpenseDetail where x.ExpenseId == expenseId && x.CostType == costType select x).FirstOrDefault();
|
||||
if (detail != null)
|
||||
{
|
||||
return detail.CostMoney ?? 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据单位和时间获取费用明细集合
|
||||
/// </summary>
|
||||
/// <param name="unitId"></param>
|
||||
/// <param name="startTime"></param>
|
||||
/// <param name="endTime"></param>
|
||||
/// <returns></returns>
|
||||
public static List<Model.CostGoods_ExpenseDetail> GetCostDetailsByUnitId(string unitId, DateTime startTime, DateTime endTime)
|
||||
{
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
return (from x in db.CostGoods_ExpenseDetail
|
||||
join y in db.CostGoods_Expense on x.ExpenseId equals y.ExpenseId
|
||||
where y.UnitId == unitId && y.States == BLL.Const.State_2 && y.ApproveDate >= startTime && y.ApproveDate < endTime
|
||||
select x).Distinct().ToList();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据单位和时间及费用类型获取当期费用
|
||||
/// </summary>
|
||||
/// <param name="unitId"></param>
|
||||
/// <param name="startTime"></param>
|
||||
/// <param name="endTime"></param>
|
||||
/// <param name="costType"></param>
|
||||
/// <returns></returns>
|
||||
public static decimal GetCostDetailsByUnitIdAndCostType(string unitId, DateTime startTime, DateTime endTime, string costType)
|
||||
{
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
decimal cost = 0;
|
||||
var q = from x in db.CostGoods_ExpenseDetail
|
||||
join y in db.CostGoods_Expense on x.ExpenseId equals y.ExpenseId
|
||||
join z in db.Sys_FlowOperate
|
||||
on y.ExpenseId equals z.DataId
|
||||
where y.UnitId == unitId && y.States == BLL.Const.State_2 && z.State == BLL.Const.State_2 && z.OperaterTime >= startTime && z.OperaterTime < endTime && x.CostType.Contains(costType)
|
||||
select x.CostMoney;
|
||||
foreach (var item in q)
|
||||
{
|
||||
if (item != null)
|
||||
{
|
||||
cost += Funs.GetNewDecimalOrZero(item.ToString());
|
||||
}
|
||||
}
|
||||
return cost;
|
||||
//return (from x in Funs.DB.CostGoods_ExpenseDetail
|
||||
// join y in Funs.DB.CostGoods_Expense on x.ExpenseId equals y.ExpenseId
|
||||
// where y.UnitId == unitId && y.States == BLL.Const.State_2 && y.ApproveDate >= startTime && y.ApproveDate < endTime && x.CostType.Contains(costType)
|
||||
// select x.CostMoney ?? 0).Sum();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 增加费用明细信息
|
||||
/// </summary>
|
||||
/// <param name="pauseNotice">费用明细实体</param>
|
||||
public static void AddCostDetail(string expenseId, string costType, decimal costMoney, string costDef)
|
||||
public static void AddCostDetail(string expenseId)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.CostGoods_ExpenseDetail newExpenseDetail = new Model.CostGoods_ExpenseDetail
|
||||
DeleteCostDetailByExpenseId(expenseId);
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
ExpenseDetailId = SQLHelper.GetNewID(typeof(Model.CostGoods_ExpenseDetail)),
|
||||
ExpenseId = expenseId,
|
||||
CostType = costType,
|
||||
CostMoney = costMoney,
|
||||
CostDef = costDef
|
||||
};
|
||||
db.CostGoods_ExpenseDetail.InsertOnSubmit(newExpenseDetail);
|
||||
db.SubmitChanges();
|
||||
var getItems = from x in db.Base_CostTypeItem
|
||||
join y in db.Base_CostType on x.CostTypeId equals y.CostTypeId
|
||||
select new
|
||||
{
|
||||
ExpenseId=expenseId,
|
||||
SupCostTypeId = y.CostTypeId,
|
||||
SupCostTypeName = y.CostTypeName,
|
||||
SupSortIndex = y.CostTypeCode,
|
||||
CostType = x.CostTypeItemId,
|
||||
CostTypeName = x.CostTypeItemName,
|
||||
SortIndex = x.SortIndex,
|
||||
CostMoney = 0,
|
||||
};
|
||||
foreach (var item in getItems)
|
||||
{
|
||||
Model.CostGoods_ExpenseDetail newExpenseDetail = new Model.CostGoods_ExpenseDetail
|
||||
{
|
||||
ExpenseDetailId = SQLHelper.GetNewID(),
|
||||
ExpenseId = expenseId,
|
||||
SupCostTypeId = item.SupCostTypeId,
|
||||
SupCostTypeName = item.SupCostTypeName,
|
||||
SupSortIndex = item.SupSortIndex,
|
||||
CostType = item.CostType,
|
||||
CostTypeName = item.CostTypeName,
|
||||
SortIndex = item.SortIndex,
|
||||
CostMoney = item.CostMoney,
|
||||
};
|
||||
db.CostGoods_ExpenseDetail.InsertOnSubmit(newExpenseDetail);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据费用编号和费用类型获取费用明细信息
|
||||
/// </summary>
|
||||
/// <param name="expenseId"></param>
|
||||
/// <param name="costType"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.CostGoods_ExpenseDetail GetCostDetailByExpenseIdAndCostType(string expenseId, string costType)
|
||||
public static void UpdateExpenseDetail(Model.CostGoods_ExpenseDetail newItem)
|
||||
{
|
||||
return Funs.DB.CostGoods_ExpenseDetail.FirstOrDefault(e => (e.ExpenseId == expenseId && e.CostType == costType));
|
||||
var getData = Funs.DB.CostGoods_ExpenseDetail.FirstOrDefault(x => x.ExpenseDetailId == newItem.ExpenseDetailId);
|
||||
if (getData != null)
|
||||
{
|
||||
getData.CostMoney = newItem.CostMoney;
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 根据费用编号删除对应的费用明细信息
|
||||
/// </summary>
|
||||
/// <param name="expenseId">编号</param>
|
||||
public static void DeleteCostDetailByExpenseId(string expenseId)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
var q = (from x in db.CostGoods_ExpenseDetail where x.ExpenseId == expenseId select x).ToList();
|
||||
db.CostGoods_ExpenseDetail.DeleteAllOnSubmit(q);
|
||||
db.SubmitChanges();
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
var q = from x in db.CostGoods_ExpenseDetail where x.ExpenseId == expenseId select x;
|
||||
if (q.Count() > 0)
|
||||
{
|
||||
db.CostGoods_ExpenseDetail.DeleteAllOnSubmit(q);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,6 +21,28 @@ namespace BLL
|
||||
return Funs.DB.CostGoods_Expense.FirstOrDefault(e => e.ExpenseId == expenseId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键获取措施费用使用计划
|
||||
/// </summary>
|
||||
/// <param name="expenseId"></param>
|
||||
/// <returns></returns>
|
||||
public static List<Model.CostGoods_Expense> GetExpenseList(string projectId, string unitId, int? year)
|
||||
{
|
||||
var getData = from x in Funs.DB.CostGoods_Expense
|
||||
where x.ProjectId == projectId
|
||||
select x;
|
||||
if (!string.IsNullOrEmpty(unitId) && unitId != Const._Null)
|
||||
{
|
||||
getData = getData.Where(x =>x.UnitId == unitId);
|
||||
}
|
||||
if (year.HasValue)
|
||||
{
|
||||
getData = getData.Where(x => x.Year == year);
|
||||
}
|
||||
|
||||
return getData.OrderBy(x => x.SortIndex).ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据时间获取当期单位Id集合
|
||||
/// </summary>
|
||||
@@ -49,22 +71,17 @@ namespace BLL
|
||||
ProjectId = expense.ProjectId,
|
||||
ExpenseCode = expense.ExpenseCode,
|
||||
UnitId = expense.UnitId,
|
||||
//newExpense.CompileMan = expense.CompileMan;
|
||||
ReportDate=expense.ReportDate,
|
||||
CreateDate = expense.CreateDate,
|
||||
States = expense.States,
|
||||
Months = expense.Months,
|
||||
ReportDate = expense.ReportDate,
|
||||
PlanCostA = expense.PlanCostA,
|
||||
PlanCostB = expense.PlanCostB,
|
||||
CompileMan = expense.CompileMan,
|
||||
CompileDate = expense.CompileDate,
|
||||
// newExpense.CheckMan = expense.CheckMan;
|
||||
CheckDate = expense.CheckDate,
|
||||
// newExpense.ApproveMan = expense.ApproveMan;
|
||||
ApproveDate = expense.ApproveDate
|
||||
SortIndex = expense.SortIndex,
|
||||
Year = expense.Year,
|
||||
};
|
||||
db.CostGoods_Expense.InsertOnSubmit(newExpense);
|
||||
db.SubmitChanges();
|
||||
BLL.CodeRecordsService.InsertCodeRecordsByMenuIdProjectIdUnitId(Const.ProjectExpenseMenuId, expense.ProjectId, null, expense.ExpenseId, expense.CreateDate);
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -79,20 +96,22 @@ namespace BLL
|
||||
{
|
||||
//newExpense.ProjectId = expense.ProjectId;
|
||||
newExpense.ExpenseCode = expense.ExpenseCode;
|
||||
newExpense.UnitId = expense.UnitId;
|
||||
// newExpense.CompileMan = expense.CompileMan;
|
||||
newExpense.CreateDate = expense.CreateDate;
|
||||
newExpense.UnitId = expense.UnitId;
|
||||
newExpense.States = expense.States;
|
||||
newExpense.Months = expense.Months;
|
||||
newExpense.ReportDate = expense.ReportDate;
|
||||
newExpense.PlanCostA = expense.PlanCostA;
|
||||
newExpense.PlanCostB = expense.PlanCostB;
|
||||
newExpense.CompileDate = expense.CompileDate;
|
||||
newExpense.CompileMan = expense.CompileMan;
|
||||
//newExpense.CheckMan = expense.CheckMan;
|
||||
newExpense.CheckDate = expense.CheckDate;
|
||||
//newExpense.CheckDate = expense.CheckDate;
|
||||
//newExpense.ApproveMan = expense.ApproveMan;
|
||||
newExpense.ApproveDate = expense.ApproveDate;
|
||||
// newExpense.ApproveDate = expense.ApproveDate;
|
||||
newExpense.SortIndex = expense.SortIndex;
|
||||
newExpense.Year = expense.Year;
|
||||
db.SubmitChanges();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -112,6 +131,48 @@ namespace BLL
|
||||
BLL.CommonService.DeleteFlowOperateByID(expenseId);
|
||||
db.CostGoods_Expense.DeleteOnSubmit(expense);
|
||||
db.SubmitChanges();
|
||||
|
||||
if (expense.Year.HasValue)
|
||||
{
|
||||
SetSumYearExpense(expense.ProjectId, expense.Year.Value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 当前合计数
|
||||
/// </summary>
|
||||
/// <param name="projectId"></param>
|
||||
/// <param name="Year"></param>
|
||||
public static void SetSumYearExpense(string projectId,int Year)
|
||||
{
|
||||
var getYearEx = Funs.DB. CostGoods_Expense.FirstOrDefault(x=>x.ProjectId == projectId && x.Year == Year && x.UnitId == null);
|
||||
if (getYearEx != null)
|
||||
{
|
||||
Funs.DB.CostGoods_Expense.DeleteOnSubmit(getYearEx);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
|
||||
var getALLEx=from x in Funs.DB.CostGoods_Expense where x.ProjectId == projectId && x.Year == Year && x.UnitId != null select x;
|
||||
if (getALLEx.Count() > 0)
|
||||
{
|
||||
Model.CostGoods_Expense newExpense = new Model.CostGoods_Expense
|
||||
{
|
||||
ExpenseId = SQLHelper.GetNewID(),
|
||||
ProjectId = projectId,
|
||||
UnitId = null,
|
||||
CreateDate = DateTime.Now,
|
||||
Months = DateTime.Now,
|
||||
ReportDate = DateTime.Now,
|
||||
CompileDate = DateTime.Now,
|
||||
CheckDate = DateTime.Now,
|
||||
ApproveDate = DateTime.Now,
|
||||
SortIndex = 0,
|
||||
Year = Year,
|
||||
};
|
||||
|
||||
db.CostGoods_Expense.InsertOnSubmit(newExpense);
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -45,7 +45,7 @@ namespace BLL
|
||||
/// <returns></returns>
|
||||
public static IEnumerable getListData(string projetcId, string unitId, string workPostId, string name, string idCard, string states, string personType, Grid Grid1)
|
||||
{
|
||||
IQueryable<Model.View_SitePerson_Person> getDataList = getDataLists.OrderBy(x => x.ProjectId).ThenBy(x => x.UnitId);
|
||||
IQueryable<Model.View_SitePerson_Person> getDataList = getDataLists;
|
||||
if (!string.IsNullOrEmpty(projetcId) && projetcId != Const._Null)
|
||||
{
|
||||
getDataList = getDataList.Where(e => e.ProjectId == projetcId);
|
||||
@@ -79,7 +79,7 @@ namespace BLL
|
||||
{
|
||||
return null;
|
||||
}
|
||||
getDataList = SortConditionHelper.SortingAndPaging(getDataList, Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize);
|
||||
getDataList = SortConditionHelper.SortingAndPaging(getDataList.OrderBy(x => x.ProjectId).ThenBy(x => x.UnitId), Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize);
|
||||
return from x in getDataList
|
||||
select new
|
||||
{
|
||||
@@ -698,6 +698,7 @@ namespace BLL
|
||||
InTime = person.InTime.HasValue ? person.InTime : DateTime.Now,
|
||||
Isprint = "0",
|
||||
States = person.States,
|
||||
IsSafetyMonitoring=person.IsSafetyMonitoring,
|
||||
};
|
||||
|
||||
////现场人员项目出入场记录
|
||||
@@ -767,6 +768,7 @@ namespace BLL
|
||||
newPerson.States = person.States;
|
||||
setPersonItemInOut = true;
|
||||
}
|
||||
newPerson.IsSafetyMonitoring = person.IsSafetyMonitoring;
|
||||
db.SubmitChanges();
|
||||
|
||||
if (!setPersonItemInOut)
|
||||
|
||||
@@ -28,6 +28,8 @@ namespace BLL
|
||||
{
|
||||
var q = from x in db.PHTGL_BidDocumentsStandingBook
|
||||
where
|
||||
(string.IsNullOrEmpty(table.UnitId) || x.UnitId.Contains(table.UnitId)) &&
|
||||
(string.IsNullOrEmpty(table.DepartId) || x.DepartId.Contains(table.DepartId)) &&
|
||||
(string.IsNullOrEmpty(table.BidDocumentsStandingBookId) || x.BidDocumentsStandingBookId.Contains(table.BidDocumentsStandingBookId)) &&
|
||||
(string.IsNullOrEmpty(table.EPCCode) || x.EPCCode.Contains(table.EPCCode)) &&
|
||||
(string.IsNullOrEmpty(table.ProjectShortName) || x.ProjectShortName.Contains(table.ProjectShortName)) &&
|
||||
@@ -70,6 +72,8 @@ namespace BLL
|
||||
select new
|
||||
{
|
||||
x.BidDocumentsStandingBookId,
|
||||
x.UnitId,
|
||||
x.DepartId,
|
||||
x.EPCCode,
|
||||
x.ProjectShortName,
|
||||
x.ProjectCode,
|
||||
@@ -106,6 +110,8 @@ namespace BLL
|
||||
Model.PHTGL_BidDocumentsStandingBook table = new Model.PHTGL_BidDocumentsStandingBook
|
||||
{
|
||||
BidDocumentsStandingBookId = newtable.BidDocumentsStandingBookId,
|
||||
UnitId= newtable.UnitId,
|
||||
DepartId= newtable.DepartId,
|
||||
EPCCode = newtable.EPCCode,
|
||||
ProjectShortName = newtable.ProjectShortName,
|
||||
ProjectCode = newtable.ProjectCode,
|
||||
@@ -145,6 +151,8 @@ namespace BLL
|
||||
if (table != null)
|
||||
{
|
||||
table.BidDocumentsStandingBookId = newtable.BidDocumentsStandingBookId;
|
||||
table.UnitId= newtable.UnitId;
|
||||
table.DepartId= newtable.DepartId;
|
||||
table.EPCCode = newtable.EPCCode;
|
||||
table.ProjectShortName = newtable.ProjectShortName;
|
||||
table.ProjectCode = newtable.ProjectCode;
|
||||
|
||||
@@ -0,0 +1,534 @@
|
||||
using FineUIPro;
|
||||
using MiniExcelLibs.Attributes;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
/// <summary>
|
||||
/// 合同基本信息
|
||||
/// </summary>
|
||||
public static class ContractStandingBookService
|
||||
{
|
||||
public static Model.SGGLDB db = Funs.DB;
|
||||
#region 获取列表
|
||||
/// <summary>
|
||||
/// 记录数
|
||||
/// </summary>
|
||||
public static int count
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
public static List<Model.PHTGL_ContractStandingBook> GetPHTGL_ContractStandingBookByModle(Model.PHTGL_ContractStandingBook table)
|
||||
{
|
||||
var q = from x in Funs.DB.PHTGL_ContractStandingBook
|
||||
where
|
||||
(string.IsNullOrEmpty(table.ContractId) || x.ContractId.Contains(table.ContractId)) &&
|
||||
(string.IsNullOrEmpty(table.ProjectId) || x.ProjectId.Contains(table.ProjectId)) &&
|
||||
(string.IsNullOrEmpty(table.UnitId) || x.UnitId.Contains(table.UnitId)) &&
|
||||
(string.IsNullOrEmpty(table.ContractName) || x.ContractName.Contains(table.ContractName)) &&
|
||||
(string.IsNullOrEmpty(table.ContractNum) || x.ContractNum.Contains(table.ContractNum)) &&
|
||||
(string.IsNullOrEmpty(table.Parties) || x.Parties.Contains(table.Parties)) &&
|
||||
(string.IsNullOrEmpty(table.Currency) || x.Currency.Contains(table.Currency)) &&
|
||||
(string.IsNullOrEmpty(table.DepartId) || x.DepartId.Contains(table.DepartId)) &&
|
||||
(string.IsNullOrEmpty(table.Agent) || x.Agent.Contains(table.Agent)) &&
|
||||
(string.IsNullOrEmpty(table.ContractType) || x.ContractType.Contains(table.ContractType)) &&
|
||||
(string.IsNullOrEmpty(table.Remarks) || x.Remarks.Contains(table.Remarks)) &&
|
||||
(string.IsNullOrEmpty(table.CreatUser) || x.CreatUser.Contains(table.CreatUser)) &&
|
||||
(string.IsNullOrEmpty(table.ContractCode) || x.ContractCode.Contains(table.ContractCode)) &&
|
||||
(string.IsNullOrEmpty(table.IsPassBid) || x.IsPassBid.Contains(table.IsPassBid)) &&
|
||||
(string.IsNullOrEmpty(table.PassBidCode) || x.PassBidCode.Contains(table.PassBidCode)) &&
|
||||
(string.IsNullOrEmpty(table.BuildUnit) || x.BuildUnit.Contains(table.BuildUnit)) &&
|
||||
(string.IsNullOrEmpty(table.NoUseStandardtxtRemark) || x.NoUseStandardtxtRemark.Contains(table.NoUseStandardtxtRemark)) &&
|
||||
(string.IsNullOrEmpty(table.EPCCode) || x.EPCCode.Contains(table.EPCCode)) &&
|
||||
(string.IsNullOrEmpty(table.ProjectShortName) || x.ProjectShortName.Contains(table.ProjectShortName)) &&
|
||||
(string.IsNullOrEmpty(table.ContractAttribute) || x.ContractAttribute.Contains(table.ContractAttribute)) &&
|
||||
(string.IsNullOrEmpty(table.ContractAttributeRemark) || x.ContractAttributeRemark.Contains(table.ContractAttributeRemark)) &&
|
||||
(string.IsNullOrEmpty(table.ConfirmWay) || x.ConfirmWay.Contains(table.ConfirmWay)) &&
|
||||
(string.IsNullOrEmpty(table.SetSubReviewCode) || x.SetSubReviewCode.Contains(table.SetSubReviewCode)) &&
|
||||
(string.IsNullOrEmpty(table.ActionPlanCode) || x.ActionPlanCode.Contains(table.ActionPlanCode)) &&
|
||||
(string.IsNullOrEmpty(table.SituationRemark) || x.SituationRemark.Contains(table.SituationRemark)) &&
|
||||
(string.IsNullOrEmpty(table.OpeningBank_TT) || x.OpeningBank_TT.Contains(table.OpeningBank_TT)) &&
|
||||
(string.IsNullOrEmpty(table.OpeningBank_Electrophore) || x.OpeningBank_Electrophore.Contains(table.OpeningBank_Electrophore)) &&
|
||||
(string.IsNullOrEmpty(table.BankAccount_TT) || x.BankAccount_TT.Contains(table.BankAccount_TT)) &&
|
||||
(string.IsNullOrEmpty(table.BankAccount_Electrophore) || x.BankAccount_Electrophore.Contains(table.BankAccount_Electrophore)) &&
|
||||
(string.IsNullOrEmpty(table.LineNumber_Electrophore) || x.LineNumber_Electrophore.Contains(table.LineNumber_Electrophore)) &&
|
||||
(string.IsNullOrEmpty(table.Retentionmoney) || x.Retentionmoney.Contains(table.Retentionmoney)) &&
|
||||
(string.IsNullOrEmpty(table.CreateDate) || x.CreateDate.Contains(table.CreateDate)) &&
|
||||
(string.IsNullOrEmpty(table.Status) || x.Status.Contains(table.Status)) &&
|
||||
(table.States == null || x.States==table.States) &&
|
||||
(string.IsNullOrEmpty(table.ContactUnitOfPartyA) || x.ContactUnitOfPartyA.Contains(table.ContactUnitOfPartyA)) &&
|
||||
(string.IsNullOrEmpty(table.ContactPersonOfPartyA) || x.ContactPersonOfPartyA.Contains(table.ContactPersonOfPartyA)) &&
|
||||
(string.IsNullOrEmpty(table.ContactPersonOfPartyB) || x.ContactPersonOfPartyB.Contains(table.ContactPersonOfPartyB)) &&
|
||||
(string.IsNullOrEmpty(table.ContactPersonPhoneOfPartyB) || x.ContactPersonPhoneOfPartyB.Contains(table.ContactPersonPhoneOfPartyB)) &&
|
||||
(string.IsNullOrEmpty(table.ContactPersonEmailOfPartyB) || x.ContactPersonEmailOfPartyB.Contains(table.ContactPersonEmailOfPartyB)) &&
|
||||
(string.IsNullOrEmpty(table.PriceMethod) || x.PriceMethod.Contains(table.PriceMethod)) &&
|
||||
(string.IsNullOrEmpty(table.SignedOnDate) || x.SignedOnDate.Contains(table.SignedOnDate)) &&
|
||||
(string.IsNullOrEmpty(table.ContractStartDate) || x.ContractStartDate.Contains(table.ContractStartDate)) &&
|
||||
(string.IsNullOrEmpty(table.ContractEndDate) || x.ContractEndDate.Contains(table.ContractEndDate)) &&
|
||||
(string.IsNullOrEmpty(table.PricingBasis) || x.PricingBasis.Contains(table.PricingBasis)) &&
|
||||
(string.IsNullOrEmpty(table.SubcontractingMethod) || x.SubcontractingMethod.Contains(table.SubcontractingMethod)) &&
|
||||
(string.IsNullOrEmpty(table.IsItACentralizedPurchaseSupplier) || x.IsItACentralizedPurchaseSupplier.Contains(table.IsItACentralizedPurchaseSupplier)) &&
|
||||
(string.IsNullOrEmpty(table.Clause) || x.Clause.Contains(table.Clause)) &&
|
||||
(string.IsNullOrEmpty(table.MainContent) || x.MainContent.Contains(table.MainContent))
|
||||
select x
|
||||
;
|
||||
|
||||
return q.ToList();
|
||||
}
|
||||
|
||||
/// 获取分页列表
|
||||
/// </summary>
|
||||
/// <param name="PageIndex">页码</param>
|
||||
/// <param name="PageSize">每页数量</param>
|
||||
/// <returns></returns>
|
||||
public static IEnumerable getListData(Model.PHTGL_ContractStandingBook table, Grid Grid1)
|
||||
{
|
||||
var q = GetPHTGL_ContractStandingBookByModle(table);
|
||||
count = q.Count();
|
||||
if (count == 0)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
q= q.Take(Grid1.PageSize * Grid1.PageIndex).Skip(Grid1.PageSize * (Grid1.PageIndex)).ToList();
|
||||
// q = SortConditionHelper.SortingAndPaging(q, Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize);
|
||||
return from x in q
|
||||
select new
|
||||
{
|
||||
x.ContractId,
|
||||
x.ProjectId,
|
||||
x.UnitId,
|
||||
x.ContractName,
|
||||
x.ContractNum,
|
||||
x.Parties,
|
||||
x.Currency,
|
||||
x.ContractAmount,
|
||||
x.DepartId,
|
||||
x.Agent,
|
||||
x.ContractType,
|
||||
x.Remarks,
|
||||
x.ApproveState,
|
||||
x.CreatUser,
|
||||
x.ContractCode,
|
||||
x.IsPassBid,
|
||||
x.PassBidCode,
|
||||
x.BuildUnit,
|
||||
x.IsUseStandardtxt,
|
||||
x.NoUseStandardtxtRemark,
|
||||
x.EPCCode,
|
||||
x.ProjectShortName,
|
||||
x.ContractAttribute,
|
||||
x.ContractAttributeRemark,
|
||||
x.ConfirmWay,
|
||||
x.SetSubReviewCode,
|
||||
x.ActionPlanCode,
|
||||
x.SituationRemark,
|
||||
x.OpeningBank_TT,
|
||||
x.OpeningBank_Electrophore,
|
||||
x.BankAccount_TT,
|
||||
x.BankAccount_Electrophore,
|
||||
x.LineNumber_Electrophore,
|
||||
x.Retentionmoney,
|
||||
x.CreateDate,
|
||||
x.Status,
|
||||
x.States,
|
||||
x.ContactUnitOfPartyA,
|
||||
x.ContactPersonOfPartyA,
|
||||
x.ContactPersonOfPartyB,
|
||||
x.ContactPersonPhoneOfPartyB,
|
||||
x.ContactPersonEmailOfPartyB,
|
||||
x.ContractAmountExcludingTax,
|
||||
x.PriceMethod,
|
||||
x.SignedOnDate,
|
||||
x.ContractStartDate,
|
||||
x.ContractEndDate,
|
||||
x.PricingBasis,
|
||||
x.SubcontractingMethod,
|
||||
x.IsItACentralizedPurchaseSupplier,
|
||||
x.Clause,
|
||||
x.MainContent,
|
||||
|
||||
};
|
||||
}
|
||||
#endregion
|
||||
/// <summary>
|
||||
/// 根据主键获取合同基本信息
|
||||
/// </summary>
|
||||
/// <param name="contractId"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.PHTGL_ContractStandingBook GetContractById(string contractId)
|
||||
{
|
||||
return Funs.DB.PHTGL_ContractStandingBook.FirstOrDefault(e => e.ContractId == contractId);
|
||||
}
|
||||
/// <summary>
|
||||
/// 根据总包合同编号
|
||||
/// </summary>
|
||||
/// <param name="ProjectId"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.PHTGL_ContractStandingBook GetContractByProjectId(string ProjectId)
|
||||
{
|
||||
return Funs.DB.PHTGL_ContractStandingBook.FirstOrDefault(e => e.ProjectId == ProjectId);
|
||||
}
|
||||
/// <summary>
|
||||
/// 根据合同编号
|
||||
/// </summary>
|
||||
/// <param name="ContractNum"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.PHTGL_ContractStandingBook GetContractByContractNum(string ContractNum)
|
||||
{
|
||||
return Funs.DB.PHTGL_ContractStandingBook.FirstOrDefault(e => e.ContractNum == ContractNum);
|
||||
}
|
||||
|
||||
public static List<Model.Base_Project> GetProjectDropDownList()
|
||||
{
|
||||
var list = (from x in Funs.DB.PHTGL_ContractStandingBook
|
||||
join y in Funs.DB.Base_Project on x.ProjectId equals y.ProjectId
|
||||
where x.ApproveState > 0
|
||||
select y).ToList();
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
public static void InitAllProjectCodeDropDownList(FineUIPro.DropDownList dropName, bool isShowPlease)
|
||||
{
|
||||
dropName.DataValueField = "ProjectId";
|
||||
dropName.DataTextField = "ProjectCode";
|
||||
var projectlist = BLL.ContractService.GetProjectDropDownList();
|
||||
dropName.DataSource = projectlist;
|
||||
dropName.DataBind();
|
||||
if (projectlist.Count() == 0)
|
||||
{
|
||||
isShowPlease = true;
|
||||
}
|
||||
if (isShowPlease)
|
||||
{
|
||||
Funs.FineUIPleaseSelect(dropName);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 增加合同基本信息
|
||||
/// </summary>
|
||||
/// <param name="contract"></param>
|
||||
public static void AddContract(Model.PHTGL_ContractStandingBook newtable)
|
||||
{
|
||||
Model.PHTGL_ContractStandingBook table = new Model.PHTGL_ContractStandingBook
|
||||
{
|
||||
ContractId = newtable.ContractId,
|
||||
ProjectId = newtable.ProjectId,
|
||||
UnitId=newtable.UnitId,
|
||||
ProjectName= newtable.ProjectName,
|
||||
ProjectCode= newtable.ProjectCode,
|
||||
ContractName = newtable.ContractName,
|
||||
ContractNum = newtable.ContractNum,
|
||||
Parties = newtable.Parties,
|
||||
Currency = newtable.Currency,
|
||||
ContractAmount = newtable.ContractAmount,
|
||||
DepartId = newtable.DepartId,
|
||||
Agent = newtable.Agent,
|
||||
ContractType = newtable.ContractType,
|
||||
Remarks = newtable.Remarks,
|
||||
ApproveState = newtable.ApproveState,
|
||||
CreatUser = newtable.CreatUser,
|
||||
ContractCode = newtable.ContractCode,
|
||||
IsPassBid = newtable.IsPassBid,
|
||||
PassBidCode = newtable.PassBidCode,
|
||||
BuildUnit = newtable.BuildUnit,
|
||||
IsUseStandardtxt = newtable.IsUseStandardtxt,
|
||||
NoUseStandardtxtRemark = newtable.NoUseStandardtxtRemark,
|
||||
EPCCode = newtable.EPCCode,
|
||||
ProjectShortName = newtable.ProjectShortName,
|
||||
ContractAttribute = newtable.ContractAttribute,
|
||||
ContractAttributeRemark = newtable.ContractAttributeRemark,
|
||||
ConfirmWay = newtable.ConfirmWay,
|
||||
SetSubReviewCode = newtable.SetSubReviewCode,
|
||||
ActionPlanCode = newtable.ActionPlanCode,
|
||||
SituationRemark = newtable.SituationRemark,
|
||||
OpeningBank_TT = newtable.OpeningBank_TT,
|
||||
OpeningBank_Electrophore = newtable.OpeningBank_Electrophore,
|
||||
BankAccount_TT = newtable.BankAccount_TT,
|
||||
BankAccount_Electrophore = newtable.BankAccount_Electrophore,
|
||||
LineNumber_Electrophore = newtable.LineNumber_Electrophore,
|
||||
Retentionmoney = newtable.Retentionmoney,
|
||||
CreateDate = newtable.CreateDate,
|
||||
Status = newtable.Status,
|
||||
States = newtable.States,
|
||||
ContactPersonOfPartyA = newtable.ContactPersonOfPartyA,
|
||||
ContactPersonOfPartyB = newtable.ContactPersonOfPartyB,
|
||||
ContactPersonPhoneOfPartyB = newtable.ContactPersonPhoneOfPartyB,
|
||||
ContactPersonEmailOfPartyB = newtable.ContactPersonEmailOfPartyB,
|
||||
ContractAmountExcludingTax = newtable.ContractAmountExcludingTax,
|
||||
PriceMethod = newtable.PriceMethod,
|
||||
SignedOnDate = newtable.SignedOnDate,
|
||||
ContractStartDate = newtable.ContractStartDate,
|
||||
ContractEndDate = newtable.ContractEndDate,
|
||||
PricingBasis = newtable.PricingBasis,
|
||||
SubcontractingMethod = newtable.SubcontractingMethod,
|
||||
IsItACentralizedPurchaseSupplier = newtable.IsItACentralizedPurchaseSupplier,
|
||||
ContactUnitOfPartyA = newtable.ContactUnitOfPartyA,
|
||||
Clause = newtable.Clause,
|
||||
MainContent = newtable.MainContent,
|
||||
};
|
||||
Funs.DB.PHTGL_ContractStandingBook.InsertOnSubmit(table);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 修改合同基本信息
|
||||
/// </summary>
|
||||
/// <param name="contract"></param>
|
||||
public static void UpdateContract(Model.PHTGL_ContractStandingBook contract)
|
||||
{
|
||||
Model.PHTGL_ContractStandingBook newContract = Funs.DB.PHTGL_ContractStandingBook.FirstOrDefault(e => e.ContractId == contract.ContractId);
|
||||
if (newContract != null)
|
||||
{
|
||||
newContract.ProjectId = contract.ProjectId;
|
||||
newContract.UnitId= contract.UnitId;
|
||||
newContract.ProjectName=contract.ProjectName;
|
||||
newContract.ProjectCode=contract.ProjectCode;
|
||||
newContract.ContractCode = contract.ContractCode;
|
||||
newContract.ContractName = contract.ContractName;
|
||||
newContract.ContractNum = contract.ContractNum;
|
||||
newContract.Parties = contract.Parties;
|
||||
newContract.Currency = contract.Currency;
|
||||
newContract.ContractAmount = contract.ContractAmount;
|
||||
newContract.DepartId = contract.DepartId;
|
||||
newContract.Agent = contract.Agent;
|
||||
newContract.ContractType = contract.ContractType;
|
||||
newContract.Remarks = contract.Remarks;
|
||||
newContract.ApproveState = contract.ApproveState;
|
||||
newContract.CreatUser = contract.CreatUser;
|
||||
newContract.IsPassBid = contract.IsPassBid;
|
||||
newContract.PassBidCode = contract.PassBidCode;
|
||||
newContract.BuildUnit = contract.BuildUnit;
|
||||
newContract.EPCCode = contract.EPCCode;
|
||||
newContract.IsUseStandardtxt = contract.IsUseStandardtxt;
|
||||
newContract.NoUseStandardtxtRemark = contract.NoUseStandardtxtRemark;
|
||||
newContract.ProjectShortName = contract.ProjectShortName;
|
||||
newContract.ContractAttribute = contract.ContractAttribute;
|
||||
newContract.ContractAttributeRemark = contract.ContractAttributeRemark;
|
||||
newContract.ConfirmWay = contract.ConfirmWay;
|
||||
newContract.SetSubReviewCode = contract.SetSubReviewCode;
|
||||
newContract.ActionPlanCode = contract.ActionPlanCode;
|
||||
newContract.SituationRemark = contract.SituationRemark;
|
||||
newContract.OpeningBank_TT = contract.OpeningBank_TT;
|
||||
newContract.OpeningBank_Electrophore = contract.OpeningBank_Electrophore;
|
||||
newContract.BankAccount_TT = contract.BankAccount_TT;
|
||||
newContract.BankAccount_Electrophore = contract.BankAccount_Electrophore;
|
||||
newContract.LineNumber_Electrophore = contract.LineNumber_Electrophore;
|
||||
newContract.Retentionmoney = contract.Retentionmoney;
|
||||
newContract.CreateDate = contract.CreateDate;
|
||||
newContract.Status = contract.Status;
|
||||
newContract.States = contract.States;
|
||||
newContract.ContactPersonOfPartyA = contract.ContactPersonOfPartyA;
|
||||
newContract.ContactPersonOfPartyB = contract.ContactPersonOfPartyB;
|
||||
newContract.ContactPersonPhoneOfPartyB = contract.ContactPersonPhoneOfPartyB;
|
||||
newContract.ContactPersonEmailOfPartyB = contract.ContactPersonEmailOfPartyB;
|
||||
newContract.ContractAmountExcludingTax = contract.ContractAmountExcludingTax;
|
||||
newContract.PriceMethod = contract.PriceMethod;
|
||||
newContract.SignedOnDate = contract.SignedOnDate;
|
||||
newContract.ContractStartDate = contract.ContractStartDate;
|
||||
newContract.ContractEndDate = contract.ContractEndDate;
|
||||
newContract.PricingBasis = contract.PricingBasis;
|
||||
newContract.SubcontractingMethod = contract.SubcontractingMethod;
|
||||
newContract.IsItACentralizedPurchaseSupplier = contract.IsItACentralizedPurchaseSupplier;
|
||||
newContract.ContactUnitOfPartyA = contract.ContactUnitOfPartyA;
|
||||
newContract.Clause = contract.Clause;
|
||||
newContract.MainContent = contract.MainContent;
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键删除合同基本信息
|
||||
/// </summary>
|
||||
/// <param name="contractId"></param>
|
||||
public static void DeleteContractById(string contractId)
|
||||
{
|
||||
|
||||
Model.PHTGL_ContractStandingBook contract = Funs.DB.PHTGL_ContractStandingBook.FirstOrDefault(e => e.ContractId == contractId);
|
||||
if (contract != null)
|
||||
{
|
||||
Funs.DB.PHTGL_ContractStandingBook.DeleteOnSubmit(contract);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
public static void AddBulkPHTGL_ContractStandingBook(List<Model.PHTGL_ContractStandingBook> newtables)
|
||||
{
|
||||
|
||||
Funs.DB.PHTGL_ContractStandingBook.InsertAllOnSubmit(newtables);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
public class ContractStandingBooKDtoIn
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// 合同名称
|
||||
///</summary>
|
||||
[ExcelColumnName("合同名称")]
|
||||
public string ContractName { get; set; }
|
||||
/// <summary>
|
||||
/// 合同编号
|
||||
///</summary>
|
||||
[ExcelColumnName("合同编号")]
|
||||
public string ContractNum { get; set; }
|
||||
|
||||
[ExcelColumnName("项目名称")]
|
||||
public string ProjectName { get; set; }
|
||||
|
||||
[ExcelColumnName("项目代码")]
|
||||
public string ProjectCode { get; set; }
|
||||
/// <summary>
|
||||
/// 签约方
|
||||
///</summary>
|
||||
[ExcelColumnName("签约方")]
|
||||
public string Parties { get; set; }
|
||||
/// <summary>
|
||||
/// 币种(人民币、美元、欧元、印尼盾)
|
||||
///</summary>
|
||||
[ExcelColumnName("币种")]
|
||||
public string Currency { get; set; }
|
||||
/// <summary>
|
||||
/// 合同金额
|
||||
///</summary>
|
||||
[ExcelColumnName("合同金额")]
|
||||
public string ContractAmount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 合同类型(1-施工总承包分包合同、2-施工专业分包合同、3-上官红劳务分包合同、4-试车服务合同、5-租赁合同)
|
||||
///</summary>
|
||||
[ExcelColumnName("合同类型")]
|
||||
public string ContractType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
///</summary>
|
||||
[ExcelColumnName("总承包合同编号")]
|
||||
public string EPCCode { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
///</summary>
|
||||
[ExcelColumnName("项目名称")]
|
||||
public string ProjectShortName { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
///</summary>
|
||||
[ExcelColumnName("合同属性")]
|
||||
public string ContractAttribute { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
///</summary>
|
||||
[ExcelColumnName("开户行电汇")]
|
||||
public string OpeningBankTT { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
///</summary>
|
||||
[ExcelColumnName("开户行电承")]
|
||||
public string OpeningBankelectrophore { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
///</summary>
|
||||
[ExcelColumnName("银行账号电汇")]
|
||||
public string BankAccountTT { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
///</summary>
|
||||
[ExcelColumnName("银行账号电承")]
|
||||
public string BankAccountelectrophore { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
///</summary>
|
||||
[ExcelColumnName("行号电承")]
|
||||
public string LineNumberelectrophore { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
///</summary>
|
||||
[ExcelColumnName("质保金")]
|
||||
public string Retentionmoney { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 合同状态
|
||||
///</summary>
|
||||
[ExcelColumnName("合同状态")]
|
||||
public string Status { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 甲方联系单位
|
||||
///</summary>
|
||||
[ExcelColumnName("甲方联系单位")]
|
||||
public string ContactUnitOfPartyA { get; set; }
|
||||
/// <summary>
|
||||
/// 甲方联系人
|
||||
///</summary>
|
||||
[ExcelColumnName("甲方联系人")]
|
||||
public string ContactPersonOfPartyA { get; set; }
|
||||
/// <summary>
|
||||
/// 乙方联系人
|
||||
///</summary>
|
||||
[ExcelColumnName("乙方联系人")]
|
||||
public string ContactPersonOfPartyB { get; set; }
|
||||
/// <summary>
|
||||
/// 乙方联系人电话
|
||||
///</summary>
|
||||
[ExcelColumnName("乙方联系人电话")]
|
||||
public string ContactPersonPhoneOfPartyB { get; set; }
|
||||
/// <summary>
|
||||
/// 乙方联系人邮箱
|
||||
///</summary>
|
||||
[ExcelColumnName("乙方联系人邮箱")]
|
||||
public string ContactPersonEmailOfPartyB { get; set; }
|
||||
/// <summary>
|
||||
/// 合同不含税金额
|
||||
///</summary>
|
||||
[ExcelColumnName("合同不含税金额")]
|
||||
public string ContractAmountExcludingTax { get; set; }
|
||||
/// <summary>
|
||||
/// 计价方式
|
||||
///</summary>
|
||||
[ExcelColumnName("计价方式")]
|
||||
public string PriceMethod { get; set; }
|
||||
/// <summary>
|
||||
/// 签订日期
|
||||
///</summary>
|
||||
[ExcelColumnName("签订日期")]
|
||||
public string SignedOnDate { get; set; }
|
||||
/// <summary>
|
||||
/// 合同起始日期
|
||||
///</summary>
|
||||
[ExcelColumnName("合同起始日期")]
|
||||
public string ContractStartDate { get; set; }
|
||||
/// <summary>
|
||||
/// 合同终止日期
|
||||
///</summary>
|
||||
[ExcelColumnName("合同终止日期")]
|
||||
public string ContractEndDate { get; set; }
|
||||
/// <summary>
|
||||
/// 计价依据
|
||||
///</summary>
|
||||
[ExcelColumnName("计价依据")]
|
||||
public string PricingBasis { get; set; }
|
||||
/// <summary>
|
||||
/// 分包模式 1-内部分包,2-外部分包
|
||||
///</summary>
|
||||
[ExcelColumnName("分包模式")]
|
||||
public string SubcontractingMethod { get; set; }
|
||||
/// <summary>
|
||||
/// 乙方是否为集采供应商/分包商 0-否,1-是
|
||||
///</summary>
|
||||
[ExcelColumnName("乙方是否为集采供应商/分包商")]
|
||||
public string IsItACentralizedPurchaseSupplier { get; set; }
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -639,10 +639,16 @@ namespace BLL
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
List<Model.Person_Persons> list = new List<Model.Person_Persons>();
|
||||
list = (from x in db.Person_Persons
|
||||
where x.UnitId == unitId && x.DepartId == DepartId
|
||||
orderby x.PersonName
|
||||
select x).ToList();
|
||||
var getPersons = from x in db.Person_Persons select x;
|
||||
if (!string.IsNullOrEmpty(unitId))
|
||||
{
|
||||
getPersons = getPersons.Where(x => x.UnitId == unitId);
|
||||
}
|
||||
if (!string.IsNullOrEmpty(DepartId))
|
||||
{
|
||||
getPersons = getPersons.Where(x => x.DepartId == DepartId);
|
||||
}
|
||||
list = getPersons.OrderBy(x=>x.UnitId).OrderBy(x=>x.PersonName).ToList();
|
||||
return list;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -92,7 +92,20 @@ namespace BLL
|
||||
}
|
||||
return name;
|
||||
}
|
||||
|
||||
public static string getDepartNameById(object departId)
|
||||
{
|
||||
string name = string.Empty;
|
||||
if (departId!=null&& !string.IsNullOrEmpty(departId.ToString()))
|
||||
{
|
||||
var dep = Funs.DB.Base_Depart.FirstOrDefault(e => e.DepartId == departId.ToString());
|
||||
if (dep != null)
|
||||
{
|
||||
name = dep.DepartName;
|
||||
}
|
||||
}
|
||||
|
||||
return name;
|
||||
}
|
||||
#region 表下拉框
|
||||
/// <summary>
|
||||
/// 表下拉框
|
||||
|
||||
@@ -289,24 +289,37 @@ namespace BLL
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
List<Model.Base_Unit> unitList = new List<Model.Base_Unit>();
|
||||
if (unitType != Const.ProjectUnitType_2)
|
||||
if (!string.IsNullOrEmpty(unitType))
|
||||
{
|
||||
unitList = (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
|
||||
orderby x.UnitCode
|
||||
select x).ToList();
|
||||
if (unitType != Const.ProjectUnitType_2)
|
||||
{
|
||||
unitList = (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
|
||||
orderby x.UnitCode
|
||||
select x).ToList();
|
||||
}
|
||||
else
|
||||
{
|
||||
unitList = (from x in db.Base_Unit
|
||||
join y in db.Project_ProjectUnit
|
||||
on x.UnitId equals y.UnitId
|
||||
where y.ProjectId == projectId && (y.UnitType == BLL.Const.ProjectUnitType_2 || y.UnitType == BLL.Const.ProjectUnitType_6)
|
||||
orderby x.UnitCode
|
||||
select x).ToList();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
unitList = (from x in db.Base_Unit
|
||||
join y in db.Project_ProjectUnit
|
||||
on x.UnitId equals y.UnitId
|
||||
where y.ProjectId == projectId && (y.UnitType == BLL.Const.ProjectUnitType_2 || y.UnitType == BLL.Const.ProjectUnitType_6)
|
||||
where y.ProjectId == projectId
|
||||
orderby x.UnitCode
|
||||
select x).ToList();
|
||||
}
|
||||
|
||||
return unitList;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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,84 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
/// <summary>
|
||||
/// 监督检查报告明细
|
||||
/// </summary>
|
||||
public static class SubUnitCheckRectifyItemService
|
||||
{
|
||||
/// <summary>
|
||||
/// 根据评价报告主键获取所有明细信息
|
||||
/// </summary>
|
||||
/// <param name="subUnitCheckRectifyId"></param>
|
||||
/// <returns></returns>
|
||||
public static List<Model.Supervise_SubUnitCheckRectifyItem> GetSubUnitCheckRectifyItemList(string subUnitCheckRectifyId)
|
||||
{
|
||||
return (from x in Funs.DB.Supervise_SubUnitCheckRectifyItem where x.SubUnitCheckRectifyId == subUnitCheckRectifyId orderby x.CheckDate descending select x).ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加监督评价报告明细
|
||||
/// </summary>
|
||||
/// <param name="item"></param>
|
||||
public static void AddSubUnitCheckRectifyItem(Model.Supervise_SubUnitCheckRectifyItem item)
|
||||
{
|
||||
Model.Supervise_SubUnitCheckRectifyItem newItem = new Model.Supervise_SubUnitCheckRectifyItem
|
||||
{
|
||||
SubUnitCheckRectifyItemId = item.SubUnitCheckRectifyItemId,
|
||||
SubUnitCheckRectifyId = item.SubUnitCheckRectifyId,
|
||||
Name = item.Name,
|
||||
Sex = item.Sex,
|
||||
UnitName = item.UnitName,
|
||||
PostName = item.PostName,
|
||||
WorkTitle = item.WorkTitle,
|
||||
CheckPostName = item.CheckPostName,
|
||||
CheckDate = item.CheckDate
|
||||
};
|
||||
Funs.DB.Supervise_SubUnitCheckRectifyItem.InsertOnSubmit(newItem);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据评价报告主键删除所有相关明细信息
|
||||
/// </summary>
|
||||
/// <param name="subUnitCheckRectifyId"></param>
|
||||
public static void DeleteSubUnitCheckRectifyItemsList(string subUnitCheckRectifyId)
|
||||
{
|
||||
var q = (from x in Funs.DB.Supervise_SubUnitCheckRectifyItem where x.SubUnitCheckRectifyId == subUnitCheckRectifyId select x).ToList();
|
||||
if (q != null)
|
||||
{
|
||||
Funs.DB.Supervise_SubUnitCheckRectifyItem.DeleteAllOnSubmit(q);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="superviseCheckReportId"></param>
|
||||
public static void DeleteSubUnitCheckRectifyBySuperviseCheckReportId(string superviseCheckReportId)
|
||||
{
|
||||
var q = (from x in Funs.DB.Supervise_SubUnitCheckRectify where x.SuperviseCheckReportId == superviseCheckReportId select x);
|
||||
if (q.Count() > 0)
|
||||
{
|
||||
foreach (var item in q)
|
||||
{
|
||||
var subUnitCheckRectifyItem = from x in Funs.DB.Supervise_SubUnitCheckRectifyItem where x.SubUnitCheckRectifyId == item.SubUnitCheckRectifyId select x;
|
||||
if (subUnitCheckRectifyItem.Count() > 0)
|
||||
{
|
||||
Funs.DB.Supervise_SubUnitCheckRectifyItem.DeleteAllOnSubmit(subUnitCheckRectifyItem);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
Funs.DB.Supervise_SubUnitCheckRectify.DeleteOnSubmit(item);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,90 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
/// <summary>
|
||||
/// 监督评价报告
|
||||
/// </summary>
|
||||
public static class SubUnitCheckRectifyService
|
||||
{
|
||||
/// <summary>
|
||||
/// 根据安全监督检查报告id获取监督评价信息
|
||||
/// </summary>
|
||||
/// <param name="superviseCheckReportId"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.Supervise_SubUnitCheckRectify GetSubUnitCheckRectifyBySuperviseCheckReportId(string superviseCheckReportId)
|
||||
{
|
||||
return Funs.DB.Supervise_SubUnitCheckRectify.FirstOrDefault(e => e.SuperviseCheckReportId == superviseCheckReportId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键获取监督评价信息
|
||||
/// </summary>
|
||||
/// <param name="subUnitCheckRectifyId"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.Supervise_SubUnitCheckRectify GetSubUnitCheckRectifyById(string subUnitCheckRectifyId)
|
||||
{
|
||||
return Funs.DB.Supervise_SubUnitCheckRectify.FirstOrDefault(e => e.SubUnitCheckRectifyId == subUnitCheckRectifyId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加监督评价报告
|
||||
/// </summary>
|
||||
/// <param name="subUnitCheckRectify"></param>
|
||||
public static void AddSubUnitCheckRectify(Model.Supervise_SubUnitCheckRectify subUnitCheckRectify)
|
||||
{
|
||||
Model.Supervise_SubUnitCheckRectify newSubUnitCheckRectify = new Model.Supervise_SubUnitCheckRectify
|
||||
{
|
||||
SubUnitCheckRectifyId = subUnitCheckRectify.SubUnitCheckRectifyId,
|
||||
SuperviseCheckReportId = subUnitCheckRectify.SuperviseCheckReportId,
|
||||
UnitId = subUnitCheckRectify.UnitId,
|
||||
CheckRectType = subUnitCheckRectify.CheckRectType,
|
||||
Values1 = subUnitCheckRectify.Values1,
|
||||
Values2 = subUnitCheckRectify.Values2,
|
||||
Values3 = subUnitCheckRectify.Values3,
|
||||
Values4 = subUnitCheckRectify.Values4,
|
||||
Values5 = subUnitCheckRectify.Values5,
|
||||
Values6 = subUnitCheckRectify.Values6,
|
||||
Values7 = subUnitCheckRectify.Values7,
|
||||
Values8 = subUnitCheckRectify.Values8,
|
||||
AttachUrl = subUnitCheckRectify.AttachUrl,
|
||||
UpDateTime = subUnitCheckRectify.UpDateTime,
|
||||
CheckEndDate = subUnitCheckRectify.CheckEndDate,
|
||||
UpState = subUnitCheckRectify.UpState
|
||||
};
|
||||
Funs.DB.Supervise_SubUnitCheckRectify.InsertOnSubmit(newSubUnitCheckRectify);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改监督评价报告
|
||||
/// </summary>
|
||||
/// <param name="subUnitCheckRectify"></param>
|
||||
public static void UpdateSubUnitCheckRectify(Model.Supervise_SubUnitCheckRectify subUnitCheckRectify)
|
||||
{
|
||||
Model.Supervise_SubUnitCheckRectify newSubUnitCheckRectify = Funs.DB.Supervise_SubUnitCheckRectify.FirstOrDefault(e => e.SubUnitCheckRectifyId == subUnitCheckRectify.SubUnitCheckRectifyId);
|
||||
if (newSubUnitCheckRectify != null)
|
||||
{
|
||||
newSubUnitCheckRectify.UnitId = subUnitCheckRectify.UnitId;
|
||||
newSubUnitCheckRectify.CheckRectType = subUnitCheckRectify.CheckRectType;
|
||||
newSubUnitCheckRectify.Values1 = subUnitCheckRectify.Values1;
|
||||
newSubUnitCheckRectify.Values2 = subUnitCheckRectify.Values2;
|
||||
newSubUnitCheckRectify.Values3 = subUnitCheckRectify.Values3;
|
||||
newSubUnitCheckRectify.Values4 = subUnitCheckRectify.Values4;
|
||||
newSubUnitCheckRectify.Values5 = subUnitCheckRectify.Values5;
|
||||
newSubUnitCheckRectify.Values6 = subUnitCheckRectify.Values6;
|
||||
newSubUnitCheckRectify.Values7 = subUnitCheckRectify.Values7;
|
||||
newSubUnitCheckRectify.Values8 = subUnitCheckRectify.Values8;
|
||||
newSubUnitCheckRectify.AttachUrl = subUnitCheckRectify.AttachUrl;
|
||||
newSubUnitCheckRectify.UpDateTime = subUnitCheckRectify.UpDateTime;
|
||||
newSubUnitCheckRectify.UpState = subUnitCheckRectify.UpState;
|
||||
newSubUnitCheckRectify.CheckEndDate = subUnitCheckRectify.CheckEndDate;
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
/// <summary>
|
||||
/// 安全监督检查整改明细表
|
||||
/// </summary>
|
||||
public static class SuperviseCheckRectifyItemService
|
||||
{
|
||||
/// <summary>
|
||||
/// 根据主键获取安全监督检查整改明细信息
|
||||
/// </summary>
|
||||
/// <param name="superviseCheckRectifyItemId"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.Supervise_SuperviseCheckRectifyItem GetSuperviseCheckRectifyItemById(string superviseCheckRectifyItemId)
|
||||
{
|
||||
return Funs.DB.Supervise_SuperviseCheckRectifyItem.FirstOrDefault(e => e.SuperviseCheckRectifyItemId == superviseCheckRectifyItemId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据安全监督检查整改id获取所有相关明细信息
|
||||
/// </summary>
|
||||
/// <param name="superviseCheckRectifyId"></param>
|
||||
/// <returns></returns>
|
||||
public static List<Model.Supervise_SuperviseCheckRectifyItem> GetSuperviseCheckRectifyItemBySuperviseCheckRectifyId(string superviseCheckRectifyId)
|
||||
{
|
||||
return (from x in Funs.DB.Supervise_SuperviseCheckRectifyItem where x.SuperviseCheckRectifyId == superviseCheckRectifyId select x).ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加安全监督检查整改明细信息
|
||||
/// </summary>
|
||||
/// <param name="superviseCheckRectifyItem"></param>
|
||||
public static void AddSuperviseCheckRectifyItem(Model.Supervise_SuperviseCheckRectifyItem superviseCheckRectifyItem)
|
||||
{
|
||||
Model.Supervise_SuperviseCheckRectifyItem newSuperviseCheckRectifyItem = new Model.Supervise_SuperviseCheckRectifyItem
|
||||
{
|
||||
SuperviseCheckRectifyItemId = superviseCheckRectifyItem.SuperviseCheckRectifyItemId,
|
||||
SuperviseCheckRectifyId = superviseCheckRectifyItem.SuperviseCheckRectifyId,
|
||||
RectifyItemId = superviseCheckRectifyItem.RectifyItemId,
|
||||
ConfirmMan = superviseCheckRectifyItem.ConfirmMan,
|
||||
ConfirmDate = superviseCheckRectifyItem.ConfirmDate,
|
||||
OrderEndDate = superviseCheckRectifyItem.OrderEndDate,
|
||||
OrderEndPerson = superviseCheckRectifyItem.OrderEndPerson,
|
||||
RealEndDate = superviseCheckRectifyItem.RealEndDate,
|
||||
AttachUrl = superviseCheckRectifyItem.AttachUrl,
|
||||
VerifierName=superviseCheckRectifyItem.VerifierName,
|
||||
VerifierDate=superviseCheckRectifyItem.VerifierDate,
|
||||
};
|
||||
Funs.DB.Supervise_SuperviseCheckRectifyItem.InsertOnSubmit(newSuperviseCheckRectifyItem);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键删除安全监督检查整改明细信息
|
||||
/// </summary>
|
||||
/// <param name="superviseCheckRectifyItemId"></param>
|
||||
public static void DeleteSuperviseCheckRectifyItem(string superviseCheckRectifyItemId)
|
||||
{
|
||||
Model.Supervise_SuperviseCheckRectifyItem superviseCheckRectifyItem = Funs.DB.Supervise_SuperviseCheckRectifyItem.FirstOrDefault(e => e.SuperviseCheckRectifyItemId == superviseCheckRectifyItemId);
|
||||
if (superviseCheckRectifyItem != null)
|
||||
{
|
||||
Funs.DB.Supervise_SuperviseCheckRectifyItem.DeleteOnSubmit(superviseCheckRectifyItem);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据安全监督检查整改ID删除所有相关明细信息
|
||||
/// </summary>
|
||||
/// <param name="superviseCheckRectifyId"></param>
|
||||
public static void DeleteSuperviseCheckRectifyItemBySuperviseCheckRectifyId(string superviseCheckRectifyId)
|
||||
{
|
||||
var q = (from x in Funs.DB.Supervise_SuperviseCheckRectifyItem where x.SuperviseCheckRectifyId == superviseCheckRectifyId select x).ToList();
|
||||
if (q != null)
|
||||
{
|
||||
Funs.DB.Supervise_SuperviseCheckRectifyItem.DeleteAllOnSubmit(q);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,97 @@
|
||||
using System.Linq;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
/// <summary>
|
||||
/// 安全监督检查整改
|
||||
/// </summary>
|
||||
public static class SuperviseCheckRectifyService
|
||||
{
|
||||
/// <summary>
|
||||
/// 根据主键获取安全监督检查整改
|
||||
/// </summary>
|
||||
/// <param name="superviseCheckRectifyId"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.Supervise_SuperviseCheckRectify GetSuperviseCheckRectifyById(string superviseCheckRectifyId)
|
||||
{
|
||||
return Funs.DB.Supervise_SuperviseCheckRectify.FirstOrDefault(e => e.SuperviseCheckRectifyId == superviseCheckRectifyId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据检查报告id获取整改
|
||||
/// </summary>
|
||||
/// <param name="superviseCheckReportId"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.Supervise_SuperviseCheckRectify GetSuperviseCheckRectifyBySuperviseCheckReportId(string superviseCheckReportId)
|
||||
{
|
||||
return Funs.DB.Supervise_SuperviseCheckRectify.FirstOrDefault(e => e.SuperviseCheckReportId == superviseCheckReportId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加安全监督检查整改
|
||||
/// </summary>
|
||||
/// <param name="SuperviseCheckRectify"></param>
|
||||
public static void AddSuperviseCheckRectify(Model.Supervise_SuperviseCheckRectify superviseCheckRectify)
|
||||
{
|
||||
Model.Supervise_SuperviseCheckRectify newSuperviseCheckRectify = new Model.Supervise_SuperviseCheckRectify
|
||||
{
|
||||
SuperviseCheckRectifyId = superviseCheckRectify.SuperviseCheckRectifyId,
|
||||
SuperviseCheckRectifyCode = superviseCheckRectify.SuperviseCheckRectifyCode,
|
||||
ProjectId = superviseCheckRectify.ProjectId,
|
||||
UnitId = superviseCheckRectify.UnitId,
|
||||
CheckDate = superviseCheckRectify.CheckDate,
|
||||
IssueMan = superviseCheckRectify.IssueMan,
|
||||
IssueDate = superviseCheckRectify.IssueDate,
|
||||
SuperviseCheckReportId = superviseCheckRectify.SuperviseCheckReportId,
|
||||
HandleState = superviseCheckRectify.HandleState
|
||||
};
|
||||
Funs.DB.Supervise_SuperviseCheckRectify.InsertOnSubmit(newSuperviseCheckRectify);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改安全监督检查整改
|
||||
/// </summary>
|
||||
/// <param name="superviseCheckRectify"></param>
|
||||
public static void UpdateSuperviseCheckRectify(Model.Supervise_SuperviseCheckRectify superviseCheckRectify)
|
||||
{
|
||||
Model.Supervise_SuperviseCheckRectify newSuperviseCheckRectify = Funs.DB.Supervise_SuperviseCheckRectify.FirstOrDefault(e => e.SuperviseCheckRectifyId == superviseCheckRectify.SuperviseCheckRectifyId);
|
||||
if (newSuperviseCheckRectify != null)
|
||||
{
|
||||
newSuperviseCheckRectify.SuperviseCheckRectifyCode = superviseCheckRectify.SuperviseCheckRectifyCode;
|
||||
newSuperviseCheckRectify.ProjectId = superviseCheckRectify.ProjectId;
|
||||
newSuperviseCheckRectify.UnitId = superviseCheckRectify.UnitId;
|
||||
newSuperviseCheckRectify.CheckDate = superviseCheckRectify.CheckDate;
|
||||
newSuperviseCheckRectify.IssueMan = superviseCheckRectify.IssueMan;
|
||||
newSuperviseCheckRectify.IssueDate = superviseCheckRectify.IssueDate;
|
||||
newSuperviseCheckRectify.SuperviseCheckReportId = superviseCheckRectify.SuperviseCheckReportId;
|
||||
newSuperviseCheckRectify.HandleState = superviseCheckRectify.HandleState;
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键删除安全监督检查整改
|
||||
/// </summary>
|
||||
/// <param name="superviseCheckRectifyId"></param>
|
||||
public static void DeleteSuperviseCheckRectifyById(string superviseCheckRectifyId)
|
||||
{
|
||||
Model.Supervise_SuperviseCheckRectify superviseCheckRectify = Funs.DB.Supervise_SuperviseCheckRectify.FirstOrDefault(e => e.SuperviseCheckRectifyId == superviseCheckRectifyId);
|
||||
if (superviseCheckRectify != null)
|
||||
{
|
||||
var superviseCheckRectifys = from x in Funs.DB.Supervise_SuperviseCheckRectify where x.SuperviseCheckReportId == superviseCheckRectify.SuperviseCheckReportId select x;
|
||||
if (superviseCheckRectifys.Count() == 1)
|
||||
{
|
||||
var report = BLL.SuperviseCheckReportService.GetSuperviseCheckReportById(superviseCheckRectify.SuperviseCheckReportId);
|
||||
if (report != null)
|
||||
{
|
||||
report.IsIssued = null; //已下发
|
||||
BLL.SuperviseCheckReportService.UpdateSuperviseCheckReport(report);
|
||||
}
|
||||
}
|
||||
Funs.DB.Supervise_SuperviseCheckRectify.DeleteOnSubmit(superviseCheckRectify);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,90 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
/// <summary>
|
||||
/// 安全监督检查报告明细表
|
||||
/// </summary>
|
||||
public static class SuperviseCheckReportItemService
|
||||
{
|
||||
/// <summary>
|
||||
/// 根据主键获取安全监督检查报告明细信息
|
||||
/// </summary>
|
||||
/// <param name="superviseCheckReportItemId"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.Supervise_SuperviseCheckReportItem GetSuperviseCheckReportItemById(string superviseCheckReportItemId)
|
||||
{
|
||||
return Funs.DB.Supervise_SuperviseCheckReportItem.FirstOrDefault(e => e.SuperviseCheckReportItemId == superviseCheckReportItemId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据安全监督检查报告id获取所有相关明细信息
|
||||
/// </summary>
|
||||
/// <param name="superviseCheckReportId"></param>
|
||||
/// <returns></returns>
|
||||
public static List<Model.Supervise_SuperviseCheckReportItem> GetSuperviseCheckReportItemBySuperviseCheckReportId(string superviseCheckReportId)
|
||||
{
|
||||
return (from x in Funs.DB.Supervise_SuperviseCheckReportItem where x.SuperviseCheckReportId == superviseCheckReportId select x).ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据安全监督检查报告id获取所有选中的相关明细信息
|
||||
/// </summary>
|
||||
/// <param name="superviseCheckReportId"></param>
|
||||
/// <returns></returns>
|
||||
public static List<Model.Supervise_SuperviseCheckReportItem> GetSelectedSuperviseCheckReportItemBySuperviseCheckReportId(string superviseCheckReportId)
|
||||
{
|
||||
return (from x in Funs.DB.Supervise_SuperviseCheckReportItem where x.SuperviseCheckReportId == superviseCheckReportId && x.IsSelected == true select x).ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加安全监督检查报告明细信息
|
||||
/// </summary>
|
||||
/// <param name="superviseCheckReportItem"></param>
|
||||
public static void AddSuperviseCheckReportItem(Model.Supervise_SuperviseCheckReportItem superviseCheckReportItem)
|
||||
{
|
||||
Model.Supervise_SuperviseCheckReportItem newSuperviseCheckReportItem = new Model.Supervise_SuperviseCheckReportItem
|
||||
{
|
||||
SuperviseCheckReportItemId = superviseCheckReportItem.SuperviseCheckReportItemId,
|
||||
SuperviseCheckReportId = superviseCheckReportItem.SuperviseCheckReportId,
|
||||
RectifyItemId = superviseCheckReportItem.RectifyItemId,
|
||||
IsSelected = superviseCheckReportItem.IsSelected,
|
||||
AttachUrl = superviseCheckReportItem.AttachUrl
|
||||
};
|
||||
Funs.DB.Supervise_SuperviseCheckReportItem.InsertOnSubmit(newSuperviseCheckReportItem);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键删除安全监督检查报告明细信息
|
||||
/// </summary>
|
||||
/// <param name="superviseCheckReportItemId"></param>
|
||||
public static void DeleteSuperviseCheckReportItem(string superviseCheckReportItemId)
|
||||
{
|
||||
Model.Supervise_SuperviseCheckReportItem superviseCheckReportItem = Funs.DB.Supervise_SuperviseCheckReportItem.FirstOrDefault(e => e.SuperviseCheckReportItemId == superviseCheckReportItemId);
|
||||
if (superviseCheckReportItem != null)
|
||||
{
|
||||
Funs.DB.Supervise_SuperviseCheckReportItem.DeleteOnSubmit(superviseCheckReportItem);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据安全监督检查报告ID删除所有相关明细信息
|
||||
/// </summary>
|
||||
/// <param name="superviseCheckReportId"></param>
|
||||
public static void DeleteSuperviseCheckReportItemBySuperviseCheckReportId(string superviseCheckReportId)
|
||||
{
|
||||
var q = (from x in Funs.DB.Supervise_SuperviseCheckReportItem where x.SuperviseCheckReportId == superviseCheckReportId select x).ToList();
|
||||
if (q != null)
|
||||
{
|
||||
Funs.DB.Supervise_SuperviseCheckReportItem.DeleteAllOnSubmit(q);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
/// <summary>
|
||||
/// 安全监督检查报告表
|
||||
/// </summary>
|
||||
public static class SuperviseCheckReportService
|
||||
{
|
||||
/// <summary>
|
||||
/// 根据主键获取安全监督检查报告
|
||||
/// </summary>
|
||||
/// <param name="superviseCheckReportId"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.Supervise_SuperviseCheckReport GetSuperviseCheckReportById(string superviseCheckReportId)
|
||||
{
|
||||
return Funs.DB.Supervise_SuperviseCheckReport.FirstOrDefault(e => e.SuperviseCheckReportId == superviseCheckReportId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加安全监督检查报告
|
||||
/// </summary>
|
||||
/// <param name="superviseCheckReport"></param>
|
||||
public static void AddSuperviseCheckReport(Model.Supervise_SuperviseCheckReport superviseCheckReport)
|
||||
{
|
||||
Model.Supervise_SuperviseCheckReport newSuperviseCheckReport = new Model.Supervise_SuperviseCheckReport
|
||||
{
|
||||
SuperviseCheckReportId = superviseCheckReport.SuperviseCheckReportId,
|
||||
SuperviseCheckReportCode = superviseCheckReport.SuperviseCheckReportCode,
|
||||
CheckDate = superviseCheckReport.CheckDate,
|
||||
ProjectId = superviseCheckReport.ProjectId,
|
||||
UnitId = superviseCheckReport.UnitId,
|
||||
CheckTeam = superviseCheckReport.CheckTeam,
|
||||
EvaluationResult = superviseCheckReport.EvaluationResult,
|
||||
CheckType = superviseCheckReport.CheckType,
|
||||
AttachUrl = superviseCheckReport.AttachUrl,
|
||||
IsIssued = superviseCheckReport.IsIssued
|
||||
};
|
||||
Funs.DB.Supervise_SuperviseCheckReport.InsertOnSubmit(newSuperviseCheckReport);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改安全监督检查报告
|
||||
/// </summary>
|
||||
/// <param name="superviseCheckReport"></param>
|
||||
public static void UpdateSuperviseCheckReport(Model.Supervise_SuperviseCheckReport superviseCheckReport)
|
||||
{
|
||||
Model.Supervise_SuperviseCheckReport newSuperviseCheckReport = Funs.DB.Supervise_SuperviseCheckReport.FirstOrDefault(e => e.SuperviseCheckReportId == superviseCheckReport.SuperviseCheckReportId);
|
||||
if (newSuperviseCheckReport != null)
|
||||
{
|
||||
newSuperviseCheckReport.SuperviseCheckReportCode = superviseCheckReport.SuperviseCheckReportCode;
|
||||
newSuperviseCheckReport.CheckDate = superviseCheckReport.CheckDate;
|
||||
newSuperviseCheckReport.ProjectId = superviseCheckReport.ProjectId;
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键删除安全监督检查报告
|
||||
/// </summary>
|
||||
/// <param name="superviseCheckReportId"></param>
|
||||
public static void DeleteSuperviseCheckReportById(string superviseCheckReportId)
|
||||
{
|
||||
Model.Supervise_SuperviseCheckReport superviseCheckReport = Funs.DB.Supervise_SuperviseCheckReport.FirstOrDefault(e => e.SuperviseCheckReportId == superviseCheckReportId);
|
||||
if (superviseCheckReport != null)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(superviseCheckReport.AttachUrl))
|
||||
{
|
||||
BLL.UploadFileService.DeleteFile(Funs.RootPath, superviseCheckReport.AttachUrl);//删除附件
|
||||
}
|
||||
Funs.DB.Supervise_SuperviseCheckReport.DeleteOnSubmit(superviseCheckReport);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user