This commit is contained in:
2024-01-25 15:21:19 +08:00
commit 9b01a40341
10748 changed files with 2475848 additions and 0 deletions
+78
View File
@@ -0,0 +1,78 @@
using System.Linq;
namespace BLL
{
/// <summary>
/// 安全措施费使用计划
/// </summary>
public static class MeasuresPlanService
{
/// <summary>
/// 根据主键获取安全措施费使用计划
/// </summary>
/// <param name="measuresPlanId"></param>
/// <returns></returns>
public static Model.CostGoods_MeasuresPlan GetMeasuresPlanById(string measuresPlanId)
{
return Funs.DB.CostGoods_MeasuresPlan.FirstOrDefault(e => e.MeasuresPlanId == measuresPlanId);
}
/// <summary>
/// 添加安全措施费使用计划
/// </summary>
/// <param name="measuresPlan"></param>
public static void AddMeasuresPlan(Model.CostGoods_MeasuresPlan measuresPlan)
{
Model.CostGoods_MeasuresPlan newMeasuresPlan = new Model.CostGoods_MeasuresPlan
{
MeasuresPlanId = measuresPlan.MeasuresPlanId,
ProjectId = measuresPlan.ProjectId,
MeasuresPlanCode = measuresPlan.MeasuresPlanCode,
UnitId = measuresPlan.UnitId,
FileContents = measuresPlan.FileContents,
CompileMan = measuresPlan.CompileMan,
CompileDate = measuresPlan.CompileDate
};
Funs.DB.CostGoods_MeasuresPlan.InsertOnSubmit(newMeasuresPlan);
Funs.DB.SubmitChanges();
CodeRecordsService.InsertCodeRecordsByMenuIdProjectIdUnitId(Const.ProjectMeasuresPlanMenuId, measuresPlan.ProjectId, measuresPlan.UnitId, measuresPlan.MeasuresPlanId, measuresPlan.CompileDate);
}
/// <summary>
/// 修改安全措施费使用计划
/// </summary>
/// <param name="measuresPlan"></param>
public static void UpdateMeasuresPlan(Model.CostGoods_MeasuresPlan measuresPlan)
{
Model.CostGoods_MeasuresPlan newMeasuresPlan = Funs.DB.CostGoods_MeasuresPlan.FirstOrDefault(e => e.MeasuresPlanId == measuresPlan.MeasuresPlanId);
if (newMeasuresPlan != null)
{
newMeasuresPlan.ProjectId = measuresPlan.ProjectId;
newMeasuresPlan.MeasuresPlanCode = measuresPlan.MeasuresPlanCode;
newMeasuresPlan.UnitId = measuresPlan.UnitId;
newMeasuresPlan.FileContents = measuresPlan.FileContents;
newMeasuresPlan.CompileMan = measuresPlan.CompileMan;
newMeasuresPlan.CompileDate = measuresPlan.CompileDate;
Funs.DB.SubmitChanges();
}
}
/// <summary>
/// 根据主键删除安全措施费使用计划
/// </summary>
/// <param name="measuresPlanId"></param>
public static void DeleteMeasuresPlanById(string measuresPlanId)
{
Model.CostGoods_MeasuresPlan measuresPlan = Funs.DB.CostGoods_MeasuresPlan.FirstOrDefault(e => e.MeasuresPlanId == measuresPlanId);
if (measuresPlan != null)
{
CodeRecordsService.DeleteCodeRecordsByDataId(measuresPlanId);
CommonService.DeleteAttachFileById(measuresPlanId);
////删除审核流程表
BLL.CommonService.DeleteFlowOperateByID(measuresPlanId);
Funs.DB.CostGoods_MeasuresPlan.DeleteOnSubmit(measuresPlan);
Funs.DB.SubmitChanges();
}
}
}
}
@@ -0,0 +1,505 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BLL
{
public static class PayRegistrationService
{
/// <summary>
/// 根据主键获取安全费用投入登记
/// </summary>
/// <param name="payRegistrationId"></param>
/// <returns></returns>
public static Model.CostGoods_PayRegistration GetPayRegistrationById(string payRegistrationId)
{
return Funs.DB.CostGoods_PayRegistration.FirstOrDefault(e => e.PayRegistrationId == payRegistrationId);
}
/// <summary>
/// 获取当年费用小计
/// </summary>
/// <param name="paydate"></param>
/// <returns></returns>
public static List<Model.CostGoods_PayRegistration> GetPayRegistrationByYear(string projectId, DateTime paydate)
{
return (from x in Funs.DB.CostGoods_PayRegistration where x.ProjectId == projectId && x.PayDate.Value.Year == paydate.Year select x).ToList();
}
/// <summary>
/// 获取项目费用小计
/// </summary>
/// <param name="paydate"></param>
/// <returns></returns>
public static List<Model.CostGoods_PayRegistration> GetPayRegistrationTotal(string projectId, DateTime? date)
{
return (from x in Funs.DB.CostGoods_PayRegistration where x.ProjectId == projectId where x.PayDate <= date select x).ToList();
}
/// <summary>
/// 添加安全费用投入登记
/// </summary>
/// <param name="payRegistration"></param>
public static void AddPayRegistration(Model.CostGoods_PayRegistration payRegistration)
{
Model.CostGoods_PayRegistration newPayRegistration = new Model.CostGoods_PayRegistration();
newPayRegistration.PayRegistrationId = payRegistration.PayRegistrationId;
newPayRegistration.ProjectId = payRegistration.ProjectId;
newPayRegistration.UnitId = payRegistration.UnitId;
newPayRegistration.PayDate = payRegistration.PayDate;
newPayRegistration.State = payRegistration.State;
newPayRegistration.CompileMan = payRegistration.CompileMan;
newPayRegistration.CompileDate = payRegistration.CompileDate;
#region
newPayRegistration.SMonthType1_1 = payRegistration.SMonthType1_1;
newPayRegistration.SMainApproveType1_1 = payRegistration.SMainApproveType1_1;
newPayRegistration.SMonthType1_2 = payRegistration.SMonthType1_2;
newPayRegistration.SMainApproveType1_2 = payRegistration.SMainApproveType1_2;
newPayRegistration.SMonthType1_3 = payRegistration.SMonthType1_3;
newPayRegistration.SMainApproveType1_3 = payRegistration.SMainApproveType1_3;
newPayRegistration.SMonthType1_4 = payRegistration.SMonthType1_4;
newPayRegistration.SMainApproveType1_4 = payRegistration.SMainApproveType1_4;
newPayRegistration.SMonthType1_5 = payRegistration.SMonthType1_5;
newPayRegistration.SMainApproveType1_5 = payRegistration.SMainApproveType1_5;
newPayRegistration.SMonthType1_6 = payRegistration.SMonthType1_6;
newPayRegistration.SMainApproveType1_6 = payRegistration.SMainApproveType1_6;
newPayRegistration.SMonthType1_7 = payRegistration.SMonthType1_7;
newPayRegistration.SMainApproveType1_7 = payRegistration.SMainApproveType1_7;
newPayRegistration.SMonthType1_8 = payRegistration.SMonthType1_8;
newPayRegistration.SMainApproveType1_8 = payRegistration.SMainApproveType1_8;
newPayRegistration.SMonthType1_9 = payRegistration.SMonthType1_9;
newPayRegistration.SMainApproveType1_9 = payRegistration.SMainApproveType1_9;
newPayRegistration.SMonthType1_10 = payRegistration.SMonthType1_10;
newPayRegistration.SMainApproveType1_10 = payRegistration.SMainApproveType1_10;
newPayRegistration.SMonthType1_11 = payRegistration.SMonthType1_11;
newPayRegistration.SMainApproveType1_11 = payRegistration.SMainApproveType1_11;
newPayRegistration.SMonthType1_12 = payRegistration.SMonthType1_12;
newPayRegistration.SMainApproveType1_12 = payRegistration.SMainApproveType1_12;
newPayRegistration.SMonthType1_13 = payRegistration.SMonthType1_13;
newPayRegistration.SMainApproveType1_13 = payRegistration.SMainApproveType1_13;
newPayRegistration.SMonthType1_14 = payRegistration.SMonthType1_14;
newPayRegistration.SMainApproveType1_14 = payRegistration.SMainApproveType1_14;
newPayRegistration.SMonthType1_15 = payRegistration.SMonthType1_15;
newPayRegistration.SMainApproveType1_15 = payRegistration.SMainApproveType1_15;
newPayRegistration.SMonthType1_16 = payRegistration.SMonthType1_16;
newPayRegistration.SMainApproveType1_16 = payRegistration.SMainApproveType1_16;
newPayRegistration.SMonthType2_1 = payRegistration.SMonthType2_1;
newPayRegistration.SMainApproveType2_1 = payRegistration.SMainApproveType2_1;
newPayRegistration.SMonthType2_2 = payRegistration.SMonthType2_2;
newPayRegistration.SMainApproveType2_2 = payRegistration.SMainApproveType2_2;
newPayRegistration.SMonthType2_3 = payRegistration.SMonthType2_3;
newPayRegistration.SMainApproveType2_3 = payRegistration.SMainApproveType2_3;
newPayRegistration.SMonthType2_4 = payRegistration.SMonthType2_4;
newPayRegistration.SMainApproveType2_4 = payRegistration.SMainApproveType2_4;
newPayRegistration.SMonthType3_1 = payRegistration.SMonthType3_1;
newPayRegistration.SMainApproveType3_1 = payRegistration.SMainApproveType3_1;
newPayRegistration.SMonthType3_2 = payRegistration.SMonthType3_2;
newPayRegistration.SMainApproveType3_2 = payRegistration.SMainApproveType3_2;
newPayRegistration.SMonthType3_3 = payRegistration.SMonthType3_3;
newPayRegistration.SMainApproveType3_3 = payRegistration.SMainApproveType3_3;
newPayRegistration.SMonthType3_4 = payRegistration.SMonthType3_4;
newPayRegistration.SMainApproveType3_4 = payRegistration.SMainApproveType3_4;
newPayRegistration.SMonthType3_5 = payRegistration.SMonthType3_5;
newPayRegistration.SMainApproveType3_5 = payRegistration.SMainApproveType3_5;
newPayRegistration.SMonthType3_6 = payRegistration.SMonthType3_6;
newPayRegistration.SMainApproveType3_6 = payRegistration.SMainApproveType3_6;
newPayRegistration.SMonthType4_1 = payRegistration.SMonthType4_1;
newPayRegistration.SMainApproveType4_1 = payRegistration.SMainApproveType4_1;
newPayRegistration.SMonthType4_2 = payRegistration.SMonthType4_2;
newPayRegistration.SMainApproveType4_2 = payRegistration.SMainApproveType4_2;
newPayRegistration.SMonthType4_3 = payRegistration.SMonthType4_3;
newPayRegistration.SMainApproveType4_3 = payRegistration.SMainApproveType4_3;
newPayRegistration.SMonthType4_4 = payRegistration.SMonthType4_4;
newPayRegistration.SMainApproveType4_4 = payRegistration.SMainApproveType4_4;
newPayRegistration.SMonthType4_5 = payRegistration.SMonthType4_5;
newPayRegistration.SMainApproveType4_5 = payRegistration.SMainApproveType4_5;
newPayRegistration.SMonthType4_6 = payRegistration.SMonthType4_6;
newPayRegistration.SMainApproveType4_6 = payRegistration.SMainApproveType4_6;
newPayRegistration.SMonthType4_7 = payRegistration.SMonthType4_7;
newPayRegistration.SMainApproveType4_7 = payRegistration.SMainApproveType4_7;
newPayRegistration.SMonthType4_8 = payRegistration.SMonthType4_8;
newPayRegistration.SMainApproveType4_8 = payRegistration.SMainApproveType4_8;
newPayRegistration.SMonthType4_9 = payRegistration.SMonthType4_9;
newPayRegistration.SMainApproveType4_9 = payRegistration.SMainApproveType4_9;
newPayRegistration.SMonthType4_10 = payRegistration.SMonthType4_10;
newPayRegistration.SMainApproveType4_10 = payRegistration.SMainApproveType4_10;
newPayRegistration.SMonthType4_11 = payRegistration.SMonthType4_11;
newPayRegistration.SMainApproveType4_11 = payRegistration.SMainApproveType4_11;
newPayRegistration.SMonthType4_12 = payRegistration.SMonthType4_12;
newPayRegistration.SMainApproveType4_12 = payRegistration.SMainApproveType4_12;
newPayRegistration.SMonthType4_13 = payRegistration.SMonthType4_13;
newPayRegistration.SMainApproveType4_13 = payRegistration.SMainApproveType4_13;
newPayRegistration.SMonthType4_14 = payRegistration.SMonthType4_14;
newPayRegistration.SMainApproveType4_14 = payRegistration.SMainApproveType4_14;
newPayRegistration.SMonthType4_15 = payRegistration.SMonthType4_15;
newPayRegistration.SMainApproveType4_15 = payRegistration.SMainApproveType4_15;
newPayRegistration.SMonthType4_16 = payRegistration.SMonthType4_16;
newPayRegistration.SMainApproveType4_16 = payRegistration.SMainApproveType4_16;
newPayRegistration.SMonthType4_17 = payRegistration.SMonthType4_17;
newPayRegistration.SMainApproveType4_17 = payRegistration.SMainApproveType4_17;
newPayRegistration.SMonthType4_18 = payRegistration.SMonthType4_18;
newPayRegistration.SMainApproveType4_18 = payRegistration.SMainApproveType4_18;
newPayRegistration.SMonthType4_19 = payRegistration.SMonthType4_19;
newPayRegistration.SMainApproveType4_19 = payRegistration.SMainApproveType4_19;
newPayRegistration.SMonthType4_20 = payRegistration.SMonthType4_20;
newPayRegistration.SMainApproveType4_20 = payRegistration.SMainApproveType4_20;
newPayRegistration.SMonthType4_21 = payRegistration.SMonthType4_21;
newPayRegistration.SMainApproveType4_21 = payRegistration.SMainApproveType4_21;
newPayRegistration.SMonthType4_22 = payRegistration.SMonthType4_22;
newPayRegistration.SMainApproveType4_22 = payRegistration.SMainApproveType4_22;
newPayRegistration.SMonthType4_23 = payRegistration.SMonthType4_23;
newPayRegistration.SMainApproveType4_23 = payRegistration.SMainApproveType4_23;
newPayRegistration.SMonthType4_24 = payRegistration.SMonthType4_24;
newPayRegistration.SMainApproveType4_24 = payRegistration.SMainApproveType4_24;
newPayRegistration.SMonthType4_25 = payRegistration.SMonthType4_25;
newPayRegistration.SMainApproveType4_25 = payRegistration.SMainApproveType4_25;
newPayRegistration.SMonthType4_26 = payRegistration.SMonthType4_26;
newPayRegistration.SMainApproveType4_26 = payRegistration.SMainApproveType4_26;
newPayRegistration.SMonthType4_27 = payRegistration.SMonthType4_27;
newPayRegistration.SMainApproveType4_27 = payRegistration.SMainApproveType4_27;
newPayRegistration.SMonthType4_28 = payRegistration.SMonthType4_28;
newPayRegistration.SMainApproveType4_28 = payRegistration.SMainApproveType4_28;
newPayRegistration.SMonthType4_29 = payRegistration.SMonthType4_29;
newPayRegistration.SMainApproveType4_29 = payRegistration.SMainApproveType4_29;
newPayRegistration.SMonthType4_30 = payRegistration.SMonthType4_30;
newPayRegistration.SMainApproveType4_30 = payRegistration.SMainApproveType4_30;
newPayRegistration.SMonthType4_31 = payRegistration.SMonthType4_31;
newPayRegistration.SMainApproveType4_31 = payRegistration.SMainApproveType4_31;
newPayRegistration.SMonthType4_32 = payRegistration.SMonthType4_32;
newPayRegistration.SMainApproveType4_32 = payRegistration.SMainApproveType4_32;
newPayRegistration.SMonthType4_33 = payRegistration.SMonthType4_33;
newPayRegistration.SMainApproveType4_33 = payRegistration.SMainApproveType4_33;
newPayRegistration.SMonthType4_34 = payRegistration.SMonthType4_34;
newPayRegistration.SMainApproveType4_34 = payRegistration.SMainApproveType4_34;
newPayRegistration.SMonthType4_35 = payRegistration.SMonthType4_35;
newPayRegistration.SMainApproveType4_35 = payRegistration.SMainApproveType4_35;
newPayRegistration.SMonthType4_36 = payRegistration.SMonthType4_36;
newPayRegistration.SMainApproveType4_36 = payRegistration.SMainApproveType4_36;
newPayRegistration.SMonthType4_37 = payRegistration.SMonthType4_37;
newPayRegistration.SMainApproveType4_37 = payRegistration.SMainApproveType4_37;
newPayRegistration.SMonthType4_38 = payRegistration.SMonthType4_38;
newPayRegistration.SMainApproveType4_38 = payRegistration.SMainApproveType4_38;
newPayRegistration.SMonthType4_39 = payRegistration.SMonthType4_39;
newPayRegistration.SMainApproveType4_39 = payRegistration.SMainApproveType4_39;
newPayRegistration.SMonthType4_40 = payRegistration.SMonthType4_40;
newPayRegistration.SMainApproveType4_40 = payRegistration.SMainApproveType4_40;
newPayRegistration.SMonthType5_1 = payRegistration.SMonthType5_1;
newPayRegistration.SMainApproveType5_1 = payRegistration.SMainApproveType5_1;
newPayRegistration.SMonthType5_2 = payRegistration.SMonthType5_2;
newPayRegistration.SMainApproveType5_2 = payRegistration.SMainApproveType5_2;
newPayRegistration.SMonthType5_3 = payRegistration.SMonthType5_3;
newPayRegistration.SMainApproveType5_3 = payRegistration.SMainApproveType5_3;
newPayRegistration.SMonthType5_4 = payRegistration.SMonthType5_4;
newPayRegistration.SMainApproveType5_4 = payRegistration.SMainApproveType5_4;
newPayRegistration.SMonthType5_5 = payRegistration.SMonthType5_5;
newPayRegistration.SMainApproveType5_5 = payRegistration.SMainApproveType5_5;
newPayRegistration.SMonthType5_6 = payRegistration.SMonthType5_6;
newPayRegistration.SMainApproveType5_6 = payRegistration.SMainApproveType5_6;
newPayRegistration.SMonthType6_1 = payRegistration.SMonthType6_1;
newPayRegistration.SMainApproveType6_1 = payRegistration.SMainApproveType6_1;
newPayRegistration.SMonthType6_2 = payRegistration.SMonthType6_2;
newPayRegistration.SMainApproveType6_2 = payRegistration.SMainApproveType6_2;
newPayRegistration.SMonthType6_3 = payRegistration.SMonthType6_3;
newPayRegistration.SMainApproveType6_3 = payRegistration.SMainApproveType6_3;
newPayRegistration.TMonthType1_1 = payRegistration.TMonthType1_1;
newPayRegistration.TMainApproveType1_1 = payRegistration.TMainApproveType1_1;
newPayRegistration.TMonthType1_2 = payRegistration.TMonthType1_2;
newPayRegistration.TMainApproveType1_2 = payRegistration.TMainApproveType1_2;
newPayRegistration.TMonthType1_3 = payRegistration.TMonthType1_3;
newPayRegistration.TMainApproveType1_3 = payRegistration.TMainApproveType1_3;
newPayRegistration.TMonthType1_4 = payRegistration.TMonthType1_4;
newPayRegistration.TMainApproveType1_4 = payRegistration.TMainApproveType1_4;
newPayRegistration.TMonthType1_5 = payRegistration.TMonthType1_5;
newPayRegistration.TMainApproveType1_5 = payRegistration.TMainApproveType1_5;
newPayRegistration.TMonthType1_6 = payRegistration.TMonthType1_6;
newPayRegistration.TMainApproveType1_6 = payRegistration.TMainApproveType1_6;
newPayRegistration.TMonthType1_7 = payRegistration.TMonthType1_7;
newPayRegistration.TMainApproveType1_7 = payRegistration.TMainApproveType1_7;
newPayRegistration.TMonthType1_8 = payRegistration.TMonthType1_8;
newPayRegistration.TMainApproveType1_8 = payRegistration.TMainApproveType1_8;
newPayRegistration.TMonthType1_9 = payRegistration.TMonthType1_9;
newPayRegistration.TMainApproveType1_9 = payRegistration.TMainApproveType1_9;
newPayRegistration.TMonthType1_10 = payRegistration.TMonthType1_10;
newPayRegistration.TMainApproveType1_10 = payRegistration.TMainApproveType1_10;
newPayRegistration.TMonthType1_11 = payRegistration.TMonthType1_11;
newPayRegistration.TMainApproveType1_11 = payRegistration.TMainApproveType1_11;
newPayRegistration.TMonthType2_1 = payRegistration.TMonthType2_1;
newPayRegistration.TMainApproveType2_1 = payRegistration.TMainApproveType2_1;
newPayRegistration.TMonthType2_2 = payRegistration.TMonthType2_2;
newPayRegistration.TMainApproveType2_2 = payRegistration.TMainApproveType2_2;
newPayRegistration.TMonthType2_3 = payRegistration.TMonthType2_3;
newPayRegistration.TMainApproveType2_3 = payRegistration.TMainApproveType2_3;
newPayRegistration.TMonthType2_4 = payRegistration.TMonthType2_4;
newPayRegistration.TMainApproveType2_4 = payRegistration.TMainApproveType2_4;
newPayRegistration.TMonthType2_5 = payRegistration.TMonthType2_5;
newPayRegistration.TMainApproveType2_5 = payRegistration.TMainApproveType2_5;
newPayRegistration.TMonthType2_6 = payRegistration.TMonthType2_6;
newPayRegistration.TMainApproveType2_6 = payRegistration.TMainApproveType2_6;
newPayRegistration.TMonthType2_7 = payRegistration.TMonthType2_7;
newPayRegistration.TMainApproveType2_7 = payRegistration.TMainApproveType2_7;
newPayRegistration.TMonthType2_8 = payRegistration.TMonthType2_8;
newPayRegistration.TMainApproveType2_8 = payRegistration.TMainApproveType2_8;
newPayRegistration.TMonthType2_9 = payRegistration.TMonthType2_9;
newPayRegistration.TMainApproveType2_9 = payRegistration.TMainApproveType2_9;
#endregion
Funs.DB.CostGoods_PayRegistration.InsertOnSubmit(newPayRegistration);
Funs.DB.SubmitChanges();
}
/// <summary>
/// 修改安全费用投入登记
/// </summary>
/// <param name="payRegistration"></param>
public static void UpdatePayRegistration(Model.CostGoods_PayRegistration payRegistration)
{
Model.CostGoods_PayRegistration newPayRegistration = Funs.DB.CostGoods_PayRegistration.FirstOrDefault(e => e.PayRegistrationId == payRegistration.PayRegistrationId);
if (newPayRegistration != null)
{
newPayRegistration.ProjectId = payRegistration.ProjectId;
newPayRegistration.UnitId = payRegistration.UnitId;
newPayRegistration.PayDate = payRegistration.PayDate;
newPayRegistration.State = payRegistration.State;
newPayRegistration.CompileMan = payRegistration.CompileMan;
newPayRegistration.CompileDate = payRegistration.CompileDate;
#region
newPayRegistration.SMonthType1_1 = payRegistration.SMonthType1_1;
newPayRegistration.SMainApproveType1_1 = payRegistration.SMainApproveType1_1;
newPayRegistration.SMonthType1_2 = payRegistration.SMonthType1_2;
newPayRegistration.SMainApproveType1_2 = payRegistration.SMainApproveType1_2;
newPayRegistration.SMonthType1_3 = payRegistration.SMonthType1_3;
newPayRegistration.SMainApproveType1_3 = payRegistration.SMainApproveType1_3;
newPayRegistration.SMonthType1_4 = payRegistration.SMonthType1_4;
newPayRegistration.SMainApproveType1_4 = payRegistration.SMainApproveType1_4;
newPayRegistration.SMonthType1_5 = payRegistration.SMonthType1_5;
newPayRegistration.SMainApproveType1_5 = payRegistration.SMainApproveType1_5;
newPayRegistration.SMonthType1_6 = payRegistration.SMonthType1_6;
newPayRegistration.SMainApproveType1_6 = payRegistration.SMainApproveType1_6;
newPayRegistration.SMonthType1_7 = payRegistration.SMonthType1_7;
newPayRegistration.SMainApproveType1_7 = payRegistration.SMainApproveType1_7;
newPayRegistration.SMonthType1_8 = payRegistration.SMonthType1_8;
newPayRegistration.SMainApproveType1_8 = payRegistration.SMainApproveType1_8;
newPayRegistration.SMonthType1_9 = payRegistration.SMonthType1_9;
newPayRegistration.SMainApproveType1_9 = payRegistration.SMainApproveType1_9;
newPayRegistration.SMonthType1_10 = payRegistration.SMonthType1_10;
newPayRegistration.SMainApproveType1_10 = payRegistration.SMainApproveType1_10;
newPayRegistration.SMonthType1_11 = payRegistration.SMonthType1_11;
newPayRegistration.SMainApproveType1_11 = payRegistration.SMainApproveType1_11;
newPayRegistration.SMonthType1_12 = payRegistration.SMonthType1_12;
newPayRegistration.SMainApproveType1_12 = payRegistration.SMainApproveType1_12;
newPayRegistration.SMonthType1_13 = payRegistration.SMonthType1_13;
newPayRegistration.SMainApproveType1_13 = payRegistration.SMainApproveType1_13;
newPayRegistration.SMonthType1_14 = payRegistration.SMonthType1_14;
newPayRegistration.SMainApproveType1_14 = payRegistration.SMainApproveType1_14;
newPayRegistration.SMonthType1_15 = payRegistration.SMonthType1_15;
newPayRegistration.SMainApproveType1_15 = payRegistration.SMainApproveType1_15;
newPayRegistration.SMonthType1_16 = payRegistration.SMonthType1_16;
newPayRegistration.SMainApproveType1_16 = payRegistration.SMainApproveType1_16;
newPayRegistration.SMonthType2_1 = payRegistration.SMonthType2_1;
newPayRegistration.SMainApproveType2_1 = payRegistration.SMainApproveType2_1;
newPayRegistration.SMonthType2_2 = payRegistration.SMonthType2_2;
newPayRegistration.SMainApproveType2_2 = payRegistration.SMainApproveType2_2;
newPayRegistration.SMonthType2_3 = payRegistration.SMonthType2_3;
newPayRegistration.SMainApproveType2_3 = payRegistration.SMainApproveType2_3;
newPayRegistration.SMonthType2_4 = payRegistration.SMonthType2_4;
newPayRegistration.SMainApproveType2_4 = payRegistration.SMainApproveType2_4;
newPayRegistration.SMonthType3_1 = payRegistration.SMonthType3_1;
newPayRegistration.SMainApproveType3_1 = payRegistration.SMainApproveType3_1;
newPayRegistration.SMonthType3_2 = payRegistration.SMonthType3_2;
newPayRegistration.SMainApproveType3_2 = payRegistration.SMainApproveType3_2;
newPayRegistration.SMonthType3_3 = payRegistration.SMonthType3_3;
newPayRegistration.SMainApproveType3_3 = payRegistration.SMainApproveType3_3;
newPayRegistration.SMonthType3_4 = payRegistration.SMonthType3_4;
newPayRegistration.SMainApproveType3_4 = payRegistration.SMainApproveType3_4;
newPayRegistration.SMonthType3_5 = payRegistration.SMonthType3_5;
newPayRegistration.SMainApproveType3_5 = payRegistration.SMainApproveType3_5;
newPayRegistration.SMonthType3_6 = payRegistration.SMonthType3_6;
newPayRegistration.SMainApproveType3_6 = payRegistration.SMainApproveType3_6;
newPayRegistration.SMonthType4_1 = payRegistration.SMonthType4_1;
newPayRegistration.SMainApproveType4_1 = payRegistration.SMainApproveType4_1;
newPayRegistration.SMonthType4_2 = payRegistration.SMonthType4_2;
newPayRegistration.SMainApproveType4_2 = payRegistration.SMainApproveType4_2;
newPayRegistration.SMonthType4_3 = payRegistration.SMonthType4_3;
newPayRegistration.SMainApproveType4_3 = payRegistration.SMainApproveType4_3;
newPayRegistration.SMonthType4_4 = payRegistration.SMonthType4_4;
newPayRegistration.SMainApproveType4_4 = payRegistration.SMainApproveType4_4;
newPayRegistration.SMonthType4_5 = payRegistration.SMonthType4_5;
newPayRegistration.SMainApproveType4_5 = payRegistration.SMainApproveType4_5;
newPayRegistration.SMonthType4_6 = payRegistration.SMonthType4_6;
newPayRegistration.SMainApproveType4_6 = payRegistration.SMainApproveType4_6;
newPayRegistration.SMonthType4_7 = payRegistration.SMonthType4_7;
newPayRegistration.SMainApproveType4_7 = payRegistration.SMainApproveType4_7;
newPayRegistration.SMonthType4_8 = payRegistration.SMonthType4_8;
newPayRegistration.SMainApproveType4_8 = payRegistration.SMainApproveType4_8;
newPayRegistration.SMonthType4_9 = payRegistration.SMonthType4_9;
newPayRegistration.SMainApproveType4_9 = payRegistration.SMainApproveType4_9;
newPayRegistration.SMonthType4_10 = payRegistration.SMonthType4_10;
newPayRegistration.SMainApproveType4_10 = payRegistration.SMainApproveType4_10;
newPayRegistration.SMonthType4_11 = payRegistration.SMonthType4_11;
newPayRegistration.SMainApproveType4_11 = payRegistration.SMainApproveType4_11;
newPayRegistration.SMonthType4_12 = payRegistration.SMonthType4_12;
newPayRegistration.SMainApproveType4_12 = payRegistration.SMainApproveType4_12;
newPayRegistration.SMonthType4_13 = payRegistration.SMonthType4_13;
newPayRegistration.SMainApproveType4_13 = payRegistration.SMainApproveType4_13;
newPayRegistration.SMonthType4_14 = payRegistration.SMonthType4_14;
newPayRegistration.SMainApproveType4_14 = payRegistration.SMainApproveType4_14;
newPayRegistration.SMonthType4_15 = payRegistration.SMonthType4_15;
newPayRegistration.SMainApproveType4_15 = payRegistration.SMainApproveType4_15;
newPayRegistration.SMonthType4_16 = payRegistration.SMonthType4_16;
newPayRegistration.SMainApproveType4_16 = payRegistration.SMainApproveType4_16;
newPayRegistration.SMonthType4_17 = payRegistration.SMonthType4_17;
newPayRegistration.SMainApproveType4_17 = payRegistration.SMainApproveType4_17;
newPayRegistration.SMonthType4_18 = payRegistration.SMonthType4_18;
newPayRegistration.SMainApproveType4_18 = payRegistration.SMainApproveType4_18;
newPayRegistration.SMonthType4_19 = payRegistration.SMonthType4_19;
newPayRegistration.SMainApproveType4_19 = payRegistration.SMainApproveType4_19;
newPayRegistration.SMonthType4_20 = payRegistration.SMonthType4_20;
newPayRegistration.SMainApproveType4_20 = payRegistration.SMainApproveType4_20;
newPayRegistration.SMonthType4_21 = payRegistration.SMonthType4_21;
newPayRegistration.SMainApproveType4_21 = payRegistration.SMainApproveType4_21;
newPayRegistration.SMonthType4_22 = payRegistration.SMonthType4_22;
newPayRegistration.SMainApproveType4_22 = payRegistration.SMainApproveType4_22;
newPayRegistration.SMonthType4_23 = payRegistration.SMonthType4_23;
newPayRegistration.SMainApproveType4_23 = payRegistration.SMainApproveType4_23;
newPayRegistration.SMonthType4_24 = payRegistration.SMonthType4_24;
newPayRegistration.SMainApproveType4_24 = payRegistration.SMainApproveType4_24;
newPayRegistration.SMonthType4_25 = payRegistration.SMonthType4_25;
newPayRegistration.SMainApproveType4_25 = payRegistration.SMainApproveType4_25;
newPayRegistration.SMonthType4_26 = payRegistration.SMonthType4_26;
newPayRegistration.SMainApproveType4_26 = payRegistration.SMainApproveType4_26;
newPayRegistration.SMonthType4_27 = payRegistration.SMonthType4_27;
newPayRegistration.SMainApproveType4_27 = payRegistration.SMainApproveType4_27;
newPayRegistration.SMonthType4_28 = payRegistration.SMonthType4_28;
newPayRegistration.SMainApproveType4_28 = payRegistration.SMainApproveType4_28;
newPayRegistration.SMonthType4_29 = payRegistration.SMonthType4_29;
newPayRegistration.SMainApproveType4_29 = payRegistration.SMainApproveType4_29;
newPayRegistration.SMonthType4_30 = payRegistration.SMonthType4_30;
newPayRegistration.SMainApproveType4_30 = payRegistration.SMainApproveType4_30;
newPayRegistration.SMonthType4_31 = payRegistration.SMonthType4_31;
newPayRegistration.SMainApproveType4_31 = payRegistration.SMainApproveType4_31;
newPayRegistration.SMonthType4_32 = payRegistration.SMonthType4_32;
newPayRegistration.SMainApproveType4_32 = payRegistration.SMainApproveType4_32;
newPayRegistration.SMonthType4_33 = payRegistration.SMonthType4_33;
newPayRegistration.SMainApproveType4_33 = payRegistration.SMainApproveType4_33;
newPayRegistration.SMonthType4_34 = payRegistration.SMonthType4_34;
newPayRegistration.SMainApproveType4_34 = payRegistration.SMainApproveType4_34;
newPayRegistration.SMonthType4_35 = payRegistration.SMonthType4_35;
newPayRegistration.SMainApproveType4_35 = payRegistration.SMainApproveType4_35;
newPayRegistration.SMonthType4_36 = payRegistration.SMonthType4_36;
newPayRegistration.SMainApproveType4_36 = payRegistration.SMainApproveType4_36;
newPayRegistration.SMonthType4_37 = payRegistration.SMonthType4_37;
newPayRegistration.SMainApproveType4_37 = payRegistration.SMainApproveType4_37;
newPayRegistration.SMonthType4_38 = payRegistration.SMonthType4_38;
newPayRegistration.SMainApproveType4_38 = payRegistration.SMainApproveType4_38;
newPayRegistration.SMonthType4_39 = payRegistration.SMonthType4_39;
newPayRegistration.SMainApproveType4_39 = payRegistration.SMainApproveType4_39;
newPayRegistration.SMonthType4_40 = payRegistration.SMonthType4_40;
newPayRegistration.SMainApproveType4_40 = payRegistration.SMainApproveType4_40;
newPayRegistration.SMonthType5_1 = payRegistration.SMonthType5_1;
newPayRegistration.SMainApproveType5_1 = payRegistration.SMainApproveType5_1;
newPayRegistration.SMonthType5_2 = payRegistration.SMonthType5_2;
newPayRegistration.SMainApproveType5_2 = payRegistration.SMainApproveType5_2;
newPayRegistration.SMonthType5_3 = payRegistration.SMonthType5_3;
newPayRegistration.SMainApproveType5_3 = payRegistration.SMainApproveType5_3;
newPayRegistration.SMonthType5_4 = payRegistration.SMonthType5_4;
newPayRegistration.SMainApproveType5_4 = payRegistration.SMainApproveType5_4;
newPayRegistration.SMonthType5_5 = payRegistration.SMonthType5_5;
newPayRegistration.SMainApproveType5_5 = payRegistration.SMainApproveType5_5;
newPayRegistration.SMonthType5_6 = payRegistration.SMonthType5_6;
newPayRegistration.SMainApproveType5_6 = payRegistration.SMainApproveType5_6;
newPayRegistration.SMonthType6_1 = payRegistration.SMonthType6_1;
newPayRegistration.SMainApproveType6_1 = payRegistration.SMainApproveType6_1;
newPayRegistration.SMonthType6_2 = payRegistration.SMonthType6_2;
newPayRegistration.SMainApproveType6_2 = payRegistration.SMainApproveType6_2;
newPayRegistration.SMonthType6_3 = payRegistration.SMonthType6_3;
newPayRegistration.SMainApproveType6_3 = payRegistration.SMainApproveType6_3;
newPayRegistration.TMonthType1_1 = payRegistration.TMonthType1_1;
newPayRegistration.TMainApproveType1_1 = payRegistration.TMainApproveType1_1;
newPayRegistration.TMonthType1_2 = payRegistration.TMonthType1_2;
newPayRegistration.TMainApproveType1_2 = payRegistration.TMainApproveType1_2;
newPayRegistration.TMonthType1_3 = payRegistration.TMonthType1_3;
newPayRegistration.TMainApproveType1_3 = payRegistration.TMainApproveType1_3;
newPayRegistration.TMonthType1_4 = payRegistration.TMonthType1_4;
newPayRegistration.TMainApproveType1_4 = payRegistration.TMainApproveType1_4;
newPayRegistration.TMonthType1_5 = payRegistration.TMonthType1_5;
newPayRegistration.TMainApproveType1_5 = payRegistration.TMainApproveType1_5;
newPayRegistration.TMonthType1_6 = payRegistration.TMonthType1_6;
newPayRegistration.TMainApproveType1_6 = payRegistration.TMainApproveType1_6;
newPayRegistration.TMonthType1_7 = payRegistration.TMonthType1_7;
newPayRegistration.TMainApproveType1_7 = payRegistration.TMainApproveType1_7;
newPayRegistration.TMonthType1_8 = payRegistration.TMonthType1_8;
newPayRegistration.TMainApproveType1_8 = payRegistration.TMainApproveType1_8;
newPayRegistration.TMonthType1_9 = payRegistration.TMonthType1_9;
newPayRegistration.TMainApproveType1_9 = payRegistration.TMainApproveType1_9;
newPayRegistration.TMonthType1_10 = payRegistration.TMonthType1_10;
newPayRegistration.TMainApproveType1_10 = payRegistration.TMainApproveType1_10;
newPayRegistration.TMonthType1_11 = payRegistration.TMonthType1_11;
newPayRegistration.TMainApproveType1_11 = payRegistration.TMainApproveType1_11;
newPayRegistration.TMonthType2_1 = payRegistration.TMonthType2_1;
newPayRegistration.TMainApproveType2_1 = payRegistration.TMainApproveType2_1;
newPayRegistration.TMonthType2_2 = payRegistration.TMonthType2_2;
newPayRegistration.TMainApproveType2_2 = payRegistration.TMainApproveType2_2;
newPayRegistration.TMonthType2_3 = payRegistration.TMonthType2_3;
newPayRegistration.TMainApproveType2_3 = payRegistration.TMainApproveType2_3;
newPayRegistration.TMonthType2_4 = payRegistration.TMonthType2_4;
newPayRegistration.TMainApproveType2_4 = payRegistration.TMainApproveType2_4;
newPayRegistration.TMonthType2_5 = payRegistration.TMonthType2_5;
newPayRegistration.TMainApproveType2_5 = payRegistration.TMainApproveType2_5;
newPayRegistration.TMonthType2_6 = payRegistration.TMonthType2_6;
newPayRegistration.TMainApproveType2_6 = payRegistration.TMainApproveType2_6;
newPayRegistration.TMonthType2_7 = payRegistration.TMonthType2_7;
newPayRegistration.TMainApproveType2_7 = payRegistration.TMainApproveType2_7;
newPayRegistration.TMonthType2_8 = payRegistration.TMonthType2_8;
newPayRegistration.TMainApproveType2_8 = payRegistration.TMainApproveType2_8;
newPayRegistration.TMonthType2_9 = payRegistration.TMonthType2_9;
newPayRegistration.TMainApproveType2_9 = payRegistration.TMainApproveType2_9;
#endregion
Funs.DB.SubmitChanges();
}
}
/// <summary>
/// 根据主键删除安全费用投入登记
/// </summary>
/// <param name="payRegistrationId"></param>
public static void DeletePayRegistrationById(string payRegistrationId)
{
Model.CostGoods_PayRegistration payRegistration = Funs.DB.CostGoods_PayRegistration.FirstOrDefault(e => e.PayRegistrationId == payRegistrationId);
if (payRegistration != null)
{
CommonService.DeleteFlowOperateByID(payRegistrationId);
Funs.DB.CostGoods_PayRegistration.DeleteOnSubmit(payRegistration);
Funs.DB.SubmitChanges();
}
}
/// <summary>
/// 根据时间、项目获取五环安全费用投入登记信息
/// </summary>
/// <param name="startTime"></param>
/// <param name="endTime"></param>
/// <param name="projectId"></param>
/// <returns></returns>
public static List<Model.CostGoods_PayRegistration> GetPayRegistrationByPayDate(DateTime startTime, DateTime endTime, string projectId,string unitId)
{
return (from x in Funs.DB.CostGoods_PayRegistration where x.PayDate >= startTime && x.PayDate <= endTime && x.ProjectId == projectId && x.UnitId == unitId select x).ToList();
}
/// <summary>
/// 根据时间、项目获取施工分包商安全费用投入登记信息
/// </summary>
/// <param name="startTime"></param>
/// <param name="endTime"></param>
/// <param name="projectId"></param>
/// <returns></returns>
public static List<Model.CostGoods_PayRegistration> GetConPayRegistrationByPayDate(DateTime startTime, DateTime endTime, string projectId)
{
return (from x in Funs.DB.CostGoods_PayRegistration
join y in Funs.DB.Base_Unit on x.UnitId equals y.UnitId
where x.PayDate >= startTime && x.PayDate <= endTime && x.ProjectId == projectId
&& y.UnitTypeId == BLL.Const.UnitId_Con
select x).ToList();
}
}
}
@@ -0,0 +1,260 @@
using System;
using System.Collections.Generic;
using System.Linq;
namespace BLL
{
/// <summary>
/// 安全费用投入登记
/// </summary>
public static class SubPayRegistrationService
{
/// <summary>
/// 根据主键获取分包商安全费用投入登记
/// </summary>
/// <param name="subPayRegistrationId"></param>
/// <returns></returns>
public static Model.CostGoods_SubPayRegistration GetSubPayRegistrationById(string subPayRegistrationId)
{
return Funs.DB.CostGoods_SubPayRegistration.FirstOrDefault(e => e.SubPayRegistrationId == subPayRegistrationId);
}
/// <summary>
/// 获取当年费用小计
/// </summary>
/// <param name="subPaydate"></param>
/// <returns></returns>
public static List<Model.CostGoods_SubPayRegistration> GetSubPayRegistrationByYear(string projectId, DateTime subPaydate)
{
return (from x in Funs.DB.CostGoods_SubPayRegistration where x.ProjectId == projectId && x.PayDate.Value.Year == subPaydate.Year select x).ToList();
}
/// <summary>
/// 获取项目费用小计
/// </summary>
/// <param name="subPaydate"></param>
/// <returns></returns>
public static List<Model.CostGoods_SubPayRegistration> GetSubPayRegistrationTotal(string projectId)
{
return (from x in Funs.DB.CostGoods_SubPayRegistration where x.ProjectId == projectId select x).ToList();
}
/// <summary>
/// 添加分包商安全费用投入登记
/// </summary>
/// <param name="subPayRegistration"></param>
public static void AddSubPayRegistration(Model.CostGoods_SubPayRegistration subPayRegistration)
{
Model.CostGoods_SubPayRegistration newSubPayRegistration = new Model.CostGoods_SubPayRegistration();
newSubPayRegistration.SubPayRegistrationId = subPayRegistration.SubPayRegistrationId;
newSubPayRegistration.ProjectId = subPayRegistration.ProjectId;
newSubPayRegistration.UnitId = subPayRegistration.UnitId;
newSubPayRegistration.PayDate = subPayRegistration.PayDate;
newSubPayRegistration.ContractNum = subPayRegistration.ContractNum;
newSubPayRegistration.State = subPayRegistration.State;
newSubPayRegistration.CompileMan = subPayRegistration.CompileMan;
newSubPayRegistration.CompileDate = subPayRegistration.CompileDate;
newSubPayRegistration.SMonthType1 = subPayRegistration.SMonthType1;
newSubPayRegistration.SMainApproveType1 = subPayRegistration.SMainApproveType1;
newSubPayRegistration.SMonthType2 = subPayRegistration.SMonthType2;
newSubPayRegistration.SMainApproveType2 = subPayRegistration.SMainApproveType2;
newSubPayRegistration.SMonthType3 = subPayRegistration.SMonthType3;
newSubPayRegistration.SMainApproveType3 = subPayRegistration.SMainApproveType3;
newSubPayRegistration.SMonthType4 = subPayRegistration.SMonthType4;
newSubPayRegistration.SMainApproveType4 = subPayRegistration.SMainApproveType4;
newSubPayRegistration.SMonthType5 = subPayRegistration.SMonthType5;
newSubPayRegistration.SMainApproveType5 = subPayRegistration.SMainApproveType5;
newSubPayRegistration.SMonthType6 = subPayRegistration.SMonthType6;
newSubPayRegistration.SMainApproveType6 = subPayRegistration.SMainApproveType6;
newSubPayRegistration.SMonthType7 = subPayRegistration.SMonthType7;
newSubPayRegistration.SMainApproveType7 = subPayRegistration.SMainApproveType7;
newSubPayRegistration.SMonthType8 = subPayRegistration.SMonthType8;
newSubPayRegistration.SMainApproveType8 = subPayRegistration.SMainApproveType8;
newSubPayRegistration.SMonthType9 = subPayRegistration.SMonthType9;
newSubPayRegistration.SMainApproveType9 = subPayRegistration.SMainApproveType9;
newSubPayRegistration.SMonthType10 = subPayRegistration.SMonthType10;
newSubPayRegistration.SMainApproveType10 = subPayRegistration.SMainApproveType10;
newSubPayRegistration.SMonthType11 = subPayRegistration.SMonthType11;
newSubPayRegistration.SMainApproveType11 = subPayRegistration.SMainApproveType11;
newSubPayRegistration.SMonthType12 = subPayRegistration.SMonthType12;
newSubPayRegistration.SMainApproveType12 = subPayRegistration.SMainApproveType12;
newSubPayRegistration.SMonthType13 = subPayRegistration.SMonthType13;
newSubPayRegistration.SMainApproveType13 = subPayRegistration.SMainApproveType13;
newSubPayRegistration.SMonthType14 = subPayRegistration.SMonthType14;
newSubPayRegistration.SMainApproveType14 = subPayRegistration.SMainApproveType14;
newSubPayRegistration.SMonthType15 = subPayRegistration.SMonthType15;
newSubPayRegistration.SMainApproveType15 = subPayRegistration.SMainApproveType15;
newSubPayRegistration.SMonthType16 = subPayRegistration.SMonthType16;
newSubPayRegistration.SMainApproveType16 = subPayRegistration.SMainApproveType16;
newSubPayRegistration.SMonthType17 = subPayRegistration.SMonthType17;
newSubPayRegistration.SMainApproveType17 = subPayRegistration.SMainApproveType17;
newSubPayRegistration.SMonthType18 = subPayRegistration.SMonthType18;
newSubPayRegistration.SMainApproveType18 = subPayRegistration.SMainApproveType18;
newSubPayRegistration.SMonthType19 = subPayRegistration.SMonthType19;
newSubPayRegistration.SMainApproveType19 = subPayRegistration.SMainApproveType19;
newSubPayRegistration.SMonthType20 = subPayRegistration.SMonthType20;
newSubPayRegistration.SMainApproveType20 = subPayRegistration.SMainApproveType20;
newSubPayRegistration.SMonthType21 = subPayRegistration.SMonthType21;
newSubPayRegistration.SMainApproveType21 = subPayRegistration.SMainApproveType21;
newSubPayRegistration.SMonthType22 = subPayRegistration.SMonthType22;
newSubPayRegistration.SMainApproveType22 = subPayRegistration.SMainApproveType22;
newSubPayRegistration.SMonthType23 = subPayRegistration.SMonthType23;
newSubPayRegistration.SMainApproveType23 = subPayRegistration.SMainApproveType23;
newSubPayRegistration.SMonthType24 = subPayRegistration.SMonthType24;
newSubPayRegistration.SMainApproveType24 = subPayRegistration.SMainApproveType24;
newSubPayRegistration.SMonthType25 = subPayRegistration.SMonthType25;
newSubPayRegistration.SMainApproveType25 = subPayRegistration.SMainApproveType25;
newSubPayRegistration.SMonthType26 = subPayRegistration.SMonthType26;
newSubPayRegistration.SMainApproveType26 = subPayRegistration.SMainApproveType26;
newSubPayRegistration.SMonthType27 = subPayRegistration.SMonthType27;
newSubPayRegistration.SMainApproveType27 = subPayRegistration.SMainApproveType27;
newSubPayRegistration.SMonthType28 = subPayRegistration.SMonthType28;
newSubPayRegistration.SMainApproveType28 = subPayRegistration.SMainApproveType28;
newSubPayRegistration.SMonthType29 = subPayRegistration.SMonthType29;
newSubPayRegistration.SMainApproveType29 = subPayRegistration.SMainApproveType29;
Funs.DB.CostGoods_SubPayRegistration.InsertOnSubmit(newSubPayRegistration);
Funs.DB.SubmitChanges();
}
/// <summary>
/// 修改分包商安全费用投入登记
/// </summary>
/// <param name="subPayRegistration"></param>
public static void UpdateSubPayRegistration(Model.CostGoods_SubPayRegistration subPayRegistration)
{
Model.CostGoods_SubPayRegistration newSubPayRegistration = Funs.DB.CostGoods_SubPayRegistration.FirstOrDefault(e => e.SubPayRegistrationId == subPayRegistration.SubPayRegistrationId);
if (newSubPayRegistration != null)
{
newSubPayRegistration.ProjectId = subPayRegistration.ProjectId;
newSubPayRegistration.UnitId = subPayRegistration.UnitId;
newSubPayRegistration.PayDate = subPayRegistration.PayDate;
newSubPayRegistration.ContractNum = subPayRegistration.ContractNum;
newSubPayRegistration.State = subPayRegistration.State;
newSubPayRegistration.SMonthType1 = subPayRegistration.SMonthType1;
newSubPayRegistration.SMainApproveType1 = subPayRegistration.SMainApproveType1;
newSubPayRegistration.SMonthType2 = subPayRegistration.SMonthType2;
newSubPayRegistration.SMainApproveType2 = subPayRegistration.SMainApproveType2;
newSubPayRegistration.SMonthType3 = subPayRegistration.SMonthType3;
newSubPayRegistration.SMainApproveType3 = subPayRegistration.SMainApproveType3;
newSubPayRegistration.SMonthType4 = subPayRegistration.SMonthType4;
newSubPayRegistration.SMainApproveType4 = subPayRegistration.SMainApproveType4;
newSubPayRegistration.SMonthType5 = subPayRegistration.SMonthType5;
newSubPayRegistration.SMainApproveType5 = subPayRegistration.SMainApproveType5;
newSubPayRegistration.SMonthType6 = subPayRegistration.SMonthType6;
newSubPayRegistration.SMainApproveType6 = subPayRegistration.SMainApproveType6;
newSubPayRegistration.SMonthType7 = subPayRegistration.SMonthType7;
newSubPayRegistration.SMainApproveType7 = subPayRegistration.SMainApproveType7;
newSubPayRegistration.SMonthType8 = subPayRegistration.SMonthType8;
newSubPayRegistration.SMainApproveType8 = subPayRegistration.SMainApproveType8;
newSubPayRegistration.SMonthType9 = subPayRegistration.SMonthType9;
newSubPayRegistration.SMainApproveType9 = subPayRegistration.SMainApproveType9;
newSubPayRegistration.SMonthType10 = subPayRegistration.SMonthType10;
newSubPayRegistration.SMainApproveType10 = subPayRegistration.SMainApproveType10;
newSubPayRegistration.SMonthType11 = subPayRegistration.SMonthType11;
newSubPayRegistration.SMainApproveType11 = subPayRegistration.SMainApproveType11;
newSubPayRegistration.SMonthType12 = subPayRegistration.SMonthType12;
newSubPayRegistration.SMainApproveType12 = subPayRegistration.SMainApproveType12;
newSubPayRegistration.SMonthType13 = subPayRegistration.SMonthType13;
newSubPayRegistration.SMainApproveType13 = subPayRegistration.SMainApproveType13;
newSubPayRegistration.SMonthType14 = subPayRegistration.SMonthType14;
newSubPayRegistration.SMainApproveType14 = subPayRegistration.SMainApproveType14;
newSubPayRegistration.SMonthType15 = subPayRegistration.SMonthType15;
newSubPayRegistration.SMainApproveType15 = subPayRegistration.SMainApproveType15;
newSubPayRegistration.SMonthType16 = subPayRegistration.SMonthType16;
newSubPayRegistration.SMainApproveType16 = subPayRegistration.SMainApproveType16;
newSubPayRegistration.SMonthType17 = subPayRegistration.SMonthType17;
newSubPayRegistration.SMainApproveType17 = subPayRegistration.SMainApproveType17;
newSubPayRegistration.SMonthType18 = subPayRegistration.SMonthType18;
newSubPayRegistration.SMainApproveType18 = subPayRegistration.SMainApproveType18;
newSubPayRegistration.SMonthType19 = subPayRegistration.SMonthType19;
newSubPayRegistration.SMainApproveType19 = subPayRegistration.SMainApproveType19;
newSubPayRegistration.SMonthType20 = subPayRegistration.SMonthType20;
newSubPayRegistration.SMainApproveType20 = subPayRegistration.SMainApproveType20;
newSubPayRegistration.SMonthType21 = subPayRegistration.SMonthType21;
newSubPayRegistration.SMainApproveType21 = subPayRegistration.SMainApproveType21;
newSubPayRegistration.SMonthType22 = subPayRegistration.SMonthType22;
newSubPayRegistration.SMainApproveType22 = subPayRegistration.SMainApproveType22;
newSubPayRegistration.SMonthType23 = subPayRegistration.SMonthType23;
newSubPayRegistration.SMainApproveType23 = subPayRegistration.SMainApproveType23;
newSubPayRegistration.SMonthType24 = subPayRegistration.SMonthType24;
newSubPayRegistration.SMainApproveType24 = subPayRegistration.SMainApproveType24;
newSubPayRegistration.SMonthType25 = subPayRegistration.SMonthType25;
newSubPayRegistration.SMainApproveType25 = subPayRegistration.SMainApproveType25;
newSubPayRegistration.SMonthType26 = subPayRegistration.SMonthType26;
newSubPayRegistration.SMainApproveType26 = subPayRegistration.SMainApproveType26;
newSubPayRegistration.SMonthType27 = subPayRegistration.SMonthType27;
newSubPayRegistration.SMainApproveType27 = subPayRegistration.SMainApproveType27;
newSubPayRegistration.SMonthType28 = subPayRegistration.SMonthType28;
newSubPayRegistration.SMainApproveType28 = subPayRegistration.SMainApproveType28;
newSubPayRegistration.SMonthType29 = subPayRegistration.SMonthType29;
newSubPayRegistration.SMainApproveType29 = subPayRegistration.SMainApproveType29;
Funs.DB.SubmitChanges();
}
}
/// <summary>
/// 根据主键删除分包商安全费用投入登记
/// </summary>
/// <param name="subPayRegistrationId"></param>
public static void DeleteSubPayRegistrationById(string subPayRegistrationId)
{
Model.CostGoods_SubPayRegistration subPayRegistration = Funs.DB.CostGoods_SubPayRegistration.FirstOrDefault(e => e.SubPayRegistrationId == subPayRegistrationId);
if (subPayRegistration != null)
{
CommonService.DeleteFlowOperateByID(subPayRegistrationId);
Funs.DB.CostGoods_SubPayRegistration.DeleteOnSubmit(subPayRegistration);
Funs.DB.SubmitChanges();
}
}
/// <summary>
/// 根据时间、项目获取分包商安全费用投入登记信息
/// </summary>
/// <param name="startTime"></param>
/// <param name="endTime"></param>
/// <param name="projectId"></param>
/// <returns></returns>
public static List<Model.CostGoods_SubPayRegistration> GetSubPayRegistrationByPayDate(DateTime startTime, DateTime endTime, string projectId)
{
return (from x in Funs.DB.CostGoods_SubPayRegistration where x.PayDate >= startTime && x.PayDate <= endTime && x.ProjectId == projectId select x).ToList();
}
/// <summary>
/// 根据单位获取HSE措施费合同额
/// </summary>
/// <param name="unitId"></param>
/// <param name="startTime"></param>
/// <param name="endTime"></param>
/// <returns></returns>
public static decimal? GetSubPaySMonthTypeByUnitId(string unitId, DateTime startTime, DateTime endTime)
{
var q = (from x in Funs.DB.CostGoods_SubPayRegistration
where x.UnitId == unitId && x.PayDate >= startTime && x.PayDate < endTime
select x).ToList();
if (q.Count > 0)
{
return q.Sum(e => (e.SMonthType1 + e.SMonthType2 + e.SMonthType3 + e.SMonthType4 + e.SMonthType5 + e.SMonthType6 + e.SMonthType7 + e.SMonthType8 + e.SMonthType9 + e.SMonthType10 + e.SMonthType11 + e.SMonthType12 + e.SMonthType13 + e.SMonthType14 + e.SMonthType15 + e.SMonthType16 + e.SMonthType17 + e.SMonthType18 + e.SMonthType19 + e.SMonthType20 + e.SMonthType21 + e.SMonthType22 + e.SMonthType23 + e.SMonthType24 + e.SMonthType25 + e.SMonthType26 + e.SMonthType27 + e.SMonthType28 + e.SMonthType29));
}
return null;
}
/// <summary>
/// 根据单位获取本月项目分包商HSE费用支付统计
/// </summary>
/// <param name="unitId"></param>
/// <param name="startTime"></param>
/// <param name="endTime"></param>
/// <returns></returns>
public static decimal? GetSubPayRegistrationByUnitId(string unitId, DateTime startTime, DateTime endTime)
{
var q = (from x in Funs.DB.CostGoods_SubPayRegistration
where x.UnitId == unitId && x.PayDate >= startTime && x.PayDate < endTime
select x).ToList();
if (q.Count > 0)
{
return q.Sum(e => (e.SMainApproveType1 + e.SMainApproveType2 + e.SMainApproveType3 + e.SMainApproveType4 + e.SMainApproveType5 + e.SMainApproveType6 + e.SMainApproveType7 + e.SMainApproveType8 + e.SMainApproveType9 + e.SMainApproveType10 + e.SMainApproveType11 + e.SMainApproveType12 + e.SMainApproveType13 + e.SMainApproveType14 + e.SMainApproveType15 + e.SMainApproveType16 + e.SMainApproveType17 + e.SMainApproveType18 + e.SMainApproveType19 + e.SMainApproveType20 + e.SMainApproveType21 + e.SMainApproveType22 + e.SMainApproveType23 + e.SMainApproveType24 + e.SMainApproveType25 + e.SMainApproveType26 + e.SMainApproveType27 + e.SMainApproveType28 + e.SMainApproveType29));
}
return null;
}
}
}