This commit is contained in:
gaofei
2021-08-13 11:15:59 +08:00
parent 43acc57060
commit d8dff88c39
320 changed files with 37219 additions and 4678 deletions
+23 -27
View File
@@ -85,13 +85,13 @@
<ItemGroup>
<Compile Include="API\APIBaseInfoService.cs" />
<Compile Include="API\APICommonService.cs" />
<Compile Include="API\APIDoorServerService.cs" />
<Compile Include="API\APIGetHttpService.cs" />
<Compile Include="API\APIIDCardInfoService.cs" />
<Compile Include="API\APIPersonService.cs" />
<Compile Include="API\APIProjectService.cs" />
<Compile Include="API\APIUnitService.cs" />
<Compile Include="API\APIUpLoadFileService.cs" />
<Compile Include="API\APIDoorServerService.cs" />
<Compile Include="API\APIUserService.cs" />
<Compile Include="API\HJGL\APIHotProcessHardService.cs" />
<Compile Include="API\HJGL\APINDETrustService.cs" />
@@ -519,6 +519,7 @@
<Compile Include="HSSE\Technique\Technique_CheckItemSetService.cs" />
<Compile Include="JDGL\Check\ElectricalCompletionService.cs" />
<Compile Include="JDGL\Check\EquipmentCompletionService.cs" />
<Compile Include="JDGL\Check\LowTankCompletionService.cs" />
<Compile Include="JDGL\Check\MeterCompletionService.cs" />
<Compile Include="JDGL\Check\PipelineCompletionService.cs" />
<Compile Include="JDGL\Check\ProgressCompletionService.cs" />
@@ -529,13 +530,21 @@
<Compile Include="JDGL\WBSCompleteAndReal\WBSReportService.cs" />
<Compile Include="JDGL\WBS\CnProfessionInitService.cs" />
<Compile Include="JDGL\WBS\CnProfessionService.cs" />
<Compile Include="JDGL\WBS\CostControlDetailHistoryService.cs" />
<Compile Include="JDGL\WBS\CostControlDetailService.cs" />
<Compile Include="JDGL\WBS\CostControlInitService.cs" />
<Compile Include="JDGL\WBS\CostControlParentDetailService.cs" />
<Compile Include="JDGL\WBS\CostControlService.cs" />
<Compile Include="JDGL\WBS\UnitProjectInitService.cs" />
<Compile Include="JDGL\WBS\UnitProjectService.cs" />
<Compile Include="JDGL\WBS\WbsDetailHistoryService.cs" />
<Compile Include="JDGL\WBS\WbsDetailService.cs" />
<Compile Include="JDGL\WBS\WBSRectificationMeasureSetService.cs" />
<Compile Include="JDGL\WBS\WbsSetInitService.cs" />
<Compile Include="JDGL\WBS\WbsSetMatchCostControlInitService.cs" />
<Compile Include="JDGL\WBS\WbsSetMatchCostControlService.cs" />
<Compile Include="JDGL\WBS\WbsSetService.cs" />
<Compile Include="JDGL\WBS\WorkloadStatisticsService.cs" />
<Compile Include="Notice\NoticeService.cs" />
<Compile Include="obj\Debug\TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs" />
<Compile Include="obj\Debug\TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs" />
@@ -554,12 +563,25 @@
<Compile Include="OpenService\MonitorService.cs" />
<Compile Include="DynamicTHeaderHepler.cs" />
<Compile Include="OpenService\GetDataService.cs" />
<Compile Include="Party\BasicInformationDetailService.cs" />
<Compile Include="Party\BasicInformationService.cs" />
<Compile Include="Party\CommentPartyerService.cs" />
<Compile Include="Party\DoingThingsForMassesService.cs" />
<Compile Include="Party\EmployeeConversationRecordService.cs" />
<Compile Include="Party\FocusLearnService.cs" />
<Compile Include="Party\LastWorkSummaryService.cs" />
<Compile Include="Party\NewsPropagandaWorkService.cs" />
<Compile Include="Party\OrganizingLifeService.cs" />
<Compile Include="Party\PartyCommitteeService.cs" />
<Compile Include="Party\PartyCongressService.cs" />
<Compile Include="Party\PartyerService.cs" />
<Compile Include="Party\PartyHistoryStudyService.cs" />
<Compile Include="Party\PartyLectureService.cs" />
<Compile Include="Party\PartyMeetingService.cs" />
<Compile Include="Party\PartyMoneyUseService.cs" />
<Compile Include="Party\PartyPioneerDemonstrationService.cs" />
<Compile Include="Party\ThemePartyDayService.cs" />
<Compile Include="Party\TwoOneGoodSelectionService.cs" />
<Compile Include="Party\WorkPlanService.cs" />
<Compile Include="Person\PersonTotalService.cs" />
<Compile Include="Person\Person_DutyService.cs" />
@@ -717,7 +739,6 @@
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
<None Include="bin\Release\BLL.dll.config" />
<None Include="obj\Debug\BLL.csproj.CopyComplete" />
<None Include="obj\Debug\BLL.csproj.CoreCompileInputs.cache" />
<None Include="obj\Debug\BLL.csprojAssemblyReference.cache" />
@@ -736,31 +757,6 @@
<None Include="Scripts\jquery-3.5.1.slim.min.map" />
</ItemGroup>
<ItemGroup>
<Content Include="bin\Debug\BLL.dll" />
<Content Include="bin\Debug\BLL.pdb" />
<Content Include="bin\Release\AipSdk.dll" />
<Content Include="bin\Release\AOP.Common.dll" />
<Content Include="bin\Release\Apache.NMS.ActiveMQ.dll" />
<Content Include="bin\Release\Apache.NMS.ActiveMQ.pdb" />
<Content Include="bin\Release\Apache.NMS.ActiveMQ.xml" />
<Content Include="bin\Release\BLL.dll" />
<Content Include="bin\Release\BLL.pdb" />
<Content Include="bin\Release\EmitMapper.dll" />
<Content Include="bin\Release\FineUIPro.dll" />
<Content Include="bin\Release\FineUIPro.xml" />
<Content Include="bin\Release\Microsoft.QualityTools.Testing.Fakes.dll" />
<Content Include="bin\Release\Microsoft.SqlServer.DTSPipelineWrap.dll" />
<Content Include="bin\Release\Microsoft.SqlServer.DTSRuntimeWrap.dll" />
<Content Include="bin\Release\Microsoft.SQLServer.ManagedDTS.dll" />
<Content Include="bin\Release\Microsoft.SqlServer.PipelineHost.dll" />
<Content Include="bin\Release\Model.dll" />
<Content Include="bin\Release\Model.pdb" />
<Content Include="bin\Release\Newtonsoft.Json.dll" />
<Content Include="bin\Release\Newtonsoft.Json.xml" />
<Content Include="bin\Release\SgManager.AI.dll" />
<Content Include="bin\Release\SgManager.AI.pdb" />
<Content Include="bin\Release\ThoughtWorks.QRCode.dll" />
<Content Include="bin\Release\zh-Hans\Microsoft.QualityTools.Testing.Fakes.resources.dll" />
<Content Include="obj\Debug\BLL.csproj.FileListAbsolute.txt" />
<Content Include="obj\Debug\BLL.dll" />
<Content Include="obj\Debug\BLL.pdb" />
@@ -124,6 +124,7 @@ namespace BLL
newInspectionEquipment.UnitId = inspectionEquipment.UnitId;
newInspectionEquipment.InspectionCode = inspectionEquipment.InspectionCode;
newInspectionEquipment.CNProfessionalId = inspectionEquipment.CNProfessionalId;
newInspectionEquipment.EquipmentOrMatail = inspectionEquipment.EquipmentOrMatail;
newInspectionEquipment.InspectionName = inspectionEquipment.InspectionName;
newInspectionEquipment.Specifications = inspectionEquipment.Specifications;
newInspectionEquipment.Supplier = inspectionEquipment.Supplier;
@@ -158,6 +159,7 @@ namespace BLL
newInspectionEquipment.CNProfessionalId = inspectionEquipment.CNProfessionalId;
newInspectionEquipment.InspectionName = inspectionEquipment.InspectionName;
newInspectionEquipment.Specifications = inspectionEquipment.Specifications;
newInspectionEquipment.EquipmentOrMatail = inspectionEquipment.EquipmentOrMatail;
newInspectionEquipment.Supplier = inspectionEquipment.Supplier;
newInspectionEquipment.Counts = inspectionEquipment.Counts;
newInspectionEquipment.SamplingCount = inspectionEquipment.SamplingCount;
@@ -69,6 +69,7 @@ namespace BLL
newConstructionStandardListProject.IsSelected8 = ConstructionStandardListProject.IsSelected8;
newConstructionStandardListProject.IsSelected9 = ConstructionStandardListProject.IsSelected9;
newConstructionStandardListProject.IsSelected10 = ConstructionStandardListProject.IsSelected10;
newConstructionStandardListProject.IsChecked = ConstructionStandardListProject.IsChecked;
Funs.DB.CQMS_Law_ConstructionStandardListProject.InsertOnSubmit(newConstructionStandardListProject);
Funs.DB.SubmitChanges();
}
@@ -103,6 +104,7 @@ namespace BLL
newConstructionStandardListProject.IsSelected8 = ConstructionStandardListProject.IsSelected8;
newConstructionStandardListProject.IsSelected9 = ConstructionStandardListProject.IsSelected9;
newConstructionStandardListProject.IsSelected10 = ConstructionStandardListProject.IsSelected10;
newConstructionStandardListProject.IsChecked = ConstructionStandardListProject.IsChecked;
Funs.DB.SubmitChanges();
}
}
+84 -6
View File
@@ -2761,11 +2761,6 @@ namespace BLL
/// 人工时月报模版文件原始的虚拟路径
/// </summary>
public const string MonthReportTemplateUrl = "File\\Excel\\DataIn\\人工时月报模板.xls";
/// <summary>
/// 现场人员考勤导入模版
/// </summary>
public const string PersonInfoTemplateUrl = "File\\Excel\\DataIn\\现场人员考勤导入模版.xls";
/// <summary>
/// 百万工时安全统计月报表模板文件原始虚拟路径
/// </summary>
@@ -2811,6 +2806,10 @@ namespace BLL
/// </summary>
public const string CheckDayTemplateUrl = "File\\Excel\\DataIn\\日常巡检导入模板.xls";
/// <summary>
/// 现场人员考勤导入模版
/// </summary>
public const string PersonInfoTemplateUrl = "File\\Excel\\DataIn\\现场人员考勤导入模版.xls";
/// <summary>
/// 专项检查导入模板
/// </summary>
public const string CheckSpecialTemplateUrl = "File\\Excel\\DataIn\\专项检查导入模板.xls";
@@ -2931,6 +2930,10 @@ namespace BLL
/// </summary>
public const string QuantityCompletionTemplateUrl = "File\\Excel\\DataIn\\项目进度完成情况导入模板.xls";
/// <summary>
/// 低温储罐完成情况导入模版文件原始的虚拟路径
/// </summary>
public const string LowTankCompletionTemplateUrl = "File\\Excel\\DataIn\\低温储罐完成情况导入模板.xls";
/// <summary>
/// 钢结构完成情况导入模版文件原始的虚拟路径
/// </summary>
public const string SteelStructureCompletionTemplateUrl = "File\\Excel\\DataIn\\钢结构完成情况导入模板.xls";
@@ -4320,6 +4323,16 @@ namespace BLL
#endregion
#region
/// <summary>
/// 党支部基本情况
/// </summary>
public const string BasicInformationMenuId = "AA2BCCC3-24C7-4766-BF67-90F852E9922B";
/// <summary>
/// 党员名册
/// </summary>
public const string PartyerMenuId = "8F93D7AB-A746-4279-A1F2-4EC1E0B45849";
/// <summary>
/// 上年度党建工作总结
/// </summary>
@@ -4354,6 +4367,56 @@ namespace BLL
/// 组织生活会
/// </summary>
public const string OrganizingLifeMenuId = "FA19FBD7-6458-4A40-9D2E-9CBCBF5CDBDB";
/// <summary>
/// 民主评议党员
/// </summary>
public const string CommentPartyerMenuId = "B0942E8C-BE49-4D96-948B-FDE75C4E27A5";
/// <summary>
/// 集中学习
/// </summary>
public const string FocusLearnMenuId = "EAB1A564-00A4-4D7C-9655-7DD9741F46C9";
/// <summary>
/// 主题党日活动
/// </summary>
public const string ThemePartyDayMenuId = "BF0340D1-6641-494B-80DC-DB3BDAA43D3E";
/// <summary>
/// 党员先锋岗、示范岗
/// </summary>
public const string PartyPioneerDemonstrationMenuId = "A425EF77-1527-473D-85C8-C30DE914F488";
/// <summary>
/// “两优一先”评选
/// </summary>
public const string TwoOneGoodSelectionMenuId = "ECA84DF5-F900-4FD4-A78A-20C725C1483C";
/// <summary>
/// 党史学习教育
/// </summary>
public const string PartyHistoryStudyMenuId = "066CE5C7-FACE-435F-8691-DEFC5A0E9E9B";
/// <summary>
/// 党组织工作经费使用
/// </summary>
public const string PartyMoneyUseMenuId = "BA1DA76E-D5D2-4270-ACBF-6E134B8F5952";
/// <summary>
/// 新闻宣传工作
/// </summary>
public const string NewsPropagandaWorkMenuId = "A4789F38-4431-4497-872E-7121BB53DC22";
/// <summary>
/// 员工谈话记录
/// </summary>
public const string EmployeeConversationRecordMenuId = "7BF12C19-2A26-48BE-A812-325A809EEA62";
/// <summary>
/// 为群众办实事
/// </summary>
public const string DoingThingsForMassesMenuId = "44D157DC-064E-4C24-82E5-33795764756D";
#endregion
#region
@@ -4640,10 +4703,15 @@ namespace BLL
public const string ProjectInstallationMenuId = "A4308F9A-0280-49C5-BEE4-FA858FE1CE24";
/// <summary>
/// 单位、分部、分项工程审核与发布
/// 分部、工作项及费用清单设置
/// </summary>
public const string WBSSetAuditMenuId = "858E83E9-ADE5-452E-BD65-82D8DFF872C0";
/// <summary>
/// 工作量录入
/// </summary>
public const string WorkloadInputMenuId = "E3905BF1-289B-4500-BD34-36F97D649AFC";
/// <summary>
/// 进度测量标志(权重)设置
/// </summary>
@@ -4694,6 +4762,11 @@ namespace BLL
/// </summary>
public const string QuantityCompletionMenuId = "2AE9D982-A499-497F-8F54-ADDA5856887E";
/// <summary>
/// 低温储罐完成情况
/// </summary>
public const string LowTankCompletionMenuId = "82E513B9-1A6F-495A-A633-EBC89CE5273A";
/// <summary>
/// 钢结构完成情况
/// </summary>
@@ -4725,6 +4798,11 @@ namespace BLL
public const string UndergroundPipeCompletionMenuId = "C7037A5D-D8A6-4C1C-A5B8-2083C31C0A7B";
#endregion
/// <summary>
/// 设备专业Id
/// </summary>
public const string EQCNProfessionalId = "FBC066BE-082F-4185-AE5C-016A12132ADE";
#region
/// <summary>
/// 同步设置
@@ -0,0 +1,91 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace BLL
{
/// <summary>
/// 低温储罐完成情况
/// </summary>
public class LowTankCompletionService
{
public static Model.SGGLDB db = Funs.DB;
/// <summary>
/// 根据主键获取低温储罐完成情况
/// </summary>
/// <param name="lowTankCompletionId"></param>
/// <returns></returns>
public static Model.JDGL_LowTankCompletion GetLowTankCompletionById(string lowTankCompletionId)
{
return Funs.DB.JDGL_LowTankCompletion.FirstOrDefault(e => e.LowTankCompletionId == lowTankCompletionId);
}
/// <summary>
/// 添加低温储罐完成情况
/// </summary>
/// <param name="lowTankCompletion"></param>
public static void AddLowTankCompletion(Model.JDGL_LowTankCompletion lowTankCompletion)
{
Model.SGGLDB db = Funs.DB;
Model.JDGL_LowTankCompletion newLowTankCompletion = new Model.JDGL_LowTankCompletion
{
LowTankCompletionId = lowTankCompletion.LowTankCompletionId,
ProjectId = lowTankCompletion.ProjectId,
Code = lowTankCompletion.Code,
Name = lowTankCompletion.Name,
Unit = lowTankCompletion.Unit,
TotalNum = lowTankCompletion.TotalNum,
PlanNum = lowTankCompletion.PlanNum,
RealNum = lowTankCompletion.RealNum,
CompileMan = lowTankCompletion.CompileMan,
CompileDate = lowTankCompletion.CompileDate,
StartDate = lowTankCompletion.StartDate,
EndDate = lowTankCompletion.EndDate
};
db.JDGL_LowTankCompletion.InsertOnSubmit(newLowTankCompletion);
db.SubmitChanges();
}
/// <summary>
/// 修改低温储罐完成情况
/// </summary>
/// <param name="lowTankCompletion"></param>
public static void UpdateLowTankCompletion(Model.JDGL_LowTankCompletion lowTankCompletion)
{
Model.SGGLDB db = Funs.DB;
Model.JDGL_LowTankCompletion newLowTankCompletion = db.JDGL_LowTankCompletion.FirstOrDefault(e => e.LowTankCompletionId == lowTankCompletion.LowTankCompletionId);
if (newLowTankCompletion != null)
{
newLowTankCompletion.Code = lowTankCompletion.Code;
newLowTankCompletion.Name = lowTankCompletion.Name;
newLowTankCompletion.TotalNum = lowTankCompletion.TotalNum;
newLowTankCompletion.PlanNum = lowTankCompletion.PlanNum;
newLowTankCompletion.RealNum = lowTankCompletion.RealNum;
newLowTankCompletion.CompileMan = lowTankCompletion.CompileMan;
newLowTankCompletion.CompileDate = lowTankCompletion.CompileDate;
db.SubmitChanges();
}
}
/// <summary>
/// 根据主键删除低温储罐完成情况
/// </summary>
/// <param name="lowTankCompletionId"></param>
public static void DeleteLowTankCompletionById(string lowTankCompletionId)
{
Model.SGGLDB db = Funs.DB;
var lowTankCompletion = (from x in db.JDGL_LowTankCompletion where x.LowTankCompletionId == lowTankCompletionId select x).FirstOrDefault();
if (lowTankCompletion != null)
{
var q = from x in db.JDGL_LowTankCompletion where x.ProjectId == lowTankCompletion.ProjectId && x.Code == lowTankCompletion.Code && x.Name == lowTankCompletion.Name select x;
if (q.Count() > 0)
{
db.JDGL_LowTankCompletion.DeleteAllOnSubmit(q);
db.SubmitChanges();
}
}
}
}
}
+26
View File
@@ -24,6 +24,30 @@ namespace BLL
return Funs.DB.WBS_CnProfession.FirstOrDefault(e => e.CnProfessionId == cnProfessionId);
}
/// <summary>
/// 根据装置Id和专业编号获取专业Id
/// </summary>
/// <param name="unitProjectId">专业Id</param>
/// <returns></returns>
public static string GetCnProfessionIdByInstallationIdAndOldId(string installationId, string oldId)
{
string cnProfessionId = string.Empty;
Model.SGGLDB db = Funs.DB;
var ins = db.Project_Installation.FirstOrDefault(x => x.InstallationId == installationId);
if (ins.IsEnd == true)
{
var cn = db.WBS_CnProfession.FirstOrDefault(x => x.InstallationId == ins.InstallationId && x.OldId.ToString() == oldId);
cnProfessionId = cn.CnProfessionId;
}
else
{
var childIns = db.Project_Installation.FirstOrDefault(x => x.SuperInstallationId == installationId);
cnProfessionId = GetCnProfessionIdByInstallationIdAndOldId(childIns.InstallationId, oldId);
}
return cnProfessionId;
}
/// <summary>
/// 增加专业
/// </summary>
@@ -64,6 +88,8 @@ namespace BLL
newCnP.WeightsMoney = cnProfession.WeightsMoney;
newCnP.IsWeightsApprove = cnProfession.IsWeightsApprove;
newCnP.UnitId = cnProfession.UnitId;
newCnP.IsSelected = cnProfession.IsSelected;
newCnP.IsApprove = cnProfession.IsApprove;
db.SubmitChanges();
}
@@ -0,0 +1,156 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BLL
{
public class CostControlDetailHistoryService
{
/// <summary>
/// 根据Id获取一个费控项明细历史记录信息
/// </summary>
/// <param name="costControlDetailHistoryId">费控项明细历史记录Id</param>
public static Model.WBS_CostControlDetailHistory GetCostControlDetailHistoryByCostControlDetailHistoryId(string costControlDetailHistoryId)
{
return Funs.DB.WBS_CostControlDetailHistory.FirstOrDefault(e => e.CostControlDetailHistoryId == costControlDetailHistoryId);
}
/// <summary>
/// 根据CostControlId判断是否存在费控项明细历史记录信息
/// </summary>
/// <param name="costControlId">costControlId</param>
public static bool IsExitCostControlDetailHistoryByCostControlId(string costControlId)
{
return (from x in Funs.DB.WBS_CostControlDetailHistory where x.CostControlId == costControlId select x).Count() > 0;
}
/// <summary>
/// 根据Id获取对应费控项明细历史记录信息
/// </summary>
/// <param name="toWbs">对应wbsId</param>
public static List<Model.WBS_CostControlDetailHistory> GetCostControlDetailHistorysByCostControlId(string costControlId)
{
return (from x in Funs.DB.WBS_CostControlDetailHistory where x.CostControlId == costControlId orderby x.VersionNum, x.Months select x).ToList();
}
/// <summary>
/// 根据costControlId和年及月获取对应费控项明细历史记录信息
/// </summary>
/// <param name="costControlId">对应wbsId</param>
/// <param name="toFlag">对应标志</param>
/// <param name="years">年</param>
/// <param name="months">月</param>
public static Model.WBS_CostControlDetailHistory GetCostControlDetailHistoryByCostControlIdAndMonths(string costControlId, DateTime months)
{
return (from x in Funs.DB.WBS_CostControlDetailHistory where x.CostControlId == costControlId && x.Months == months select x).FirstOrDefault();
}
public static Model.WBS_CostControlDetailHistory GetWBS_CostControlDetailHistoryByCostControlId(string costControlId)
{
return (from x in Funs.DB.WBS_CostControlDetailHistory where x.CostControlId == costControlId select x).FirstOrDefault();
}
/// <summary>
///
/// </summary>
/// <param name="costControlId"></param>
/// <param name="toFlag"></param>
/// <param name="months"></param>
/// <returns></returns>
public static bool IsExitWBS_CostControlDetailHistoryByCostControlIdOrMonth(string costControlId, DateTime months)
{
bool result = false;
var q = Funs.DB.WBS_CostControlDetailHistory.FirstOrDefault(e => e.CostControlId == costControlId && e.Months == months);
if (q != null)
{
result = true;
}
return result;
}
/// <summary>
/// 根据年及月获取之前月份的对应费控项明细历史记录信息集合(含当月)
/// </summary>
/// <param name="years">年</param>
/// <param name="months">月</param>
public static List<Model.WBS_CostControlDetailHistory> GetTotalWBS_CostControlDetailHistorysByYearMonth2(string costControlId, DateTime months)
{
return (from x in Funs.DB.WBS_CostControlDetailHistory where x.CostControlId == costControlId && x.Months <= months select x).ToList();
}
/// <summary>
/// 根据CostControlId月获取当前最大版本
/// </summary>
/// <param name="costControlId">costControlId</param>
public static int GetMaxVersionNumByCostControlId(string costControlId)
{
int i = 0;
var q = (from x in Funs.DB.WBS_CostControlDetailHistory where x.CostControlId == costControlId orderby x.VersionNum descending select x.VersionNum ?? 0).ToList();
if (q.Count > 0)
{
i = q[0];
}
return i;
}
/// <summary>
/// 增加费控项明细历史记录
/// </summary>
/// <param name="user">费控项明细历史记录</param>
public static void AddCostControlDetailHistory(Model.WBS_CostControlDetailHistory costControlDetailHistory)
{
Model.SGGLDB db = Funs.DB;
Model.WBS_CostControlDetailHistory newWBS_CostControlDetailHistory = new Model.WBS_CostControlDetailHistory();
newWBS_CostControlDetailHistory.CostControlDetailHistoryId = costControlDetailHistory.CostControlDetailHistoryId;
newWBS_CostControlDetailHistory.CostControlId = costControlDetailHistory.CostControlId;
newWBS_CostControlDetailHistory.Months = costControlDetailHistory.Months;
newWBS_CostControlDetailHistory.PlanNum = costControlDetailHistory.PlanNum;
newWBS_CostControlDetailHistory.VersionNum = costControlDetailHistory.VersionNum;
db.WBS_CostControlDetailHistory.InsertOnSubmit(newWBS_CostControlDetailHistory);
db.SubmitChanges();
}
/// <summary>
/// 修改费控项明细历史记录
/// </summary>
/// <param name="user">费控项明细历史记录</param>
public static void UpdateCostControlDetailHistory(Model.WBS_CostControlDetailHistory costControlDetailHistory)
{
Model.SGGLDB db = Funs.DB;
Model.WBS_CostControlDetailHistory newWBS_CostControlDetailHistory = db.WBS_CostControlDetailHistory.First(e => e.CostControlDetailHistoryId == costControlDetailHistory.CostControlDetailHistoryId);
newWBS_CostControlDetailHistory.PlanNum = costControlDetailHistory.PlanNum;
db.SubmitChanges();
}
/// <summary>
/// 根据Id删除费控项明细历史记录信息
/// </summary>
/// <param name="userId"></param>
public static void DeleteCostControlDetailHistory(string costControlDetailHistoryId)
{
Model.SGGLDB db = Funs.DB;
Model.WBS_CostControlDetailHistory ins = db.WBS_CostControlDetailHistory.First(e => e.CostControlDetailHistoryId == costControlDetailHistoryId);
db.WBS_CostControlDetailHistory.DeleteOnSubmit(ins);
db.SubmitChanges();
}
/// <summary>
/// 根据costControlId删除费控项明细历史记录信息
/// </summary>
/// <param name="userId"></param>
public static void DeleteCostControlDetailHistoryByCostControlId(string costControlId)
{
Model.SGGLDB db = Funs.DB;
var details = from x in db.WBS_CostControlDetailHistory where x.CostControlId == costControlId select x;
if (details.Count() > 0)
{
db.WBS_CostControlDetailHistory.DeleteAllOnSubmit(details);
db.SubmitChanges();
}
}
}
}
@@ -0,0 +1,166 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BLL
{
public class CostControlDetailService
{
/// <summary>
/// 根据Id获取一个费控项明细信息
/// </summary>
/// <param name="costControlDetailId">费控项明细Id</param>
public static Model.WBS_CostControlDetail GetCostControlDetailByCostControlDetailId(string costControlDetailId)
{
return Funs.DB.WBS_CostControlDetail.FirstOrDefault(e => e.CostControlDetailId == costControlDetailId);
}
/// <summary>
/// 根据CostControlId判断是否存在费控项明细信息
/// </summary>
/// <param name="costControlId">costControlId</param>
public static bool IsExitCostControlDetailByCostControlId(string costControlId)
{
return (from x in Funs.DB.WBS_CostControlDetail where x.CostControlId == costControlId select x).Count() > 0;
}
/// <summary>
/// 根据costControlId和年及月获取对应费控项明细信息
/// </summary>
/// <param name="costControlId">对应wbsId</param>
/// <param name="toFlag">对应标志</param>
/// <param name="years">年</param>
/// <param name="months">月</param>
public static Model.WBS_CostControlDetail GetCostControlDetailByCostControlIdAndMonths(string costControlId, DateTime months)
{
return (from x in Funs.DB.WBS_CostControlDetail where x.CostControlId == costControlId && x.Months == months select x).FirstOrDefault();
}
/// <summary>
/// 根据costControlId和年及月获取对应费控项明细视图信息
/// </summary>
/// <param name="costControlId">对应wbsId</param>
/// <param name="toFlag">对应标志</param>
/// <param name="years">年</param>
/// <param name="months">月</param>
public static Model.View_WBS_CostControlDetail GetCostControlDetailViewByCostControlIdAndMonths(string costControlId, DateTime months)
{
return (from x in Funs.DB.View_WBS_CostControlDetail where x.CostControlId == costControlId && x.Months == months select x).FirstOrDefault();
}
/// <summary>
/// 根据costControlId和年及月获取对应费控项明细信息
/// </summary>
/// <param name="costControlId">对应wbsId</param>
/// <param name="toFlag">对应标志</param>
/// <param name="years">年</param>
/// <param name="months">月</param>
public static Model.View_WBS_CostControlDetail GetViewCostControlDetailByCostControlIdYearMonth(string costControlId, DateTime months)
{
return (from x in Funs.DB.View_WBS_CostControlDetail where x.CostControlId == costControlId && x.Months == months select x).FirstOrDefault();
}
public static Model.WBS_CostControlDetail GetWBS_CostControlDetailByCostControlId(string costControlId)
{
return (from x in Funs.DB.WBS_CostControlDetail where x.CostControlId == costControlId select x).FirstOrDefault();
}
/// <summary>
///
/// </summary>
/// <param name="costControlId"></param>
/// <param name="toFlag"></param>
/// <param name="months"></param>
/// <returns></returns>
public static bool IsExitWBS_CostControlDetailByCostControlIdOrMonth(string costControlId, DateTime months)
{
bool result = false;
var q = Funs.DB.WBS_CostControlDetail.FirstOrDefault(e => e.CostControlId == costControlId && e.Months == months);
if (q != null)
{
result = true;
}
return result;
}
/// <summary>
/// 根据年及月获取之前月份的对应费控项明细信息集合(含当月)
/// </summary>
/// <param name="years">年</param>
/// <param name="months">月</param>
public static List<Model.WBS_CostControlDetail> GetTotalWBS_CostControlDetailsByYearMonth2(string costControlId, DateTime months)
{
return (from x in Funs.DB.WBS_CostControlDetail where x.CostControlId == costControlId && x.Months <= months select x).ToList();
}
/// <summary>
/// 根据CostControlId月获取所有月份的对应费控项明细信息集合
/// </summary>
/// <param name="costControlId">costControlId</param>
public static List<Model.WBS_CostControlDetail> GetCostControlDetailsByCostControlId(string costControlId)
{
return (from x in Funs.DB.WBS_CostControlDetail where x.CostControlId == costControlId orderby x.Months select x).ToList();
}
/// <summary>
/// 增加费控项明细
/// </summary>
/// <param name="user">费控项明细</param>
public static void AddCostControlDetail(Model.WBS_CostControlDetail costControlDetail)
{
Model.SGGLDB db = Funs.DB;
Model.WBS_CostControlDetail newWBS_CostControlDetail = new Model.WBS_CostControlDetail();
newWBS_CostControlDetail.CostControlDetailId = costControlDetail.CostControlDetailId;
newWBS_CostControlDetail.CostControlId = costControlDetail.CostControlId;
newWBS_CostControlDetail.Months = costControlDetail.Months;
newWBS_CostControlDetail.PlanNum = costControlDetail.PlanNum;
newWBS_CostControlDetail.ThisNum = costControlDetail.ThisNum;
db.WBS_CostControlDetail.InsertOnSubmit(newWBS_CostControlDetail);
db.SubmitChanges();
}
/// <summary>
/// 修改费控项明细
/// </summary>
/// <param name="user">费控项明细</param>
public static void UpdateCostControlDetail(Model.WBS_CostControlDetail costControlDetail)
{
Model.SGGLDB db = Funs.DB;
Model.WBS_CostControlDetail newWBS_CostControlDetail = db.WBS_CostControlDetail.First(e => e.CostControlDetailId == costControlDetail.CostControlDetailId);
newWBS_CostControlDetail.PlanNum = costControlDetail.PlanNum;
newWBS_CostControlDetail.ThisNum = costControlDetail.ThisNum;
db.SubmitChanges();
}
/// <summary>
/// 根据Id删除费控项明细信息
/// </summary>
/// <param name="userId"></param>
public static void DeleteCostControlDetail(string costControlDetailId)
{
Model.SGGLDB db = Funs.DB;
Model.WBS_CostControlDetail ins = db.WBS_CostControlDetail.First(e => e.CostControlDetailId == costControlDetailId);
db.WBS_CostControlDetail.DeleteOnSubmit(ins);
db.SubmitChanges();
}
/// <summary>
/// 根据costControlId删除费控项明细信息
/// </summary>
/// <param name="userId"></param>
public static void DeleteCostControlDetailByCostControlId(string costControlId)
{
Model.SGGLDB db = Funs.DB;
var details = from x in db.WBS_CostControlDetail where x.CostControlId == costControlId select x;
if (details.Count() > 0)
{
db.WBS_CostControlDetail.DeleteAllOnSubmit(details);
db.SubmitChanges();
}
}
}
}
@@ -0,0 +1,65 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BLL
{
public class CostControlInitService
{
/// <summary>
/// 根据费控项Id获取费控项信息
/// </summary>
/// <param name="unitProjectId">费控项Id</param>
/// <returns></returns>
public static Model.WBS_CostControlInit GetCostControlInitByCostControlInitId(string costControlInitId)
{
return Funs.DB.WBS_CostControlInit.FirstOrDefault(e => e.CostControlInitId.ToString() == costControlInitId);
}
/// <summary>
/// 增加费控项
/// </summary>
/// <param name="user">费控项</param>
public static void AddCostControlInit(Model.WBS_CostControlInit costControlInit)
{
Model.SGGLDB db = Funs.DB;
Model.WBS_CostControlInit newUP = new Model.WBS_CostControlInit();
newUP.CostControlInitId = SQLHelper.GetNewID();
newUP.CostControlInitCode = costControlInit.CostControlInitCode;
newUP.CostControlInitName = costControlInit.CostControlInitName;
newUP.Unit = costControlInit.Unit;
db.WBS_CostControlInit.InsertOnSubmit(newUP);
db.SubmitChanges();
}
/// <summary>
/// 修改费控项信息
/// </summary>
/// <param name="user">费控项信息</param>
public static void UpdateCostControlInit(Model.WBS_CostControlInit costControlInit)
{
Model.SGGLDB db = Funs.DB;
Model.WBS_CostControlInit newUP = db.WBS_CostControlInit.First(e => e.CostControlInitId == costControlInit.CostControlInitId);
newUP.CostControlInitCode = costControlInit.CostControlInitCode;
newUP.CostControlInitName = costControlInit.CostControlInitName;
newUP.Unit = costControlInit.Unit;
db.SubmitChanges();
}
/// <summary>
/// 根据Id删除费控项信息
/// </summary>
/// <param name="userId"></param>
public static void DeleteCostControlInit(string costControlInitId)
{
Model.SGGLDB db = Funs.DB;
Model.WBS_CostControlInit CnP = db.WBS_CostControlInit.First(e => e.CostControlInitId.ToString() == costControlInitId);
db.WBS_CostControlInit.DeleteOnSubmit(CnP);
db.SubmitChanges();
}
}
}
@@ -0,0 +1,146 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BLL
{
public class CostControlParentDetailService
{
/// <summary>
/// 根据Id获取一个费控项父级明细信息
/// </summary>
/// <param name="costControlParentDetailId">费控项父级明细Id</param>
public static Model.WBS_CostControlParentDetail GetCostControlParentDetailByCostControlParentDetailId(string costControlParentDetailId)
{
return Funs.DB.WBS_CostControlParentDetail.FirstOrDefault(e => e.CostControlParentDetailId == costControlParentDetailId);
}
/// <summary>
/// 根据ParentId判断是否存在费控项父级明细信息
/// </summary>
/// <param name="costControlParentId">costControlParentId</param>
public static bool IsExitCostControlParentDetailByParentId(string parentId)
{
return (from x in Funs.DB.WBS_CostControlParentDetail where x.ParentId == parentId select x).Count() > 0;
}
/// <summary>
/// 根据costControlParentId和年及月获取对应费控项父级明细信息
/// </summary>
/// <param name="costControlParentId">对应wbsId</param>
/// <param name="toFlag">对应标志</param>
/// <param name="years">年</param>
/// <param name="months">月</param>
public static Model.WBS_CostControlParentDetail GetCostControlParentDetailByParentIdAndMonths(string parentId, DateTime months)
{
return (from x in Funs.DB.WBS_CostControlParentDetail where x.ParentId == parentId && x.Months == months select x).FirstOrDefault();
}
/// <summary>
/// 根据costControlParentId和年及月获取对应费控项父级明细视图信息
/// </summary>
/// <param name="costControlParentId">对应wbsId</param>
/// <param name="toFlag">对应标志</param>
/// <param name="years">年</param>
/// <param name="months">月</param>
public static Model.View_WBS_CostControlParentDetail GetCostControlParentDetailViewByParentIdAndMonths(string parentId, DateTime months)
{
return (from x in Funs.DB.View_WBS_CostControlParentDetail where x.ParentId == parentId && x.Months == months select x).FirstOrDefault();
}
public static Model.WBS_CostControlParentDetail GetCostControlParentDetailByParentId(string parentId)
{
return (from x in Funs.DB.WBS_CostControlParentDetail where x.ParentId == parentId select x).FirstOrDefault();
}
/// <summary>
///
/// </summary>
/// <param name="costControlParentId"></param>
/// <param name="toFlag"></param>
/// <param name="months"></param>
/// <returns></returns>
public static bool IsExitWBS_CostControlParentDetailByParentIdOrMonth(string parentId, DateTime months)
{
bool result = false;
var q = Funs.DB.WBS_CostControlParentDetail.FirstOrDefault(e => e.ParentId == parentId && e.Months == months);
if (q != null)
{
result = true;
}
return result;
}
/// <summary>
/// 根据CostControlParentId月获取所有月份的对应费控项父级明细信息集合
/// </summary>
/// <param name="costControlParentId">costControlParentId</param>
public static List<Model.WBS_CostControlParentDetail> GetTotalCostControlParentDetailsByParentId(string parentId)
{
return (from x in Funs.DB.WBS_CostControlParentDetail where x.ParentId == parentId orderby x.Months select x).ToList();
}
/// <summary>
/// 增加费控项父级明细
/// </summary>
/// <param name="user">费控项父级明细</param>
public static void AddCostControlParentDetail(Model.WBS_CostControlParentDetail costControlParentDetail)
{
Model.SGGLDB db = Funs.DB;
Model.WBS_CostControlParentDetail newWBS_CostControlParentDetail = new Model.WBS_CostControlParentDetail();
newWBS_CostControlParentDetail.CostControlParentDetailId = costControlParentDetail.CostControlParentDetailId;
newWBS_CostControlParentDetail.ParentId = costControlParentDetail.ParentId;
newWBS_CostControlParentDetail.Months = costControlParentDetail.Months;
newWBS_CostControlParentDetail.ThisPlanValue = costControlParentDetail.ThisPlanValue;
newWBS_CostControlParentDetail.ThisRealCost = costControlParentDetail.ThisRealCost;
newWBS_CostControlParentDetail.ThisPlanCost = costControlParentDetail.ThisPlanCost;
db.WBS_CostControlParentDetail.InsertOnSubmit(newWBS_CostControlParentDetail);
db.SubmitChanges();
}
/// <summary>
/// 修改费控项父级明细
/// </summary>
/// <param name="user">费控项父级明细</param>
public static void UpdateCostControlParentDetail(Model.WBS_CostControlParentDetail costControlParentDetail)
{
Model.SGGLDB db = Funs.DB;
Model.WBS_CostControlParentDetail newWBS_CostControlParentDetail = db.WBS_CostControlParentDetail.First(e => e.CostControlParentDetailId == costControlParentDetail.CostControlParentDetailId);
newWBS_CostControlParentDetail.ThisPlanValue = costControlParentDetail.ThisPlanValue;
newWBS_CostControlParentDetail.ThisRealCost = costControlParentDetail.ThisRealCost;
newWBS_CostControlParentDetail.ThisPlanCost = costControlParentDetail.ThisPlanCost;
db.SubmitChanges();
}
/// <summary>
/// 根据Id删除费控项父级明细信息
/// </summary>
/// <param name="userId"></param>
public static void DeleteWBS_CostControlParentDetail(string costControlParentDetailId)
{
Model.SGGLDB db = Funs.DB;
Model.WBS_CostControlParentDetail ins = db.WBS_CostControlParentDetail.First(e => e.CostControlParentDetailId == costControlParentDetailId);
db.WBS_CostControlParentDetail.DeleteOnSubmit(ins);
db.SubmitChanges();
}
/// <summary>
/// 根据costControlParentId删除费控项父级明细信息
/// </summary>
/// <param name="userId"></param>
public static void DeleteWBS_CostControlParentDetailByCostControlParentId(string parentId)
{
Model.SGGLDB db = Funs.DB;
var details = from x in db.WBS_CostControlParentDetail where x.ParentId == parentId select x;
if (details.Count() > 0)
{
db.WBS_CostControlParentDetail.DeleteAllOnSubmit(details);
db.SubmitChanges();
}
}
}
}
+112
View File
@@ -0,0 +1,112 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BLL
{
public class CostControlService
{
/// <summary>
/// 根据费控项Id获取费控项信息
/// </summary>
/// <param name="unitProjectId">费控项Id</param>
/// <returns></returns>
public static Model.WBS_CostControl GetCostControlByCostControlId(string costControlId)
{
return Funs.DB.WBS_CostControl.FirstOrDefault(e => e.CostControlId.ToString() == costControlId);
}
/// <summary>
/// 根据费控项编号集合获取费控项信息
/// </summary>
/// <param name="costControlCodes">费控项编号集合</param>
/// <returns></returns>
public static List<Model.WBS_CostControl> GetCostControlsByCostControlCodes(List<string> costControlCodes, string wbsSetId)
{
return (from x in Funs.DB.WBS_CostControl where costControlCodes.Contains(x.CostControlCode) && x.WbsSetId == wbsSetId select x).ToList();
}
/// <summary>
/// 根据费控项编号集合获取费控项信息
/// </summary>
/// <param name="costControlCodes">费控项编号集合</param>
/// <returns></returns>
public static List<Model.WBS_CostControl> GetCostControlsByWbsSetId(string wbsSetId)
{
return (from x in Funs.DB.WBS_CostControl where x.WbsSetId == wbsSetId select x).ToList();
}
/// <summary>
/// 增加费控项
/// </summary>
/// <param name="user">费控项</param>
public static void AddCostControl(Model.WBS_CostControl costControl)
{
Model.SGGLDB db = Funs.DB;
Model.WBS_CostControl newUP = new Model.WBS_CostControl();
newUP.CostControlId = SQLHelper.GetNewID();
newUP.ProjectId = costControl.ProjectId;
newUP.WbsSetId = costControl.WbsSetId;
newUP.CostControlCode = costControl.CostControlCode;
newUP.CostControlName = costControl.CostControlName;
newUP.Unit = costControl.Unit;
newUP.TotalNum = costControl.TotalNum;
newUP.RealPrice = costControl.RealPrice;
db.WBS_CostControl.InsertOnSubmit(newUP);
db.SubmitChanges();
}
/// <summary>
/// 修改费控项信息
/// </summary>
/// <param name="user">费控项信息</param>
public static void UpdateCostControl(Model.WBS_CostControl costControl)
{
Model.SGGLDB db = Funs.DB;
Model.WBS_CostControl newUP = db.WBS_CostControl.First(e => e.CostControlId == costControl.CostControlId);
newUP.CostControlCode = costControl.CostControlCode;
newUP.CostControlName = costControl.CostControlName;
newUP.Unit = costControl.Unit;
newUP.TotalNum = costControl.TotalNum;
newUP.RealPrice = costControl.RealPrice;
newUP.PlanPrice = costControl.PlanPrice;
db.SubmitChanges();
}
/// <summary>
/// 根据Id删除费控项信息
/// </summary>
/// <param name="userId"></param>
public static void DeleteCostControl(string costControlId)
{
Model.SGGLDB db = Funs.DB;
Model.WBS_CostControl CnP = db.WBS_CostControl.First(e => e.CostControlId.ToString() == costControlId);
db.WBS_CostControl.DeleteOnSubmit(CnP);
db.SubmitChanges();
}
/// <summary>
/// 根据Id删除费控项信息
/// </summary>
/// <param name="userId"></param>
public static void DeleteCostControlByWbsSetId(string wbsSetId)
{
Model.SGGLDB db = Funs.DB;
var costControls = from x in db.WBS_CostControl where x.WbsSetId == wbsSetId select x;
if (costControls.Count() > 0)
{
foreach (var costControl in costControls)
{
BLL.CostControlDetailHistoryService.DeleteCostControlDetailHistoryByCostControlId(costControl.CostControlId);
BLL.CostControlDetailService.DeleteCostControlDetailByCostControlId(costControl.CostControlId);
}
db.WBS_CostControl.DeleteAllOnSubmit(costControls);
db.SubmitChanges();
}
}
}
}
@@ -37,6 +37,15 @@ namespace BLL
return Funs.DB.Wbs_UnitProjectInit.Where(e => e.CnProfessionId == cnProfessionId).Count();
}
/// <summary>
/// 根据专业Id获取单位工程集合信息
/// </summary>
/// <param name="unitProjectId">单位工程Id</param>
/// <returns></returns>
public static List<Model.Wbs_UnitProjectInit> GetUnitProjectInitsByCnProfessionId(string cnProfessionId)
{
return (from x in Funs.DB.Wbs_UnitProjectInit where x.CnProfessionId.ToString() == cnProfessionId orderby x.SortIndex select x).ToList();
}
/// <summary>
/// 根据单位工程Id获取子单位工程集合信息
@@ -62,6 +71,7 @@ namespace BLL
newUP.CnProfessionId = unitProjectInit.CnProfessionId;
newUP.IsIn = unitProjectInit.IsIn;
newUP.Remark = unitProjectInit.Remark;
newUP.SortIndex = unitProjectInit.SortIndex;
db.Wbs_UnitProjectInit.InsertOnSubmit(newUP);
db.SubmitChanges();
@@ -78,6 +88,7 @@ namespace BLL
newUP.UnitProjectName = unitProjectInit.UnitProjectName;
newUP.Remark = unitProjectInit.Remark;
newUP.SortIndex = unitProjectInit.SortIndex;
db.SubmitChanges();
}
+35
View File
@@ -34,6 +34,41 @@ namespace BLL
return (from x in Funs.DB.Wbs_UnitProject where x.SuperUnitProjectId == superUnitProjectId orderby x.UnitProjectCode select x).ToList();
}
/// <summary>
/// 根据专业Id和分部编号获取分部Id
/// </summary>
/// <param name="unitProjectId">专业Id</param>
/// <returns></returns>
public static List<string> GetUnitProjectIdByCnProfessionIdAndUnitProjectCode(string cnProfessionId, string unitProjectCode)
{
Model.SGGLDB db = Funs.DB;
var list = (from x in db.Wbs_UnitProject where x.CnProfessionId == cnProfessionId && x.UnitProjectCode == unitProjectCode select x.UnitProjectId).ToList();
return list;
}
/// <summary>
/// 根据装置、专业Id和分部编号获取分部Id
/// </summary>
/// <param name="unitProjectId">专业Id</param>
/// <returns></returns>
public static List<string> GetUnitProjectIdByInstallationIdAndCNCodeAndUnitProjectCode(string installationId, string cnCode, string unitProjectCode)
{
Model.SGGLDB db = Funs.DB;
string inId = string.Empty;
Model.Project_Installation ins = db.Project_Installation.FirstOrDefault(x => x.InstallationId == installationId);
if (ins.IsEnd == true)
{
inId = installationId;
}
else
{
inId = Project_InstallationService.GetEndInstallationId(installationId);
}
var cn = (from x in db.WBS_CnProfession where x.InstallationId == inId && x.OldId.ToString() == cnCode select x).FirstOrDefault();
var list = (from x in db.Wbs_UnitProject where x.CnProfessionId == cn.CnProfessionId && x.UnitProjectCode == unitProjectCode select x.UnitProjectId).ToList();
return list;
}
/// <summary>
/// 根据装置Id获取单位工程集合信息
/// </summary>
+10
View File
@@ -14,6 +14,16 @@ namespace BLL
{
public class WbsSetInitService
{
/// <summary>
/// 根据分部工程编号获取工作包集合信息
/// </summary>
/// <param name="unitProjectCode">分部工程编号</param>
/// <returns></returns>
public static List<Model.WBS_WbsSetInit> GetWbsSetInitsByUnitProjectCode(string unitProjectCode)
{
return (from x in Funs.DB.WBS_WbsSetInit where x.UnitProjectCode == unitProjectCode && x.SuperWbsSetCode == null orderby x.WbsSetCode select x).ToList();
}
/// <summary>
/// 增加分部/子分部/分项/子分项
/// </summary>
@@ -0,0 +1,98 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BLL
{
public class WbsSetMatchCostControlInitService
{
/// <summary>
/// 根据费控项对应关系Id获取费控项对应关系信息
/// </summary>
/// <param name="unitProjectId">费控项对应关系Id</param>
/// <returns></returns>
public static Model.WBS_WbsSetMatchCostControlInit GetWbsSetMatchCostControlInitByWbsSetMatchCostControlInitId(string wbsSetMatchCostControlInitId)
{
return Funs.DB.WBS_WbsSetMatchCostControlInit.FirstOrDefault(e => e.WbsSetMatchCostControlInitId.ToString() == wbsSetMatchCostControlInitId);
}
/// <summary>
/// 根据费控项对应关系Id获取费控项对应关系信息
/// </summary>
/// <param name="unitProjectId">费控项对应关系Id</param>
/// <returns></returns>
public static Model.WBS_WbsSetMatchCostControlInit GetWbsSetMatchCostControlInitByWbsSetCodeAndCostControlInitCode(string wbsSetCode, string costControlInitCode)
{
return Funs.DB.WBS_WbsSetMatchCostControlInit.FirstOrDefault(e => e.WbsSetCode == wbsSetCode && e.CostControlInitCode == costControlInitCode);
}
/// <summary>
/// 增加费控项对应关系
/// </summary>
/// <param name="user">费控项对应关系</param>
public static void AddWbsSetMatchCostControlInit(Model.WBS_WbsSetMatchCostControlInit wbsSetMatchCostControlInit)
{
Model.SGGLDB db = Funs.DB;
Model.WBS_WbsSetMatchCostControlInit newUP = new Model.WBS_WbsSetMatchCostControlInit();
newUP.WbsSetMatchCostControlInitId = wbsSetMatchCostControlInit.WbsSetMatchCostControlInitId;
newUP.WbsSetCode = wbsSetMatchCostControlInit.WbsSetCode;
newUP.CostControlInitCode = wbsSetMatchCostControlInit.CostControlInitCode;
db.WBS_WbsSetMatchCostControlInit.InsertOnSubmit(newUP);
db.SubmitChanges();
}
/// <summary>
/// 修改费控项对应关系
/// </summary>
/// <param name="user">费控项对应关系</param>
public static void UpdateWbsSetMatchCostControlInit(Model.WBS_WbsSetMatchCostControlInit wbsSetMatchCostControlInit)
{
Model.SGGLDB db = Funs.DB;
Model.WBS_WbsSetMatchCostControlInit newUP = db.WBS_WbsSetMatchCostControlInit.First(e => e.WbsSetMatchCostControlInitId == wbsSetMatchCostControlInit.WbsSetMatchCostControlInitId);
newUP.WbsSetCode = wbsSetMatchCostControlInit.WbsSetCode;
newUP.CostControlInitCode = wbsSetMatchCostControlInit.CostControlInitCode;
db.SubmitChanges();
}
/// <summary>
/// 根据Id删除费控项对应关系信息
/// </summary>
/// <param name="userId"></param>
public static void DeleteWbsSetMatchCostControlInit(string wbsSetMatchCostControlInitId)
{
Model.SGGLDB db = Funs.DB;
Model.WBS_WbsSetMatchCostControlInit CnP = db.WBS_WbsSetMatchCostControlInit.First(e => e.WbsSetMatchCostControlInitId.ToString() == wbsSetMatchCostControlInitId);
db.WBS_WbsSetMatchCostControlInit.DeleteOnSubmit(CnP);
db.SubmitChanges();
}
/// <summary>
/// 根据Id删除费控项对应关系信息
/// </summary>
/// <param name="userId"></param>
public static void DeleteWbsSetMatchCostControlInitByWbsSetCodeAndCostControlInitCode(string wbsSetCode,string costControlInitCode)
{
Model.SGGLDB db = Funs.DB;
Model.WBS_WbsSetMatchCostControlInit CnP = db.WBS_WbsSetMatchCostControlInit.First(e => e.WbsSetCode == wbsSetCode && e.CostControlInitCode== costControlInitCode);
if (CnP != null)
{
db.WBS_WbsSetMatchCostControlInit.DeleteOnSubmit(CnP);
db.SubmitChanges();
}
}
/// <summary>
/// 获取费控项对应关系下拉选项
/// </summary>
/// <returns></returns>
public static List<Model.WBS_WbsSetMatchCostControlInit> GetWbsSetMatchCostControlInits(string wbsSetCode)
{
var list = (from x in Funs.DB.WBS_WbsSetMatchCostControlInit where x.WbsSetCode == wbsSetCode orderby x.WbsSetMatchCostControlInitId select x).ToList();
return list;
}
}
}
@@ -0,0 +1,113 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BLL
{
public class WbsSetMatchCostControlService
{
/// <summary>
/// 根据费控项对应关系Id获取费控项对应关系信息
/// </summary>
/// <param name="unitProjectId">费控项对应关系Id</param>
/// <returns></returns>
public static Model.WBS_WbsSetMatchCostControl GetWbsSetMatchCostControlByWbsSetMatchCostControlId(string wbsSetMatchCostControlId)
{
return Funs.DB.WBS_WbsSetMatchCostControl.FirstOrDefault(e => e.WbsSetMatchCostControlId.ToString() == wbsSetMatchCostControlId);
}
/// <summary>
/// 根据费控项对应关系Id获取费控项对应关系信息
/// </summary>
/// <param name="unitProjectId">费控项对应关系Id</param>
/// <returns></returns>
public static Model.WBS_WbsSetMatchCostControl GetWbsSetMatchCostControlByWbsSetIdAndCostControlCode(string wbsSetId, string costControlCode)
{
return Funs.DB.WBS_WbsSetMatchCostControl.FirstOrDefault(e => e.WbsSetId == wbsSetId && e.CostControlCode == costControlCode);
}
/// <summary>
/// 增加费控项对应关系
/// </summary>
/// <param name="user">费控项对应关系</param>
public static void AddWbsSetMatchCostControl(Model.WBS_WbsSetMatchCostControl wbsSetMatchCostControl)
{
Model.SGGLDB db = Funs.DB;
Model.WBS_WbsSetMatchCostControl newUP = new Model.WBS_WbsSetMatchCostControl();
newUP.WbsSetMatchCostControlId = wbsSetMatchCostControl.WbsSetMatchCostControlId;
newUP.WbsSetId = wbsSetMatchCostControl.WbsSetId;
newUP.CostControlCode = wbsSetMatchCostControl.CostControlCode;
db.WBS_WbsSetMatchCostControl.InsertOnSubmit(newUP);
db.SubmitChanges();
}
/// <summary>
/// 修改费控项对应关系
/// </summary>
/// <param name="user">费控项对应关系</param>
public static void UpdateWbsSetMatchCostControl(Model.WBS_WbsSetMatchCostControl wbsSetMatchCostControl)
{
Model.SGGLDB db = Funs.DB;
Model.WBS_WbsSetMatchCostControl newUP = db.WBS_WbsSetMatchCostControl.First(e => e.WbsSetMatchCostControlId == wbsSetMatchCostControl.WbsSetMatchCostControlId);
newUP.WbsSetId = wbsSetMatchCostControl.WbsSetId;
newUP.CostControlCode = wbsSetMatchCostControl.CostControlCode;
db.SubmitChanges();
}
/// <summary>
/// 根据Id删除费控项对应关系信息
/// </summary>
/// <param name="userId"></param>
public static void DeleteWbsSetMatchCostControl(string wbsSetMatchCostControlId)
{
Model.SGGLDB db = Funs.DB;
Model.WBS_WbsSetMatchCostControl CnP = db.WBS_WbsSetMatchCostControl.First(e => e.WbsSetMatchCostControlId.ToString() == wbsSetMatchCostControlId);
db.WBS_WbsSetMatchCostControl.DeleteOnSubmit(CnP);
db.SubmitChanges();
}
/// <summary>
/// 根据Id删除费控项对应关系信息
/// </summary>
/// <param name="userId"></param>
public static void DeleteWbsSetMatchCostControlByWbsSetIdAndCostControlCode(string wbsSetId, string costControlCode)
{
Model.SGGLDB db = Funs.DB;
Model.WBS_WbsSetMatchCostControl CnP = db.WBS_WbsSetMatchCostControl.First(e => e.WbsSetId == wbsSetId && e.CostControlCode == costControlCode);
if (CnP != null)
{
db.WBS_WbsSetMatchCostControl.DeleteOnSubmit(CnP);
db.SubmitChanges();
}
}
/// <summary>
/// 根据Id删除费控项对应关系信息
/// </summary>
/// <param name="userId"></param>
public static void DeleteWbsSetMatchCostControlByWbsSetId(string wbsSetId)
{
Model.SGGLDB db = Funs.DB;
var CnP = from x in db.WBS_WbsSetMatchCostControl where x.WbsSetId == wbsSetId select x;
if (CnP.Count()>0)
{
db.WBS_WbsSetMatchCostControl.DeleteAllOnSubmit(CnP);
db.SubmitChanges();
}
}
/// <summary>
/// 获取费控项对应关系下拉选项
/// </summary>
/// <returns></returns>
public static List<Model.WBS_WbsSetMatchCostControl> GetWbsSetMatchCostControls(string wbsSetId)
{
var list = (from x in Funs.DB.WBS_WbsSetMatchCostControl where x.WbsSetId == wbsSetId orderby x.WbsSetMatchCostControlId select x).ToList();
return list;
}
}
}
+78 -12
View File
@@ -147,7 +147,17 @@ namespace BLL
/// <returns></returns>
public static List<Model.Wbs_WbsSet> GetWbsSetsBySuperWbsSetId(string superWbsSetId)
{
return (from x in Funs.DB.Wbs_WbsSet where x.SuperWbsSetId == superWbsSetId && x.NoShow == null orderby x.SortIndex, x.WbsSetCode select x).ToList();
return (from x in Funs.DB.Wbs_WbsSet where x.SuperWbsSetId == superWbsSetId orderby x.WbsSetCode select x).ToList();
}
/// <summary>
/// 根据上级Id获取集合
/// </summary>
/// <param name="superWbsSetId">上级Id</param>
/// <returns></returns>
public static List<Model.Wbs_WbsSet> GetApproveWbsSetsBySuperWbsSetId(string superWbsSetId)
{
return (from x in Funs.DB.Wbs_WbsSet where x.SuperWbsSetId == superWbsSetId && x.IsApprove == true orderby x.WbsSetCode select x).ToList();
}
/// <summary>
@@ -157,7 +167,7 @@ namespace BLL
/// <returns></returns>
public static List<Model.Wbs_WbsSet> GetIsChildWbsSetsBySuperWbsSetId(string superWbsSetId)
{
return (from x in Funs.DB.Wbs_WbsSet where x.SuperWbsSetId == superWbsSetId && x.IsChild == null orderby x.SortIndex, x.WbsSetCode select x).ToList();
return (from x in Funs.DB.Wbs_WbsSet where x.SuperWbsSetId == superWbsSetId && x.IsChild == null orderby x.WbsSetCode select x).ToList();
}
/// <summary>
@@ -287,16 +297,6 @@ namespace BLL
return ids;
}
/// <summary>
/// 根据上级Id获取审核批准的集合
/// </summary>
/// <param name="superWbsSetId">上级Id</param>
/// <returns></returns>
public static List<Model.Wbs_WbsSet> GetApproveWbsSetsBySuperWbsSetId(string superWbsSetId)
{
return (from x in Funs.DB.Wbs_WbsSet where x.SuperWbsSetId == superWbsSetId && x.IsApprove == true && x.NoShow == null orderby x.SortIndex, x.WbsSetCode select x).ToList();
}
/// <summary>
/// 根据分部/子分部/分项/子分项工程Id获取分部/子分部/分项/子分项工程信息
/// </summary>
@@ -306,5 +306,71 @@ namespace BLL
{
return Funs.DB.Wbs_WbsSet.FirstOrDefault(e => e.WbsSetId == wbsSetId);
}
/// <summary>
/// 根据分部/子分部/分项/子分项工程Id获取分部/子分部/分项/子分项工程信息
/// </summary>
/// <param name="unitProjectId">分部/子分部/分项/子分项工程Id</param>
/// <returns></returns>
public static Model.Wbs_WbsSet GetWbsSetByWbsSetCode(string wbsSetCode, string projectId)
{
return Funs.DB.Wbs_WbsSet.FirstOrDefault(e => e.WbsSetCode == wbsSetCode && e.ProjectId == projectId);
}
/// <summary>
/// 根据装置、专业Id和分部编号获取分部Id
/// </summary>
/// <param name="unitProjectId">专业Id</param>
/// <returns></returns>
public static List<string> GetWbsSetIdByInstallationIdAndCNCodeAndUnitProjectCodeAndWbsSetCode(string installationId, string cnCode, string unitProjectCode, string wbsSetCode)
{
Model.SGGLDB db = Funs.DB;
string inId = string.Empty;
Model.Project_Installation ins = db.Project_Installation.FirstOrDefault(x => x.InstallationId == installationId);
if (ins.IsEnd == true)
{
inId = installationId;
}
else
{
inId = Project_InstallationService.GetEndInstallationId(installationId);
}
var cn = (from x in db.WBS_CnProfession where x.InstallationId == inId && x.OldId.ToString() == cnCode select x).FirstOrDefault();
var list = (from x in db.Wbs_WbsSet
join y in db.Wbs_UnitProject
on x.UnitProjectId equals y.UnitProjectId
where x.CnProfessionId == cn.CnProfessionId && y.UnitProjectCode == unitProjectCode && x.WbsSetCode==wbsSetCode select x.WbsSetId).ToList();
return list;
}
/// <summary>
/// 根据专业Id和分部编号获取分部Id
/// </summary>
/// <param name="unitProjectId">专业Id</param>
/// <returns></returns>
public static List<string> GetWbsSetIdByCnProfessionIdAndUnitProjectCodeAndWbsSetCode(string cnProfessionId, string unitProjectCode, string wbsSetCode)
{
Model.SGGLDB db = Funs.DB;
var list = (from x in db.Wbs_WbsSet
join y in db.Wbs_UnitProject
on x.UnitProjectId equals y.UnitProjectId
where x.CnProfessionId == cnProfessionId && y.UnitProjectCode == unitProjectCode && x.WbsSetCode == wbsSetCode
select x.WbsSetId).ToList();
return list;
}
/// <summary>
/// 根据分部Id获取分部Id
/// </summary>
/// <param name="unitProjectId">专业Id</param>
/// <returns></returns>
public static List<string> GetWbsSetIdByUnitProjectIdAndWbsSetCode(string unitProjectId, string wbsSetCode)
{
Model.SGGLDB db = Funs.DB;
var list = (from x in db.Wbs_WbsSet
where x.UnitProjectId == unitProjectId && x.WbsSetCode == wbsSetCode
select x.WbsSetId).ToList();
return list;
}
}
}
@@ -0,0 +1,850 @@
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
namespace BLL
{
public static class WorkloadStatisticsService
{
/// <summary>
/// 获取模拟树表格
/// </summary>
/// <returns></returns>
public static DataTable GetTreeDataTable(string projectId, DateTime months, string cnProfessionId, string unitProjectCode, string wbsSetCode)
{
List<Model.View_WBS_CostControlDetailStatistics> CostControlDetailStatisticsList = new List<Model.View_WBS_CostControlDetailStatistics>();
DataTable table = new DataTable();
table.Columns.Add(new DataColumn("Id", typeof(String)));
table.Columns.Add(new DataColumn("SupId", typeof(String)));
table.Columns.Add(new DataColumn("Name", typeof(String)));
table.Columns.Add(new DataColumn("ProjectId", typeof(String)));
table.Columns.Add(new DataColumn("Unit", typeof(String)));
table.Columns.Add(new DataColumn("TotalNum", typeof(String)));
table.Columns.Add(new DataColumn("RealPrice", typeof(String)));
table.Columns.Add(new DataColumn("PlanNum", typeof(String)));
table.Columns.Add(new DataColumn("ThisNum", typeof(String)));
table.Columns.Add(new DataColumn("PlanPrice", typeof(String)));
table.Columns.Add(new DataColumn("ThisRealCost", typeof(String)));
table.Columns.Add(new DataColumn("ThisPlanValue", typeof(String)));
table.Columns.Add(new DataColumn("ThisPlanCost", typeof(String)));
table.Columns.Add(new DataColumn("TotalPlanNum", typeof(String)));
table.Columns.Add(new DataColumn("TotalThisNum", typeof(String)));
table.Columns.Add(new DataColumn("TotalRealCost", typeof(String)));
table.Columns.Add(new DataColumn("TotalPlanValue", typeof(String)));
table.Columns.Add(new DataColumn("TotalPlanCost", typeof(String)));
Model.SGGLDB db = Funs.DB;
var costControls = from x in db.WBS_CostControl where x.ProjectId == projectId select x;
var details = from x in db.View_WBS_CostControlDetail where x.ProjectId == projectId select x;
var parentDetails = from x in db.View_WBS_CostControlParentDetail select x;
var wbsSets = from x in db.Wbs_WbsSet where x.ProjectId == projectId select x;
var wbsSetInits = from x in db.WBS_WbsSetInit select x;
var unitProjects = from x in db.Wbs_UnitProject where x.ProjectId == projectId select x;
var unitProjectInits = from x in db.Wbs_UnitProjectInit select x;
var cnProfessions = from x in db.WBS_CnProfession where x.ProjectId == projectId select x;
var cnProfessionInits = from x in db.WBS_CnProfessionInit select x;
var installations = from x in db.Project_Installation where x.ProjectId == projectId select x;
CostControlDetailStatisticsList = (from x in db.View_WBS_CostControlDetailStatistics where x.ProjectId == projectId select x).Distinct().ToList();
DataRow row; DataRow parentRow;
#region
if (cnProfessionId == BLL.Const._Null) //全部统计
{
foreach (Model.View_WBS_CostControlDetailStatistics item in CostControlDetailStatisticsList)
{
row = table.NewRow();
row[0] = item.Id;
row[1] = item.SupId;
row[2] = item.Name;
row[3] = item.ProjectId;
Model.WBS_CostControl costControl = costControls.FirstOrDefault(x => x.CostControlId == item.Id);
if (costControl != null)
{
Model.View_WBS_CostControlDetail detail = details.FirstOrDefault(x => x.CostControlId == item.Id && x.Months == months);
if (detail != null)
{
row[4] = detail.Unit;//单位
row[5] = decimal.Round(Convert.ToDecimal(detail.TotalNum), 2);//合同工作量
row[6] = decimal.Round(Convert.ToDecimal(detail.RealPrice), 2);//成本单价
row[7] = decimal.Round(Convert.ToDecimal(detail.PlanNum), 2);//本月计划完成量
row[8] = decimal.Round(Convert.ToDecimal(detail.ThisNum), 2);//本月完成量
row[9] = decimal.Round(Convert.ToDecimal(detail.PlanPrice), 2);//控制预算单价
row[10] = decimal.Round(Convert.ToDecimal(detail.ThisRealCost), 2);//本月实际成本
row[11] = decimal.Round(Convert.ToDecimal(detail.ThisPlanValue), 2);//本月计划完成预算
row[12] = decimal.Round(Convert.ToDecimal(detail.ThisPlanCost), 2);//本月完成预算
row[13] = decimal.Round(Convert.ToDecimal(detail.TotalPlanNum), 2);//累计计划完成量
row[14] = decimal.Round(Convert.ToDecimal(detail.TotalThisNum), 2);//累计完成量
row[15] = decimal.Round(Convert.ToDecimal(detail.TotalRealCost), 2);//累计完成成本
row[16] = decimal.Round(Convert.ToDecimal(detail.TotalPlanValue), 2);//累计计划完成预算
row[17] = decimal.Round(Convert.ToDecimal(detail.TotalPlanCost), 2);//累计完成预算
}
else
{
Model.View_WBS_CostControlDetail lastDetail = details.OrderByDescending(x => x.Months).FirstOrDefault(x => x.CostControlId == item.Id);
if (lastDetail != null && lastDetail.Months <= months)
{
row[4] = lastDetail.Unit;//单位
row[5] = decimal.Round(Convert.ToDecimal(lastDetail.TotalNum), 2);//合同工作量
row[6] = decimal.Round(Convert.ToDecimal(lastDetail.RealPrice), 2);//成本单价
row[7] = decimal.Round(Convert.ToDecimal(lastDetail.PlanNum), 2);//本月计划完成量
row[8] = decimal.Round(Convert.ToDecimal(lastDetail.ThisNum), 2);//本月完成量
row[9] = decimal.Round(Convert.ToDecimal(lastDetail.PlanPrice), 2);//控制预算单价
row[13] = decimal.Round(Convert.ToDecimal(lastDetail.TotalPlanNum), 2);//累计计划完成量
row[14] = decimal.Round(Convert.ToDecimal(lastDetail.TotalThisNum), 2);//累计完成量
row[15] = decimal.Round(Convert.ToDecimal(lastDetail.TotalRealCost), 2);//累计完成成本
row[16] = decimal.Round(Convert.ToDecimal(lastDetail.TotalPlanValue), 2);//累计计划完成预算
row[17] = decimal.Round(Convert.ToDecimal(lastDetail.TotalPlanCost), 2);//累计完成预算
}
}
}
else
{
Model.View_WBS_CostControlParentDetail parentDetail = parentDetails.FirstOrDefault(x => x.ParentId == item.Id && x.Months == months);
if (parentDetail != null)
{
row[10] = decimal.Round(Convert.ToDecimal(parentDetail.ThisRealCost), 2);//本月实际成本
row[11] = decimal.Round(Convert.ToDecimal(parentDetail.ThisPlanValue), 2);//本月计划完成预算
row[12] = decimal.Round(Convert.ToDecimal(parentDetail.ThisPlanCost), 2);//本月完成预算
row[15] = decimal.Round(Convert.ToDecimal(parentDetail.TotalRealCost), 2);//累计完成成本
row[16] = decimal.Round(Convert.ToDecimal(parentDetail.TotalPlanValue), 2);//累计计划完成预算
row[17] = decimal.Round(Convert.ToDecimal(parentDetail.TotalPlanCost), 2);//累计完成预算
}
else
{
Model.View_WBS_CostControlParentDetail parentLastDetail = parentDetails.OrderByDescending(x => x.Months).FirstOrDefault(x => x.ParentId == item.Id);
if (parentLastDetail != null && parentLastDetail.Months <= months)
{
row[15] = decimal.Round(Convert.ToDecimal(parentLastDetail.TotalRealCost), 2);//累计完成成本
row[16] = decimal.Round(Convert.ToDecimal(parentLastDetail.TotalPlanValue), 2);//累计计划完成预算
row[17] = decimal.Round(Convert.ToDecimal(parentLastDetail.TotalPlanCost), 2);//累计完成预算
}
}
}
table.Rows.Add(row);
}
}
#endregion
else
{
decimal d10 = 0, d11 = 0, d12 = 0, d15 = 0, d16 = 0, d17 = 0;
#region
if (unitProjectCode == BLL.Const._Null)
{
CostControlDetailStatisticsList = (from x in CostControlDetailStatisticsList where (x.WBSType == "Installation" && x.Name != "总图") || (x.WBSType != "Installation" && x.OldCnProfessionId.ToString() == cnProfessionId) select x).ToList();
var cn = cnProfessionInits.FirstOrDefault(x => x.CnProfessionId.ToString() == cnProfessionId);
parentRow = table.NewRow();
parentRow[0] = cn.CnProfessionId.ToString();
parentRow[1] = "0";
parentRow[2] = cn.CnProfessionName;
parentRow[3] = projectId;
foreach (Model.View_WBS_CostControlDetailStatistics item in CostControlDetailStatisticsList)
{
row = table.NewRow();
row[0] = item.Id;
row[2] = item.Name;
row[3] = item.ProjectId;
if (item.WBSType == "Installation")
{
if (item.SupId == "0")
{
row[1] = cn.CnProfessionId.ToString();
}
else
{
row[1] = item.SupId;
}
string cnId = BLL.CnProfessionService.GetCnProfessionIdByInstallationIdAndOldId(item.Id, cnProfessionId);
Model.View_WBS_CostControlParentDetail parentDetail = parentDetails.FirstOrDefault(x => x.ParentId == cnId && x.Months == months);
if (parentDetail != null)
{
row[10] = decimal.Round(Convert.ToDecimal(parentDetail.ThisRealCost), 2);//本月实际成本
row[11] = decimal.Round(Convert.ToDecimal(parentDetail.ThisPlanValue), 2);//本月计划完成预算
row[12] = decimal.Round(Convert.ToDecimal(parentDetail.ThisPlanCost), 2);//本月完成预算
row[15] = decimal.Round(Convert.ToDecimal(parentDetail.TotalRealCost), 2);//累计完成成本
row[16] = decimal.Round(Convert.ToDecimal(parentDetail.TotalPlanValue), 2);//累计计划完成预算
row[17] = decimal.Round(Convert.ToDecimal(parentDetail.TotalPlanCost), 2);//累计完成预算
}
else
{
Model.View_WBS_CostControlParentDetail parentLastDetail = parentDetails.OrderByDescending(x => x.Months).FirstOrDefault(x => x.ParentId == cnId);
if (parentLastDetail != null && parentLastDetail.Months <= months)
{
row[15] = decimal.Round(Convert.ToDecimal(parentLastDetail.TotalRealCost), 2);//累计完成成本
row[16] = decimal.Round(Convert.ToDecimal(parentLastDetail.TotalPlanValue), 2);//累计计划完成预算
row[17] = decimal.Round(Convert.ToDecimal(parentLastDetail.TotalPlanCost), 2);//累计完成预算
}
}
}
else if (item.WBSType == "CnProfession")
{
row[1] = item.SupId;
Model.View_WBS_CostControlParentDetail parentDetail = parentDetails.FirstOrDefault(x => x.ParentId == item.Id && x.Months == months);
if (parentDetail != null)
{
row[10] = decimal.Round(Convert.ToDecimal(parentDetail.ThisRealCost), 2);//本月实际成本
row[11] = decimal.Round(Convert.ToDecimal(parentDetail.ThisPlanValue), 2);//本月计划完成预算
row[12] = decimal.Round(Convert.ToDecimal(parentDetail.ThisPlanCost), 2);//本月完成预算
row[15] = decimal.Round(Convert.ToDecimal(parentDetail.TotalRealCost), 2);//累计完成成本
row[16] = decimal.Round(Convert.ToDecimal(parentDetail.TotalPlanValue), 2);//累计计划完成预算
row[17] = decimal.Round(Convert.ToDecimal(parentDetail.TotalPlanCost), 2);//累计完成预算
d10 += decimal.Round(Convert.ToDecimal(parentDetail.ThisRealCost), 2);
d11 += decimal.Round(Convert.ToDecimal(parentDetail.ThisPlanValue), 2);
d12 += decimal.Round(Convert.ToDecimal(parentDetail.ThisPlanCost), 2);
d15 += decimal.Round(Convert.ToDecimal(parentDetail.TotalRealCost), 2);
d16 += decimal.Round(Convert.ToDecimal(parentDetail.TotalPlanValue), 2);
d17 += decimal.Round(Convert.ToDecimal(parentDetail.TotalPlanCost), 2);
}
else
{
Model.View_WBS_CostControlParentDetail parentLastDetail = parentDetails.OrderByDescending(x => x.Months).FirstOrDefault(x => x.ParentId == item.Id);
if (parentLastDetail != null && parentLastDetail.Months <= months)
{
row[15] = decimal.Round(Convert.ToDecimal(parentLastDetail.TotalRealCost), 2);//累计完成成本
row[16] = decimal.Round(Convert.ToDecimal(parentLastDetail.TotalPlanValue), 2);//累计计划完成预算
row[17] = decimal.Round(Convert.ToDecimal(parentLastDetail.TotalPlanCost), 2);//累计完成预算
d15 += decimal.Round(Convert.ToDecimal(parentLastDetail.TotalRealCost), 2);
d16 += decimal.Round(Convert.ToDecimal(parentLastDetail.TotalPlanValue), 2);
d17 += decimal.Round(Convert.ToDecimal(parentLastDetail.TotalPlanCost), 2);
}
}
}
else if (item.WBSType == "UnitProject")
{
row[1] = item.SupId;
Model.View_WBS_CostControlParentDetail parentDetail = parentDetails.FirstOrDefault(x => x.ParentId == item.Id && x.Months == months);
if (parentDetail != null)
{
row[10] = decimal.Round(Convert.ToDecimal(parentDetail.ThisRealCost), 2);//本月实际成本
row[11] = decimal.Round(Convert.ToDecimal(parentDetail.ThisPlanValue), 2);//本月计划完成预算
row[12] = decimal.Round(Convert.ToDecimal(parentDetail.ThisPlanCost), 2);//本月完成预算
row[15] = decimal.Round(Convert.ToDecimal(parentDetail.TotalRealCost), 2);//累计完成成本
row[16] = decimal.Round(Convert.ToDecimal(parentDetail.TotalPlanValue), 2);//累计计划完成预算
row[17] = decimal.Round(Convert.ToDecimal(parentDetail.TotalPlanCost), 2);//累计完成预算
}
else
{
Model.View_WBS_CostControlParentDetail parentLastDetail = parentDetails.OrderByDescending(x => x.Months).FirstOrDefault(x => x.ParentId == item.Id);
if (parentLastDetail != null && parentLastDetail.Months <= months)
{
row[15] = decimal.Round(Convert.ToDecimal(parentLastDetail.TotalRealCost), 2);//累计完成成本
row[16] = decimal.Round(Convert.ToDecimal(parentLastDetail.TotalPlanValue), 2);//累计计划完成预算
row[17] = decimal.Round(Convert.ToDecimal(parentLastDetail.TotalPlanCost), 2);//累计完成预算
}
}
}
else if (item.WBSType == "WbsSet")
{
row[1] = item.SupId;
Model.View_WBS_CostControlParentDetail parentDetail = parentDetails.FirstOrDefault(x => x.ParentId == item.Id && x.Months == months);
if (parentDetail != null)
{
row[10] = decimal.Round(Convert.ToDecimal(parentDetail.ThisRealCost), 2);//本月实际成本
row[11] = decimal.Round(Convert.ToDecimal(parentDetail.ThisPlanValue), 2);//本月计划完成预算
row[12] = decimal.Round(Convert.ToDecimal(parentDetail.ThisPlanCost), 2);//本月完成预算
row[15] = decimal.Round(Convert.ToDecimal(parentDetail.TotalRealCost), 2);//累计完成成本
row[16] = decimal.Round(Convert.ToDecimal(parentDetail.TotalPlanValue), 2);//累计计划完成预算
row[17] = decimal.Round(Convert.ToDecimal(parentDetail.TotalPlanCost), 2);//累计完成预算
}
else
{
Model.View_WBS_CostControlParentDetail parentLastDetail = parentDetails.OrderByDescending(x => x.Months).FirstOrDefault(x => x.ParentId == item.Id);
if (parentLastDetail != null && parentLastDetail.Months <= months)
{
row[15] = decimal.Round(Convert.ToDecimal(parentLastDetail.TotalRealCost), 2);//累计完成成本
row[16] = decimal.Round(Convert.ToDecimal(parentLastDetail.TotalPlanValue), 2);//累计计划完成预算
row[17] = decimal.Round(Convert.ToDecimal(parentLastDetail.TotalPlanCost), 2);//累计完成预算
}
}
}
else if (item.WBSType == "CostControl")
{
row[1] = item.SupId;
Model.View_WBS_CostControlDetail detail = details.FirstOrDefault(x => x.CostControlId == item.Id && x.Months == months);
if (detail != null)
{
row[4] = detail.Unit;//单位
row[5] = decimal.Round(Convert.ToDecimal(detail.TotalNum), 2);//合同工作量
row[6] = decimal.Round(Convert.ToDecimal(detail.RealPrice), 2);//成本单价
row[7] = decimal.Round(Convert.ToDecimal(detail.PlanNum), 2);//本月计划完成量
row[8] = decimal.Round(Convert.ToDecimal(detail.ThisNum), 2);//本月完成量
row[9] = decimal.Round(Convert.ToDecimal(detail.PlanPrice), 2);//控制预算单价
row[10] = decimal.Round(Convert.ToDecimal(detail.ThisRealCost), 2);//本月实际成本
row[11] = decimal.Round(Convert.ToDecimal(detail.ThisPlanValue), 2);//本月计划完成预算
row[12] = decimal.Round(Convert.ToDecimal(detail.ThisPlanCost), 2);//本月完成预算
row[13] = decimal.Round(Convert.ToDecimal(detail.TotalPlanNum), 2);//累计计划完成量
row[14] = decimal.Round(Convert.ToDecimal(detail.TotalThisNum), 2);//累计完成量
row[15] = decimal.Round(Convert.ToDecimal(detail.TotalRealCost), 2);//累计完成成本
row[16] = decimal.Round(Convert.ToDecimal(detail.TotalPlanValue), 2);//累计计划完成预算
row[17] = decimal.Round(Convert.ToDecimal(detail.TotalPlanCost), 2);//累计完成预算
}
else
{
Model.View_WBS_CostControlDetail lastDetail = details.OrderByDescending(x => x.Months).FirstOrDefault(x => x.CostControlId == item.Id);
if (lastDetail != null && lastDetail.Months <= months)
{
row[4] = lastDetail.Unit;//单位
row[5] = decimal.Round(Convert.ToDecimal(lastDetail.TotalNum), 2);//合同工作量
row[6] = decimal.Round(Convert.ToDecimal(lastDetail.RealPrice), 2);//成本单价
row[7] = decimal.Round(Convert.ToDecimal(lastDetail.PlanNum), 2);//本月计划完成量
row[8] = decimal.Round(Convert.ToDecimal(lastDetail.ThisNum), 2);//本月完成量
row[9] = decimal.Round(Convert.ToDecimal(lastDetail.PlanPrice), 2);//控制预算单价
row[13] = decimal.Round(Convert.ToDecimal(lastDetail.TotalPlanNum), 2);//累计计划完成量
row[14] = decimal.Round(Convert.ToDecimal(lastDetail.TotalThisNum), 2);//累计完成量
row[15] = decimal.Round(Convert.ToDecimal(lastDetail.TotalRealCost), 2);//累计完成成本
row[16] = decimal.Round(Convert.ToDecimal(lastDetail.TotalPlanValue), 2);//累计计划完成预算
row[17] = decimal.Round(Convert.ToDecimal(lastDetail.TotalPlanCost), 2);//累计完成预算
}
}
}
table.Rows.Add(row);
}
if (d10 != 0)
{
parentRow[10] = decimal.Round(d10, 2);//本月实际成本
parentRow[11] = decimal.Round(d11, 2);//本月计划完成预算
parentRow[12] = decimal.Round(d12, 2);//本月完成预算
parentRow[15] = decimal.Round(d15, 2);//累计完成成本
parentRow[16] = decimal.Round(d16, 2);//累计计划完成预算
parentRow[17] = decimal.Round(d17, 2);//累计完成预算
}
else
{
parentRow[15] = decimal.Round(d15, 2);//累计完成成本
parentRow[16] = decimal.Round(d16, 2);//累计计划完成预算
parentRow[17] = decimal.Round(d17, 2);//累计完成预算
}
table.Rows.Add(parentRow);
}
#endregion
#region
else if (wbsSetCode == BLL.Const._Null)
{
CostControlDetailStatisticsList = (from x in CostControlDetailStatisticsList where (x.WBSType == "Installation" && x.Name != "总图") || (x.WBSType == "CnProfession" && x.OldCnProfessionId.ToString() == cnProfessionId) || (x.WBSType != "Installation" && x.WBSType != "CnProfession" && x.OldCnProfessionId.ToString() == cnProfessionId && x.OldUnitProjectCode == unitProjectCode) select x).ToList();
var up = unitProjectInits.FirstOrDefault(x => x.UnitProjectCode == unitProjectCode);
parentRow = table.NewRow();
parentRow[0] = up.UnitProjectCode;
parentRow[1] = "0";
parentRow[2] = up.UnitProjectName;
parentRow[3] = projectId;
foreach (Model.View_WBS_CostControlDetailStatistics item in CostControlDetailStatisticsList)
{
row = table.NewRow();
row[0] = item.Id;
row[2] = item.Name;
row[3] = item.ProjectId;
if (item.WBSType == "Installation")
{
decimal ind10 = 0, ind11 = 0, ind12 = 0, ind15 = 0, ind16 = 0, ind17 = 0;
if (item.SupId == "0")
{
row[1] = up.UnitProjectCode;
}
else
{
row[1] = item.SupId;
}
List<string> unitProjectIds = BLL.UnitProjectService.GetUnitProjectIdByInstallationIdAndCNCodeAndUnitProjectCode(item.Id, cnProfessionId, unitProjectCode);
foreach (var upId in unitProjectIds)
{
Model.View_WBS_CostControlParentDetail parentDetail = parentDetails.FirstOrDefault(x => x.ParentId == upId && x.Months == months);
if (parentDetail != null)
{
ind10 += decimal.Round(Convert.ToDecimal(parentDetail.ThisRealCost), 2);
ind11 += decimal.Round(Convert.ToDecimal(parentDetail.ThisPlanValue), 2);
ind12 += decimal.Round(Convert.ToDecimal(parentDetail.ThisPlanCost), 2);
ind15 += decimal.Round(Convert.ToDecimal(parentDetail.TotalRealCost), 2);
ind16 += decimal.Round(Convert.ToDecimal(parentDetail.TotalPlanValue), 2);
ind17 += decimal.Round(Convert.ToDecimal(parentDetail.TotalPlanCost), 2);
}
else
{
Model.View_WBS_CostControlParentDetail parentLastDetail = parentDetails.OrderByDescending(x => x.Months).FirstOrDefault(x => x.ParentId == upId);
if (parentLastDetail != null && parentLastDetail.Months <= months)
{
ind15 += decimal.Round(Convert.ToDecimal(parentLastDetail.TotalRealCost), 2);
ind16 += decimal.Round(Convert.ToDecimal(parentLastDetail.TotalPlanValue), 2);
ind17 += decimal.Round(Convert.ToDecimal(parentLastDetail.TotalPlanCost), 2);
}
}
}
if (ind10 != 0)
{
row[10] = decimal.Round(ind10, 2);//本月实际成本
row[11] = decimal.Round(ind11, 2);//本月计划完成预算
row[12] = decimal.Round(ind12, 2);//本月完成预算
row[15] = decimal.Round(ind15, 2);//累计完成成本
row[16] = decimal.Round(ind16, 2);//累计计划完成预算
row[17] = decimal.Round(ind17, 2);//累计完成预算
}
else
{
if (ind15 > 0)
{
row[15] = decimal.Round(ind15, 2);//累计完成成本
}
if (ind16 > 0)
{
row[16] = decimal.Round(ind16, 2);//累计计划完成预算
}
if (ind17 > 0)
{
row[17] = decimal.Round(ind17, 2);//累计完成预算
}
}
}
else if (item.WBSType == "CnProfession")
{
decimal cnd10 = 0, cnd11 = 0, cnd12 = 0, cnd15 = 0, cnd16 = 0, cnd17 = 0;
row[1] = item.SupId;
List<string> unitProjectIds = BLL.UnitProjectService.GetUnitProjectIdByCnProfessionIdAndUnitProjectCode(item.Id, unitProjectCode);
foreach (var upId in unitProjectIds)
{
Model.View_WBS_CostControlParentDetail parentDetail = parentDetails.FirstOrDefault(x => x.ParentId == upId && x.Months == months);
if (parentDetail != null)
{
cnd10 += decimal.Round(Convert.ToDecimal(parentDetail.ThisRealCost), 2);
cnd11 += decimal.Round(Convert.ToDecimal(parentDetail.ThisPlanValue), 2);
cnd12 += decimal.Round(Convert.ToDecimal(parentDetail.ThisPlanCost), 2);
cnd15 += decimal.Round(Convert.ToDecimal(parentDetail.TotalRealCost), 2);
cnd16 += decimal.Round(Convert.ToDecimal(parentDetail.TotalPlanValue), 2);
cnd17 += decimal.Round(Convert.ToDecimal(parentDetail.TotalPlanCost), 2);
}
else
{
Model.View_WBS_CostControlParentDetail parentLastDetail = parentDetails.OrderByDescending(x => x.Months).FirstOrDefault(x => x.ParentId == upId);
if (parentLastDetail != null && parentLastDetail.Months <= months)
{
cnd15 += decimal.Round(Convert.ToDecimal(parentLastDetail.TotalRealCost), 2);
cnd16 += decimal.Round(Convert.ToDecimal(parentLastDetail.TotalPlanValue), 2);
cnd17 += decimal.Round(Convert.ToDecimal(parentLastDetail.TotalPlanCost), 2);
}
}
}
if (cnd10 != 0)
{
row[10] = decimal.Round(cnd10, 2);//本月实际成本
row[11] = decimal.Round(cnd11, 2);//本月计划完成预算
row[12] = decimal.Round(cnd12, 2);//本月完成预算
row[15] = decimal.Round(cnd15, 2);//累计完成成本
row[16] = decimal.Round(cnd16, 2);//累计计划完成预算
row[17] = decimal.Round(cnd17, 2);//累计完成预算
}
else
{
if (cnd15 > 0)
{
row[15] = decimal.Round(cnd15, 2);//累计完成成本
}
if (cnd16 > 0)
{
row[16] = decimal.Round(cnd16, 2);//累计计划完成预算
}
if (cnd17 > 0)
{
row[17] = decimal.Round(cnd17, 2);//累计完成预算
}
}
}
else if (item.WBSType == "UnitProject")
{
row[1] = item.SupId;
Model.View_WBS_CostControlParentDetail parentDetail = parentDetails.FirstOrDefault(x => x.ParentId == item.Id && x.Months == months);
if (parentDetail != null)
{
row[10] = decimal.Round(Convert.ToDecimal(parentDetail.ThisRealCost), 2);//本月实际成本
row[11] = decimal.Round(Convert.ToDecimal(parentDetail.ThisPlanValue), 2);//本月计划完成预算
row[12] = decimal.Round(Convert.ToDecimal(parentDetail.ThisPlanCost), 2);//本月完成预算
row[15] = decimal.Round(Convert.ToDecimal(parentDetail.TotalRealCost), 2);//累计完成成本
row[16] = decimal.Round(Convert.ToDecimal(parentDetail.TotalPlanValue), 2);//累计计划完成预算
row[17] = decimal.Round(Convert.ToDecimal(parentDetail.TotalPlanCost), 2);//累计完成预算
d10 += decimal.Round(Convert.ToDecimal(parentDetail.ThisRealCost), 2);
d11 += decimal.Round(Convert.ToDecimal(parentDetail.ThisPlanValue), 2);
d12 += decimal.Round(Convert.ToDecimal(parentDetail.ThisPlanCost), 2);
d15 += decimal.Round(Convert.ToDecimal(parentDetail.TotalRealCost), 2);
d16 += decimal.Round(Convert.ToDecimal(parentDetail.TotalPlanValue), 2);
d17 += decimal.Round(Convert.ToDecimal(parentDetail.TotalPlanCost), 2);
}
else
{
Model.View_WBS_CostControlParentDetail parentLastDetail = parentDetails.OrderByDescending(x => x.Months).FirstOrDefault(x => x.ParentId == item.Id);
if (parentLastDetail != null && parentLastDetail.Months <= months)
{
row[15] = decimal.Round(Convert.ToDecimal(parentLastDetail.TotalRealCost), 2);//累计完成成本
row[16] = decimal.Round(Convert.ToDecimal(parentLastDetail.TotalPlanValue), 2);//累计计划完成预算
row[17] = decimal.Round(Convert.ToDecimal(parentLastDetail.TotalPlanCost), 2);//累计完成预算
d15 += decimal.Round(Convert.ToDecimal(parentLastDetail.TotalRealCost), 2);
d16 += decimal.Round(Convert.ToDecimal(parentLastDetail.TotalPlanValue), 2);
d17 += decimal.Round(Convert.ToDecimal(parentLastDetail.TotalPlanCost), 2);
}
}
}
else if (item.WBSType == "WbsSet")
{
row[1] = item.SupId;
Model.View_WBS_CostControlParentDetail parentDetail = parentDetails.FirstOrDefault(x => x.ParentId == item.Id && x.Months == months);
if (parentDetail != null)
{
row[10] = decimal.Round(Convert.ToDecimal(parentDetail.ThisRealCost), 2);//本月实际成本
row[11] = decimal.Round(Convert.ToDecimal(parentDetail.ThisPlanValue), 2);//本月计划完成预算
row[12] = decimal.Round(Convert.ToDecimal(parentDetail.ThisPlanCost), 2);//本月完成预算
row[15] = decimal.Round(Convert.ToDecimal(parentDetail.TotalRealCost), 2);//累计完成成本
row[16] = decimal.Round(Convert.ToDecimal(parentDetail.TotalPlanValue), 2);//累计计划完成预算
row[17] = decimal.Round(Convert.ToDecimal(parentDetail.TotalPlanCost), 2);//累计完成预算
}
else
{
Model.View_WBS_CostControlParentDetail parentLastDetail = parentDetails.OrderByDescending(x => x.Months).FirstOrDefault(x => x.ParentId == item.Id);
if (parentLastDetail != null && parentLastDetail.Months <= months)
{
row[15] = decimal.Round(Convert.ToDecimal(parentLastDetail.TotalRealCost), 2);//累计完成成本
row[16] = decimal.Round(Convert.ToDecimal(parentLastDetail.TotalPlanValue), 2);//累计计划完成预算
row[17] = decimal.Round(Convert.ToDecimal(parentLastDetail.TotalPlanCost), 2);//累计完成预算
}
}
}
else if (item.WBSType == "CostControl")
{
row[1] = item.SupId;
Model.View_WBS_CostControlDetail detail = details.FirstOrDefault(x => x.CostControlId == item.Id && x.Months == months);
if (detail != null)
{
row[4] = detail.Unit;//单位
row[5] = decimal.Round(Convert.ToDecimal(detail.TotalNum), 2);//合同工作量
row[6] = decimal.Round(Convert.ToDecimal(detail.RealPrice), 2);//成本单价
row[7] = decimal.Round(Convert.ToDecimal(detail.PlanNum), 2);//本月计划完成量
row[8] = decimal.Round(Convert.ToDecimal(detail.ThisNum), 2);//本月完成量
row[9] = decimal.Round(Convert.ToDecimal(detail.PlanPrice), 2);//控制预算单价
row[10] = decimal.Round(Convert.ToDecimal(detail.ThisRealCost), 2);//本月实际成本
row[11] = decimal.Round(Convert.ToDecimal(detail.ThisPlanValue), 2);//本月计划完成预算
row[12] = decimal.Round(Convert.ToDecimal(detail.ThisPlanCost), 2);//本月完成预算
row[13] = decimal.Round(Convert.ToDecimal(detail.TotalPlanNum), 2);//累计计划完成量
row[14] = decimal.Round(Convert.ToDecimal(detail.TotalThisNum), 2);//累计完成量
row[15] = decimal.Round(Convert.ToDecimal(detail.TotalRealCost), 2);//累计完成成本
row[16] = decimal.Round(Convert.ToDecimal(detail.TotalPlanValue), 2);//累计计划完成预算
row[17] = decimal.Round(Convert.ToDecimal(detail.TotalPlanCost), 2);//累计完成预算
}
else
{
Model.View_WBS_CostControlDetail lastDetail = details.OrderByDescending(x => x.Months).FirstOrDefault(x => x.CostControlId == item.Id);
if (lastDetail != null && lastDetail.Months <= months)
{
row[4] = lastDetail.Unit;//单位
row[5] = decimal.Round(Convert.ToDecimal(lastDetail.TotalNum), 2);//合同工作量
row[6] = decimal.Round(Convert.ToDecimal(lastDetail.RealPrice), 2);//成本单价
row[7] = decimal.Round(Convert.ToDecimal(lastDetail.PlanNum), 2);//本月计划完成量
row[8] = decimal.Round(Convert.ToDecimal(lastDetail.ThisNum), 2);//本月完成量
row[9] = decimal.Round(Convert.ToDecimal(lastDetail.PlanPrice), 2);//控制预算单价
row[13] = decimal.Round(Convert.ToDecimal(lastDetail.TotalPlanNum), 2);//累计计划完成量
row[14] = decimal.Round(Convert.ToDecimal(lastDetail.TotalThisNum), 2);//累计完成量
row[15] = decimal.Round(Convert.ToDecimal(lastDetail.TotalRealCost), 2);//累计完成成本
row[16] = decimal.Round(Convert.ToDecimal(lastDetail.TotalPlanValue), 2);//累计计划完成预算
row[17] = decimal.Round(Convert.ToDecimal(lastDetail.TotalPlanCost), 2);//累计完成预算
}
}
}
table.Rows.Add(row);
}
if (d10 != 0)
{
parentRow[10] = decimal.Round(d10, 2);//本月实际成本
parentRow[11] = decimal.Round(d11, 2);//本月计划完成预算
parentRow[12] = decimal.Round(d12, 2);//本月完成预算
parentRow[15] = decimal.Round(d15, 2);//累计完成成本
parentRow[16] = decimal.Round(d16, 2);//累计计划完成预算
parentRow[17] = decimal.Round(d17, 2);//累计完成预算
}
else
{
parentRow[15] = decimal.Round(d15, 2);//累计完成成本
parentRow[16] = decimal.Round(d16, 2);//累计计划完成预算
parentRow[17] = decimal.Round(d17, 2);//累计完成预算
}
table.Rows.Add(parentRow);
}
#endregion
#region
else
{
CostControlDetailStatisticsList = (from x in CostControlDetailStatisticsList where (x.WBSType == "Installation" && x.Name != "总图") || (x.WBSType == "CnProfession" && x.OldCnProfessionId.ToString() == cnProfessionId) || (x.WBSType == "UnitProject" && x.OldCnProfessionId.ToString() == cnProfessionId && x.OldUnitProjectCode == unitProjectCode) || (x.WBSType != "Installation" && x.WBSType != "CnProfession" && x.WBSType != "UnitProject" && x.OldCnProfessionId.ToString() == cnProfessionId && x.OldUnitProjectCode == unitProjectCode && x.OldWbsSetCode == wbsSetCode) select x).ToList();
var wb = wbsSetInits.FirstOrDefault(x => x.WbsSetCode == wbsSetCode);
parentRow = table.NewRow();
parentRow[0] = wb.WbsSetCode;
parentRow[1] = "0";
parentRow[2] = wb.WbsSetName;
parentRow[3] = projectId;
foreach (Model.View_WBS_CostControlDetailStatistics item in CostControlDetailStatisticsList)
{
row = table.NewRow();
row[0] = item.Id;
row[2] = item.Name;
row[3] = item.ProjectId;
if (item.WBSType == "Installation")
{
decimal ind10 = 0, ind11 = 0, ind12 = 0, ind15 = 0, ind16 = 0, ind17 = 0;
if (item.SupId == "0")
{
row[1] = wb.WbsSetCode;
}
else
{
row[1] = item.SupId;
}
List<string> wbsSetIds = BLL.WbsSetService.GetWbsSetIdByInstallationIdAndCNCodeAndUnitProjectCodeAndWbsSetCode(item.Id, cnProfessionId, unitProjectCode, wbsSetCode);
foreach (var upId in wbsSetIds)
{
Model.View_WBS_CostControlParentDetail parentDetail = parentDetails.FirstOrDefault(x => x.ParentId == upId && x.Months == months);
if (parentDetail != null)
{
ind10 += decimal.Round(Convert.ToDecimal(parentDetail.ThisRealCost), 2);
ind11 += decimal.Round(Convert.ToDecimal(parentDetail.ThisPlanValue), 2);
ind12 += decimal.Round(Convert.ToDecimal(parentDetail.ThisPlanCost), 2);
ind15 += decimal.Round(Convert.ToDecimal(parentDetail.TotalRealCost), 2);
ind16 += decimal.Round(Convert.ToDecimal(parentDetail.TotalPlanValue), 2);
ind17 += decimal.Round(Convert.ToDecimal(parentDetail.TotalPlanCost), 2);
}
else
{
Model.View_WBS_CostControlParentDetail parentLastDetail = parentDetails.OrderByDescending(x => x.Months).FirstOrDefault(x => x.ParentId == upId);
if (parentLastDetail != null && parentLastDetail.Months <= months)
{
ind15 += decimal.Round(Convert.ToDecimal(parentLastDetail.TotalRealCost), 2);
ind16 += decimal.Round(Convert.ToDecimal(parentLastDetail.TotalPlanValue), 2);
ind17 += decimal.Round(Convert.ToDecimal(parentLastDetail.TotalPlanCost), 2);
}
}
}
if (ind10 != 0)
{
row[10] = decimal.Round(ind10, 2);//本月实际成本
row[11] = decimal.Round(ind11, 2);//本月计划完成预算
row[12] = decimal.Round(ind12, 2);//本月完成预算
row[15] = decimal.Round(ind15, 2);//累计完成成本
row[16] = decimal.Round(ind16, 2);//累计计划完成预算
row[17] = decimal.Round(ind17, 2);//累计完成预算
}
else
{
if (ind15 > 0)
{
row[15] = decimal.Round(ind15, 2);//累计完成成本
}
if (ind16 > 0)
{
row[16] = decimal.Round(ind16, 2);//累计计划完成预算
}
if (ind17 > 0)
{
row[17] = decimal.Round(ind17, 2);//累计完成预算
}
}
}
else if (item.WBSType == "CnProfession")
{
decimal cnd10 = 0, cnd11 = 0, cnd12 = 0, cnd15 = 0, cnd16 = 0, cnd17 = 0;
row[1] = item.SupId;
List<string> wbsSetIds = BLL.WbsSetService.GetWbsSetIdByCnProfessionIdAndUnitProjectCodeAndWbsSetCode(item.Id, unitProjectCode, wbsSetCode);
foreach (var upId in wbsSetIds)
{
Model.View_WBS_CostControlParentDetail parentDetail = parentDetails.FirstOrDefault(x => x.ParentId == upId && x.Months == months);
if (parentDetail != null)
{
cnd10 += decimal.Round(Convert.ToDecimal(parentDetail.ThisRealCost), 2);
cnd11 += decimal.Round(Convert.ToDecimal(parentDetail.ThisPlanValue), 2);
cnd12 += decimal.Round(Convert.ToDecimal(parentDetail.ThisPlanCost), 2);
cnd15 += decimal.Round(Convert.ToDecimal(parentDetail.TotalRealCost), 2);
cnd16 += decimal.Round(Convert.ToDecimal(parentDetail.TotalPlanValue), 2);
cnd17 += decimal.Round(Convert.ToDecimal(parentDetail.TotalPlanCost), 2);
}
else
{
Model.View_WBS_CostControlParentDetail parentLastDetail = parentDetails.OrderByDescending(x => x.Months).FirstOrDefault(x => x.ParentId == upId);
if (parentLastDetail != null && parentLastDetail.Months <= months)
{
cnd15 += decimal.Round(Convert.ToDecimal(parentLastDetail.TotalRealCost), 2);
cnd16 += decimal.Round(Convert.ToDecimal(parentLastDetail.TotalPlanValue), 2);
cnd17 += decimal.Round(Convert.ToDecimal(parentLastDetail.TotalPlanCost), 2);
}
}
}
if (cnd10 != 0)
{
row[10] = decimal.Round(cnd10, 2);//本月实际成本
row[11] = decimal.Round(cnd11, 2);//本月计划完成预算
row[12] = decimal.Round(cnd12, 2);//本月完成预算
row[15] = decimal.Round(cnd15, 2);//累计完成成本
row[16] = decimal.Round(cnd16, 2);//累计计划完成预算
row[17] = decimal.Round(cnd17, 2);//累计完成预算
}
else
{
if (cnd15 > 0)
{
row[15] = decimal.Round(cnd15, 2);//累计完成成本
}
if (cnd16 > 0)
{
row[16] = decimal.Round(cnd16, 2);//累计计划完成预算
}
if (cnd17 > 0)
{
row[17] = decimal.Round(cnd17, 2);//累计完成预算
}
}
}
else if (item.WBSType == "UnitProject")
{
decimal upd10 = 0, upd11 = 0, upd12 = 0, upd15 = 0, upd16 = 0, upd17 = 0;
row[1] = item.SupId;
List<string> wbsSetIds = BLL.WbsSetService.GetWbsSetIdByUnitProjectIdAndWbsSetCode(item.Id, wbsSetCode);
foreach (var upId in wbsSetIds)
{
Model.View_WBS_CostControlParentDetail parentDetail = parentDetails.FirstOrDefault(x => x.ParentId == upId && x.Months == months);
if (parentDetail != null)
{
upd10 += decimal.Round(Convert.ToDecimal(parentDetail.ThisRealCost), 2);
upd11 += decimal.Round(Convert.ToDecimal(parentDetail.ThisPlanValue), 2);
upd12 += decimal.Round(Convert.ToDecimal(parentDetail.ThisPlanCost), 2);
upd15 += decimal.Round(Convert.ToDecimal(parentDetail.TotalRealCost), 2);
upd16 += decimal.Round(Convert.ToDecimal(parentDetail.TotalPlanValue), 2);
upd17 += decimal.Round(Convert.ToDecimal(parentDetail.TotalPlanCost), 2);
}
else
{
Model.View_WBS_CostControlParentDetail parentLastDetail = parentDetails.OrderByDescending(x => x.Months).FirstOrDefault(x => x.ParentId == upId);
if (parentLastDetail != null && parentLastDetail.Months <= months)
{
upd15 += decimal.Round(Convert.ToDecimal(parentLastDetail.TotalRealCost), 2);
upd16 += decimal.Round(Convert.ToDecimal(parentLastDetail.TotalPlanValue), 2);
upd17 += decimal.Round(Convert.ToDecimal(parentLastDetail.TotalPlanCost), 2);
}
}
}
if (upd10 != 0)
{
row[10] = decimal.Round(upd10, 2);//本月实际成本
row[11] = decimal.Round(upd11, 2);//本月计划完成预算
row[12] = decimal.Round(upd12, 2);//本月完成预算
row[15] = decimal.Round(upd15, 2);//累计完成成本
row[16] = decimal.Round(upd16, 2);//累计计划完成预算
row[17] = decimal.Round(upd17, 2);//累计完成预算
}
else
{
if (upd15 > 0)
{
row[15] = decimal.Round(upd15, 2);//累计完成成本
}
if (upd16 > 0)
{
row[16] = decimal.Round(upd16, 2);//累计计划完成预算
}
if (upd17 > 0)
{
row[17] = decimal.Round(upd17, 2);//累计完成预算
}
}
}
else if (item.WBSType == "WbsSet")
{
row[1] = item.SupId;
var wbsSet = wbsSets.FirstOrDefault(x => x.WbsSetId == item.Id);
Model.View_WBS_CostControlParentDetail parentDetail = parentDetails.FirstOrDefault(x => x.ParentId == item.Id && x.Months == months);
if (parentDetail != null)
{
row[10] = decimal.Round(Convert.ToDecimal(parentDetail.ThisRealCost), 2);//本月实际成本
row[11] = decimal.Round(Convert.ToDecimal(parentDetail.ThisPlanValue), 2);//本月计划完成预算
row[12] = decimal.Round(Convert.ToDecimal(parentDetail.ThisPlanCost), 2);//本月完成预算
row[15] = decimal.Round(Convert.ToDecimal(parentDetail.TotalRealCost), 2);//累计完成成本
row[16] = decimal.Round(Convert.ToDecimal(parentDetail.TotalPlanValue), 2);//累计计划完成预算
row[17] = decimal.Round(Convert.ToDecimal(parentDetail.TotalPlanCost), 2);//累计完成预算
if (wbsSet.SuperWbsSetId == null) //工作包节点,累加数据
{
d10 += decimal.Round(Convert.ToDecimal(parentDetail.ThisRealCost), 2);
d11 += decimal.Round(Convert.ToDecimal(parentDetail.ThisPlanValue), 2);
d12 += decimal.Round(Convert.ToDecimal(parentDetail.ThisPlanCost), 2);
d15 += decimal.Round(Convert.ToDecimal(parentDetail.TotalRealCost), 2);
d16 += decimal.Round(Convert.ToDecimal(parentDetail.TotalPlanValue), 2);
d17 += decimal.Round(Convert.ToDecimal(parentDetail.TotalPlanCost), 2);
}
}
else
{
Model.View_WBS_CostControlParentDetail parentLastDetail = parentDetails.OrderByDescending(x => x.Months).FirstOrDefault(x => x.ParentId == item.Id);
if (parentLastDetail != null && parentLastDetail.Months <= months)
{
row[15] = decimal.Round(Convert.ToDecimal(parentLastDetail.TotalRealCost), 2);//累计完成成本
row[16] = decimal.Round(Convert.ToDecimal(parentLastDetail.TotalPlanValue), 2);//累计计划完成预算
row[17] = decimal.Round(Convert.ToDecimal(parentLastDetail.TotalPlanCost), 2);//累计完成预算
if (wbsSet.SuperWbsSetId == null) //工作包节点,累加数据
{
d15 += decimal.Round(Convert.ToDecimal(parentLastDetail.TotalRealCost), 2);
d16 += decimal.Round(Convert.ToDecimal(parentLastDetail.TotalPlanValue), 2);
d17 += decimal.Round(Convert.ToDecimal(parentLastDetail.TotalPlanCost), 2);
}
}
}
}
else if (item.WBSType == "CostControl")
{
row[1] = item.SupId;
Model.View_WBS_CostControlDetail detail = details.FirstOrDefault(x => x.CostControlId == item.Id && x.Months == months);
if (detail != null)
{
row[4] = detail.Unit;//单位
row[5] = decimal.Round(Convert.ToDecimal(detail.TotalNum), 2);//合同工作量
row[6] = decimal.Round(Convert.ToDecimal(detail.RealPrice), 2);//成本单价
row[7] = decimal.Round(Convert.ToDecimal(detail.PlanNum), 2);//本月计划完成量
row[8] = decimal.Round(Convert.ToDecimal(detail.ThisNum), 2);//本月完成量
row[9] = decimal.Round(Convert.ToDecimal(detail.PlanPrice), 2);//控制预算单价
row[10] = decimal.Round(Convert.ToDecimal(detail.ThisRealCost), 2);//本月实际成本
row[11] = decimal.Round(Convert.ToDecimal(detail.ThisPlanValue), 2);//本月计划完成预算
row[12] = decimal.Round(Convert.ToDecimal(detail.ThisPlanCost), 2);//本月完成预算
row[13] = decimal.Round(Convert.ToDecimal(detail.TotalPlanNum), 2);//累计计划完成量
row[14] = decimal.Round(Convert.ToDecimal(detail.TotalThisNum), 2);//累计完成量
row[15] = decimal.Round(Convert.ToDecimal(detail.TotalRealCost), 2);//累计完成成本
row[16] = decimal.Round(Convert.ToDecimal(detail.TotalPlanValue), 2);//累计计划完成预算
row[17] = decimal.Round(Convert.ToDecimal(detail.TotalPlanCost), 2);//累计完成预算
}
else
{
Model.View_WBS_CostControlDetail lastDetail = details.OrderByDescending(x => x.Months).FirstOrDefault(x => x.CostControlId == item.Id);
if (lastDetail != null && lastDetail.Months <= months)
{
row[4] = lastDetail.Unit;//单位
row[5] = decimal.Round(Convert.ToDecimal(lastDetail.TotalNum), 2);//合同工作量
row[6] = decimal.Round(Convert.ToDecimal(lastDetail.RealPrice), 2);//成本单价
row[7] = decimal.Round(Convert.ToDecimal(lastDetail.PlanNum), 2);//本月计划完成量
row[8] = decimal.Round(Convert.ToDecimal(lastDetail.ThisNum), 2);//本月完成量
row[9] = decimal.Round(Convert.ToDecimal(lastDetail.PlanPrice), 2);//控制预算单价
row[13] = decimal.Round(Convert.ToDecimal(lastDetail.TotalPlanNum), 2);//累计计划完成量
row[14] = decimal.Round(Convert.ToDecimal(lastDetail.TotalThisNum), 2);//累计完成量
row[15] = decimal.Round(Convert.ToDecimal(lastDetail.TotalRealCost), 2);//累计完成成本
row[16] = decimal.Round(Convert.ToDecimal(lastDetail.TotalPlanValue), 2);//累计计划完成预算
row[17] = decimal.Round(Convert.ToDecimal(lastDetail.TotalPlanCost), 2);//累计完成预算
}
}
}
table.Rows.Add(row);
}
if (d10 != 0)
{
parentRow[10] = decimal.Round(d10, 2);//本月实际成本
parentRow[11] = decimal.Round(d11, 2);//本月计划完成预算
parentRow[12] = decimal.Round(d12, 2);//本月完成预算
parentRow[15] = decimal.Round(d15, 2);//累计完成成本
parentRow[16] = decimal.Round(d16, 2);//累计计划完成预算
parentRow[17] = decimal.Round(d17, 2);//累计完成预算
}
else
{
parentRow[15] = decimal.Round(d15, 2);//累计完成成本
parentRow[16] = decimal.Round(d16, 2);//累计计划完成预算
parentRow[17] = decimal.Round(d17, 2);//累计完成预算
}
table.Rows.Add(parentRow);
}
#endregion
}
return table;
}
}
}
@@ -0,0 +1,103 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BLL
{
/// <summary>
/// 党支部基本情况明细
/// </summary>
public class BasicInformationDetailService
{
/// <summary>
/// 根据主键获取党支部基本情况明细
/// </summary>
/// <param name="basicInformationDetailId"></param>
/// <returns></returns>
public static Model.Party_BasicInformationDetail GetBasicInformationDetailById(string basicInformationDetailId)
{
return Funs.DB.Party_BasicInformationDetail.FirstOrDefault(e => e.BasicInformationDetailId == basicInformationDetailId);
}
/// <summary>
/// 根据外键获取党支部基本情况明细集合
/// </summary>
/// <param name="basicInformationId"></param>
/// <returns></returns>
public static List<Model.Party_BasicInformationDetail> GetBasicInformationDetailsById(string basicInformationId)
{
return (from x in Funs.DB.Party_BasicInformationDetail where x.BasicInformationId == basicInformationId select x).ToList();
}
/// <summary>
/// 添加党支部基本情况明细
/// </summary>
/// <param name="basicInformationDetail"></param>
public static void AddBasicInformationDetail(Model.Party_BasicInformationDetail basicInformationDetail)
{
Model.Party_BasicInformationDetail newBasicInformationDetail = new Model.Party_BasicInformationDetail
{
BasicInformationDetailId = basicInformationDetail.BasicInformationDetailId,
BasicInformationId = basicInformationDetail.BasicInformationId,
SortIndex = basicInformationDetail.SortIndex,
Name = basicInformationDetail.Name,
BirthDate = basicInformationDetail.BirthDate,
JoinPartyDate = basicInformationDetail.JoinPartyDate,
PartyPost = basicInformationDetail.PartyPost,
AdministrationPost = basicInformationDetail.AdministrationPost,
PartyPostJoinDate = basicInformationDetail.PartyPostJoinDate
};
Funs.DB.Party_BasicInformationDetail.InsertOnSubmit(newBasicInformationDetail);
Funs.DB.SubmitChanges();
}
/// <summary>
/// 修改党支部基本情况明细
/// </summary>
/// <param name="basicInformationDetail"></param>
public static void UpdateBasicInformationDetail(Model.Party_BasicInformationDetail basicInformationDetail)
{
Model.Party_BasicInformationDetail newBasicInformationDetail = Funs.DB.Party_BasicInformationDetail.FirstOrDefault(e => e.BasicInformationDetailId == basicInformationDetail.BasicInformationDetailId);
if (newBasicInformationDetail != null)
{
newBasicInformationDetail.Name = basicInformationDetail.Name;
newBasicInformationDetail.BirthDate = basicInformationDetail.BirthDate;
newBasicInformationDetail.JoinPartyDate = basicInformationDetail.JoinPartyDate;
newBasicInformationDetail.PartyPost = basicInformationDetail.PartyPost;
newBasicInformationDetail.AdministrationPost = basicInformationDetail.AdministrationPost;
newBasicInformationDetail.PartyPostJoinDate = basicInformationDetail.PartyPostJoinDate;
Funs.DB.SubmitChanges();
}
}
/// <summary>
/// 根据主键删除党支部基本情况明细
/// </summary>
/// <param name="basicInformationDetailId"></param>
public static void DeleteBasicInformationDetailById(string basicInformationDetailId)
{
Model.Party_BasicInformationDetail basicInformationDetail = Funs.DB.Party_BasicInformationDetail.FirstOrDefault(e => e.BasicInformationDetailId == basicInformationDetailId);
if (basicInformationDetail != null)
{
Funs.DB.Party_BasicInformationDetail.DeleteOnSubmit(basicInformationDetail);
Funs.DB.SubmitChanges();
}
}
/// <summary>
/// 根据主键删除党支部基本情况明细
/// </summary>
/// <param name="basicInformationId"></param>
public static void DeleteBasicInformationDetailsById(string basicInformationId)
{
var basicInformationDetails = from x in Funs.DB.Party_BasicInformationDetail where x.BasicInformationId == basicInformationId select x;
if (basicInformationDetails.Count() > 0)
{
Funs.DB.Party_BasicInformationDetail.DeleteAllOnSubmit(basicInformationDetails);
Funs.DB.SubmitChanges();
}
}
}
}
+102
View File
@@ -0,0 +1,102 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BLL
{
/// <summary>
/// 党支部基本情况
/// </summary>
public class BasicInformationService
{
/// <summary>
/// 根据主键获取党支部基本情况
/// </summary>
/// <param name="basicInformationId"></param>
/// <returns></returns>
public static Model.Party_BasicInformation GetBasicInformationById(string basicInformationId)
{
return Funs.DB.Party_BasicInformation.FirstOrDefault(e => e.BasicInformationId == basicInformationId);
}
/// <summary>
/// 根据年份获取党支部基本情况
/// </summary>
/// <param name="year"></param>
/// <returns></returns>
public static Model.Party_BasicInformation GetBasicInformationByYear(string year)
{
return Funs.DB.Party_BasicInformation.FirstOrDefault(e => e.Year == Convert.ToInt32(year));
}
/// <summary>
/// 获取最近的党支部基本情况
/// </summary>
/// <returns></returns>
public static Model.Party_BasicInformation GetOldBasicInformation()
{
return Funs.DB.Party_BasicInformation.OrderByDescending(x => x.Year).FirstOrDefault();
}
/// <summary>
/// 添加党支部基本情况
/// </summary>
/// <param name="basicInformation"></param>
public static void AddBasicInformation(Model.Party_BasicInformation basicInformation)
{
Model.Party_BasicInformation newBasicInformation = new Model.Party_BasicInformation
{
BasicInformationId = basicInformation.BasicInformationId,
Year = basicInformation.Year,
Name = basicInformation.Name,
StartDate = basicInformation.StartDate,
Component = basicInformation.Component,
PartyerNum = basicInformation.PartyerNum,
PersonNum = basicInformation.PersonNum,
PartyGroupNum = basicInformation.PartyGroupNum,
Commendation = basicInformation.Commendation,
Punishment = basicInformation.Punishment
};
Funs.DB.Party_BasicInformation.InsertOnSubmit(newBasicInformation);
Funs.DB.SubmitChanges();
}
/// <summary>
/// 修改党支部基本情况
/// </summary>
/// <param name="basicInformation"></param>
public static void UpdateBasicInformation(Model.Party_BasicInformation basicInformation)
{
Model.Party_BasicInformation newBasicInformation = Funs.DB.Party_BasicInformation.FirstOrDefault(e => e.BasicInformationId == basicInformation.BasicInformationId);
if (newBasicInformation != null)
{
newBasicInformation.Name = basicInformation.Name;
newBasicInformation.StartDate = basicInformation.StartDate;
newBasicInformation.Component = basicInformation.Component;
newBasicInformation.PartyerNum = basicInformation.PartyerNum;
newBasicInformation.PersonNum = basicInformation.PersonNum;
newBasicInformation.PartyGroupNum = basicInformation.PartyGroupNum;
newBasicInformation.Commendation = basicInformation.Commendation;
newBasicInformation.Punishment = basicInformation.Punishment;
Funs.DB.SubmitChanges();
}
}
/// <summary>
/// 根据主键删除党支部基本情况
/// </summary>
/// <param name="basicInformationId"></param>
public static void DeleteBasicInformationById(string basicInformationId)
{
Model.Party_BasicInformation basicInformation = Funs.DB.Party_BasicInformation.FirstOrDefault(e => e.BasicInformationId == basicInformationId);
if (basicInformation != null)
{
CommonService.DeleteAttachFileById(basicInformationId);
Funs.DB.Party_BasicInformation.DeleteOnSubmit(basicInformation);
Funs.DB.SubmitChanges();
}
}
}
}
+75
View File
@@ -0,0 +1,75 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BLL
{
/// <summary>
/// 民主评议党员
/// </summary>
public class CommentPartyerService
{
/// <summary>
/// 根据主键获取民主评议党员
/// </summary>
/// <param name="commentPartyerId"></param>
/// <returns></returns>
public static Model.Party_CommentPartyer GetCommentPartyerById(string commentPartyerId)
{
return Funs.DB.Party_CommentPartyer.FirstOrDefault(e => e.CommentPartyerId == commentPartyerId);
}
/// <summary>
/// 添加民主评议党员
/// </summary>
/// <param name="commentPartyer"></param>
public static void AddCommentPartyer(Model.Party_CommentPartyer commentPartyer)
{
Model.Party_CommentPartyer newCommentPartyer = new Model.Party_CommentPartyer
{
CommentPartyerId = commentPartyer.CommentPartyerId,
Year = commentPartyer.Year,
ProjectId = commentPartyer.ProjectId,
Partyers = commentPartyer.Partyers,
Host=commentPartyer.Host,
CompileMan = commentPartyer.CompileMan,
CompileDate = commentPartyer.CompileDate
};
Funs.DB.Party_CommentPartyer.InsertOnSubmit(newCommentPartyer);
Funs.DB.SubmitChanges();
}
/// <summary>
/// 修改民主评议党员
/// </summary>
/// <param name="commentPartyer"></param>
public static void UpdateCommentPartyer(Model.Party_CommentPartyer commentPartyer)
{
Model.Party_CommentPartyer newCommentPartyer = Funs.DB.Party_CommentPartyer.FirstOrDefault(e => e.CommentPartyerId == commentPartyer.CommentPartyerId);
if (newCommentPartyer != null)
{
newCommentPartyer.ProjectId = commentPartyer.ProjectId;
newCommentPartyer.Partyers = commentPartyer.Partyers;
newCommentPartyer.Host = commentPartyer.Host;
Funs.DB.SubmitChanges();
}
}
/// <summary>
/// 根据主键删除民主评议党员
/// </summary>
/// <param name="commentPartyerId"></param>
public static void DeleteCommentPartyerById(string commentPartyerId)
{
Model.Party_CommentPartyer commentPartyer = Funs.DB.Party_CommentPartyer.FirstOrDefault(e => e.CommentPartyerId == commentPartyerId);
if (commentPartyer != null)
{
CommonService.DeleteAttachFileById(commentPartyerId);
Funs.DB.Party_CommentPartyer.DeleteOnSubmit(commentPartyer);
Funs.DB.SubmitChanges();
}
}
}
}
@@ -0,0 +1,81 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BLL
{
/// <summary>
/// 为群众办实事
/// </summary>
public class DoingThingsForMassesService
{
/// <summary>
/// 根据主键获取为群众办实事
/// </summary>
/// <param name="doingThingsForMassesId"></param>
/// <returns></returns>
public static Model.Party_DoingThingsForMasses GetDoingThingsForMassesById(string doingThingsForMassesId)
{
return Funs.DB.Party_DoingThingsForMasses.FirstOrDefault(e => e.DoingThingsForMassesId == doingThingsForMassesId);
}
/// <summary>
/// 添加为群众办实事
/// </summary>
/// <param name="doingThingsForMasses"></param>
public static void AddDoingThingsForMasses(Model.Party_DoingThingsForMasses doingThingsForMasses)
{
Model.Party_DoingThingsForMasses newDoingThingsForMasses = new Model.Party_DoingThingsForMasses
{
DoingThingsForMassesId = doingThingsForMasses.DoingThingsForMassesId,
Year = doingThingsForMasses.Year,
Name = doingThingsForMasses.Name,
DifficultyDescription = doingThingsForMasses.DifficultyDescription,
DifficultyType = doingThingsForMasses.DifficultyType,
HelpProgram = doingThingsForMasses.HelpProgram,
HelpTime = doingThingsForMasses.HelpTime,
FollowUp = doingThingsForMasses.FollowUp,
CompileMan = doingThingsForMasses.CompileMan,
CompileDate = doingThingsForMasses.CompileDate
};
Funs.DB.Party_DoingThingsForMasses.InsertOnSubmit(newDoingThingsForMasses);
Funs.DB.SubmitChanges();
}
/// <summary>
/// 修改为群众办实事
/// </summary>
/// <param name="doingThingsForMasses"></param>
public static void UpdateDoingThingsForMasses(Model.Party_DoingThingsForMasses doingThingsForMasses)
{
Model.Party_DoingThingsForMasses newDoingThingsForMasses = Funs.DB.Party_DoingThingsForMasses.FirstOrDefault(e => e.DoingThingsForMassesId == doingThingsForMasses.DoingThingsForMassesId);
if (newDoingThingsForMasses != null)
{
newDoingThingsForMasses.Name = doingThingsForMasses.Name;
newDoingThingsForMasses.DifficultyDescription = doingThingsForMasses.DifficultyDescription;
newDoingThingsForMasses.DifficultyType = doingThingsForMasses.DifficultyType;
newDoingThingsForMasses.HelpProgram = doingThingsForMasses.HelpProgram;
newDoingThingsForMasses.HelpTime = doingThingsForMasses.HelpTime;
newDoingThingsForMasses.FollowUp = doingThingsForMasses.FollowUp;
Funs.DB.SubmitChanges();
}
}
/// <summary>
/// 根据主键删除为群众办实事
/// </summary>
/// <param name="doingThingsForMassesId"></param>
public static void DeleteDoingThingsForMassesById(string doingThingsForMassesId)
{
Model.Party_DoingThingsForMasses doingThingsForMasses = Funs.DB.Party_DoingThingsForMasses.FirstOrDefault(e => e.DoingThingsForMassesId == doingThingsForMassesId);
if (doingThingsForMasses != null)
{
CommonService.DeleteAttachFileById(doingThingsForMassesId);
Funs.DB.Party_DoingThingsForMasses.DeleteOnSubmit(doingThingsForMasses);
Funs.DB.SubmitChanges();
}
}
}
}
@@ -0,0 +1,75 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BLL
{
/// <summary>
/// 员工谈话记录
/// </summary>
public class EmployeeConversationRecordService
{
/// <summary>
/// 根据主键获取员工谈话记录
/// </summary>
/// <param name="employeeConversationRecordId"></param>
/// <returns></returns>
public static Model.Party_EmployeeConversationRecord GetEmployeeConversationRecordById(string employeeConversationRecordId)
{
return Funs.DB.Party_EmployeeConversationRecord.FirstOrDefault(e => e.EmployeeConversationRecordId == employeeConversationRecordId);
}
/// <summary>
/// 添加员工谈话记录
/// </summary>
/// <param name="employeeConversationRecord"></param>
public static void AddEmployeeConversationRecord(Model.Party_EmployeeConversationRecord employeeConversationRecord)
{
Model.Party_EmployeeConversationRecord newEmployeeConversationRecord = new Model.Party_EmployeeConversationRecord
{
EmployeeConversationRecordId = employeeConversationRecord.EmployeeConversationRecordId,
Year = employeeConversationRecord.Year,
Speaker = employeeConversationRecord.Speaker,
Interviewee = employeeConversationRecord.Interviewee,
ConversationDate = employeeConversationRecord.ConversationDate,
CompileMan = employeeConversationRecord.CompileMan,
CompileDate = employeeConversationRecord.CompileDate
};
Funs.DB.Party_EmployeeConversationRecord.InsertOnSubmit(newEmployeeConversationRecord);
Funs.DB.SubmitChanges();
}
/// <summary>
/// 修改员工谈话记录
/// </summary>
/// <param name="employeeConversationRecord"></param>
public static void UpdateEmployeeConversationRecord(Model.Party_EmployeeConversationRecord employeeConversationRecord)
{
Model.Party_EmployeeConversationRecord newEmployeeConversationRecord = Funs.DB.Party_EmployeeConversationRecord.FirstOrDefault(e => e.EmployeeConversationRecordId == employeeConversationRecord.EmployeeConversationRecordId);
if (newEmployeeConversationRecord != null)
{
newEmployeeConversationRecord.Speaker = employeeConversationRecord.Speaker;
newEmployeeConversationRecord.Interviewee = employeeConversationRecord.Interviewee;
newEmployeeConversationRecord.ConversationDate = employeeConversationRecord.ConversationDate;
Funs.DB.SubmitChanges();
}
}
/// <summary>
/// 根据主键删除员工谈话记录
/// </summary>
/// <param name="employeeConversationRecordId"></param>
public static void DeleteEmployeeConversationRecordById(string employeeConversationRecordId)
{
Model.Party_EmployeeConversationRecord employeeConversationRecord = Funs.DB.Party_EmployeeConversationRecord.FirstOrDefault(e => e.EmployeeConversationRecordId == employeeConversationRecordId);
if (employeeConversationRecord != null)
{
CommonService.DeleteAttachFileById(employeeConversationRecordId);
Funs.DB.Party_EmployeeConversationRecord.DeleteOnSubmit(employeeConversationRecord);
Funs.DB.SubmitChanges();
}
}
}
}
+73
View File
@@ -0,0 +1,73 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BLL
{
/// <summary>
/// 集中学习
/// </summary>
public class FocusLearnService
{
/// <summary>
/// 根据主键获取集中学习
/// </summary>
/// <param name="focusLearnId"></param>
/// <returns></returns>
public static Model.Party_FocusLearn GetFocusLearnById(string focusLearnId)
{
return Funs.DB.Party_FocusLearn.FirstOrDefault(e => e.FocusLearnId == focusLearnId);
}
/// <summary>
/// 添加集中学习
/// </summary>
/// <param name="focusLearn"></param>
public static void AddFocusLearn(Model.Party_FocusLearn focusLearn)
{
Model.Party_FocusLearn newFocusLearn = new Model.Party_FocusLearn
{
FocusLearnId = focusLearn.FocusLearnId,
Year = focusLearn.Year,
Quarter = focusLearn.Quarter,
CompileMan = focusLearn.CompileMan,
CompileDate = focusLearn.CompileDate
};
Funs.DB.Party_FocusLearn.InsertOnSubmit(newFocusLearn);
Funs.DB.SubmitChanges();
}
/// <summary>
/// 修改集中学习
/// </summary>
/// <param name="focusLearn"></param>
public static void UpdateFocusLearn(Model.Party_FocusLearn focusLearn)
{
Model.Party_FocusLearn newFocusLearn = Funs.DB.Party_FocusLearn.FirstOrDefault(e => e.FocusLearnId == focusLearn.FocusLearnId);
if (newFocusLearn != null)
{
newFocusLearn.Quarter = focusLearn.Quarter;
Funs.DB.SubmitChanges();
}
}
/// <summary>
/// 根据主键删除集中学习
/// </summary>
/// <param name="focusLearnId"></param>
public static void DeleteFocusLearnById(string focusLearnId)
{
Model.Party_FocusLearn focusLearn = Funs.DB.Party_FocusLearn.FirstOrDefault(e => e.FocusLearnId == focusLearnId);
if (focusLearn != null)
{
CommonService.DeleteAttachFileById(focusLearnId);
CommonService.DeleteAttachFileById(focusLearnId + "2");
CommonService.DeleteAttachFileById(focusLearnId + "3");
Funs.DB.Party_FocusLearn.DeleteOnSubmit(focusLearn);
Funs.DB.SubmitChanges();
}
}
}
}
-2
View File
@@ -47,8 +47,6 @@ namespace BLL
Model.Party_LastWorkSummary newLastWorkSummary = Funs.DB.Party_LastWorkSummary.FirstOrDefault(e => e.LastWorkSummaryId == lastWorkSummary.LastWorkSummaryId);
if (newLastWorkSummary != null)
{
newLastWorkSummary.CompileMan = lastWorkSummary.CompileMan;
newLastWorkSummary.CompileDate = lastWorkSummary.CompileDate;
Funs.DB.SubmitChanges();
}
}
@@ -0,0 +1,73 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BLL
{
/// <summary>
/// 新闻宣传工作
/// </summary>
public class NewsPropagandaWorkService
{
/// <summary>
/// 根据主键获取新闻宣传工作
/// </summary>
/// <param name="newsPropagandaWorkId"></param>
/// <returns></returns>
public static Model.Party_NewsPropagandaWork GetNewsPropagandaWorkById(string newsPropagandaWorkId)
{
return Funs.DB.Party_NewsPropagandaWork.FirstOrDefault(e => e.NewsPropagandaWorkId == newsPropagandaWorkId);
}
/// <summary>
/// 添加新闻宣传工作
/// </summary>
/// <param name="newsPropagandaWork"></param>
public static void AddNewsPropagandaWork(Model.Party_NewsPropagandaWork newsPropagandaWork)
{
Model.Party_NewsPropagandaWork newNewsPropagandaWork = new Model.Party_NewsPropagandaWork
{
NewsPropagandaWorkId = newsPropagandaWork.NewsPropagandaWorkId,
Year = newsPropagandaWork.Year,
NewsDate = newsPropagandaWork.NewsDate,
Author = newsPropagandaWork.Author,
CompileMan = newsPropagandaWork.CompileMan,
CompileDate = newsPropagandaWork.CompileDate
};
Funs.DB.Party_NewsPropagandaWork.InsertOnSubmit(newNewsPropagandaWork);
Funs.DB.SubmitChanges();
}
/// <summary>
/// 修改新闻宣传工作
/// </summary>
/// <param name="newsPropagandaWork"></param>
public static void UpdateNewsPropagandaWork(Model.Party_NewsPropagandaWork newsPropagandaWork)
{
Model.Party_NewsPropagandaWork newNewsPropagandaWork = Funs.DB.Party_NewsPropagandaWork.FirstOrDefault(e => e.NewsPropagandaWorkId == newsPropagandaWork.NewsPropagandaWorkId);
if (newNewsPropagandaWork != null)
{
newNewsPropagandaWork.NewsDate = newsPropagandaWork.NewsDate;
newNewsPropagandaWork.Author = newsPropagandaWork.Author;
Funs.DB.SubmitChanges();
}
}
/// <summary>
/// 根据主键删除新闻宣传工作
/// </summary>
/// <param name="newsPropagandaWorkId"></param>
public static void DeleteNewsPropagandaWorkById(string newsPropagandaWorkId)
{
Model.Party_NewsPropagandaWork newsPropagandaWork = Funs.DB.Party_NewsPropagandaWork.FirstOrDefault(e => e.NewsPropagandaWorkId == newsPropagandaWorkId);
if (newsPropagandaWork != null)
{
CommonService.DeleteAttachFileById(newsPropagandaWorkId);
Funs.DB.Party_NewsPropagandaWork.DeleteOnSubmit(newsPropagandaWork);
Funs.DB.SubmitChanges();
}
}
}
}
-2
View File
@@ -55,8 +55,6 @@ namespace BLL
newOrganizingLife.Theme = organizingLife.Theme;
newOrganizingLife.OrganizingLifeDate = organizingLife.OrganizingLifeDate;
newOrganizingLife.Partyers = organizingLife.Partyers;
newOrganizingLife.CompileMan = organizingLife.CompileMan;
newOrganizingLife.CompileDate = organizingLife.CompileDate;
Funs.DB.SubmitChanges();
}
}
-2
View File
@@ -49,8 +49,6 @@ namespace BLL
if (newPartyCommittee != null)
{
newPartyCommittee.Month = partyCommittee.Month;
newPartyCommittee.CompileMan = partyCommittee.CompileMan;
newPartyCommittee.CompileDate = partyCommittee.CompileDate;
Funs.DB.SubmitChanges();
}
}
-2
View File
@@ -49,8 +49,6 @@ namespace BLL
if (newPartyCongress != null)
{
newPartyCongress.Quarter = partyCongress.Quarter;
newPartyCongress.CompileMan = partyCongress.CompileMan;
newPartyCongress.CompileDate = partyCongress.CompileDate;
Funs.DB.SubmitChanges();
}
}
@@ -0,0 +1,75 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BLL
{
/// <summary>
/// 党史学习教育
/// </summary>
public class PartyHistoryStudyService
{
/// <summary>
/// 根据主键获取党史学习教育
/// </summary>
/// <param name="partyHistoryStudyId"></param>
/// <returns></returns>
public static Model.Party_PartyHistoryStudy GetPartyHistoryStudyById(string partyHistoryStudyId)
{
return Funs.DB.Party_PartyHistoryStudy.FirstOrDefault(e => e.PartyHistoryStudyId == partyHistoryStudyId);
}
/// <summary>
/// 添加党史学习教育
/// </summary>
/// <param name="partyHistoryStudy"></param>
public static void AddPartyHistoryStudy(Model.Party_PartyHistoryStudy partyHistoryStudy)
{
Model.Party_PartyHistoryStudy newPartyHistoryStudy = new Model.Party_PartyHistoryStudy
{
PartyHistoryStudyId = partyHistoryStudy.PartyHistoryStudyId,
Year = partyHistoryStudy.Year,
StudyDate = partyHistoryStudy.StudyDate,
Speaker = partyHistoryStudy.Speaker,
Theme = partyHistoryStudy.Theme,
CompileMan = partyHistoryStudy.CompileMan,
CompileDate = partyHistoryStudy.CompileDate
};
Funs.DB.Party_PartyHistoryStudy.InsertOnSubmit(newPartyHistoryStudy);
Funs.DB.SubmitChanges();
}
/// <summary>
/// 修改党史学习教育
/// </summary>
/// <param name="partyHistoryStudy"></param>
public static void UpdatePartyHistoryStudy(Model.Party_PartyHistoryStudy partyHistoryStudy)
{
Model.Party_PartyHistoryStudy newPartyHistoryStudy = Funs.DB.Party_PartyHistoryStudy.FirstOrDefault(e => e.PartyHistoryStudyId == partyHistoryStudy.PartyHistoryStudyId);
if (newPartyHistoryStudy != null)
{
newPartyHistoryStudy.StudyDate = partyHistoryStudy.StudyDate;
newPartyHistoryStudy.Speaker = partyHistoryStudy.Speaker;
newPartyHistoryStudy.Theme = partyHistoryStudy.Theme;
Funs.DB.SubmitChanges();
}
}
/// <summary>
/// 根据主键删除党史学习教育
/// </summary>
/// <param name="partyHistoryStudyId"></param>
public static void DeletePartyHistoryStudyById(string partyHistoryStudyId)
{
Model.Party_PartyHistoryStudy partyHistoryStudy = Funs.DB.Party_PartyHistoryStudy.FirstOrDefault(e => e.PartyHistoryStudyId == partyHistoryStudyId);
if (partyHistoryStudy != null)
{
CommonService.DeleteAttachFileById(partyHistoryStudyId);
Funs.DB.Party_PartyHistoryStudy.DeleteOnSubmit(partyHistoryStudy);
Funs.DB.SubmitChanges();
}
}
}
}
-2
View File
@@ -49,8 +49,6 @@ namespace BLL
if (newPartyLecture != null)
{
newPartyLecture.Quarter = partyLecture.Quarter;
newPartyLecture.CompileMan = partyLecture.CompileMan;
newPartyLecture.CompileDate = partyLecture.CompileDate;
Funs.DB.SubmitChanges();
}
}
-2
View File
@@ -49,8 +49,6 @@ namespace BLL
if (newPartyMeeting != null)
{
newPartyMeeting.Month = partyMeeting.Month;
newPartyMeeting.CompileMan = partyMeeting.CompileMan;
newPartyMeeting.CompileDate = partyMeeting.CompileDate;
Funs.DB.SubmitChanges();
}
}
+77
View File
@@ -0,0 +1,77 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BLL
{
/// <summary>
/// 党组织工作经费使用
/// </summary>
public class PartyMoneyUseService
{
/// <summary>
/// 根据主键获取党组织工作经费使用
/// </summary>
/// <param name="partyMoneyUseId"></param>
/// <returns></returns>
public static Model.Party_PartyMoneyUse GetPartyMoneyUseById(string partyMoneyUseId)
{
return Funs.DB.Party_PartyMoneyUse.FirstOrDefault(e => e.PartyMoneyUseId == partyMoneyUseId);
}
/// <summary>
/// 添加党组织工作经费使用
/// </summary>
/// <param name="partyMoneyUse"></param>
public static void AddPartyMoneyUse(Model.Party_PartyMoneyUse partyMoneyUse)
{
Model.Party_PartyMoneyUse newPartyMoneyUse = new Model.Party_PartyMoneyUse
{
PartyMoneyUseId = partyMoneyUse.PartyMoneyUseId,
Year = partyMoneyUse.Year,
UseDate = partyMoneyUse.UseDate,
Purpose = partyMoneyUse.Purpose,
Cost = partyMoneyUse.Cost,
Partyers = partyMoneyUse.Partyers,
CompileMan = partyMoneyUse.CompileMan,
CompileDate = partyMoneyUse.CompileDate
};
Funs.DB.Party_PartyMoneyUse.InsertOnSubmit(newPartyMoneyUse);
Funs.DB.SubmitChanges();
}
/// <summary>
/// 修改党组织工作经费使用
/// </summary>
/// <param name="partyMoneyUse"></param>
public static void UpdatePartyMoneyUse(Model.Party_PartyMoneyUse partyMoneyUse)
{
Model.Party_PartyMoneyUse newPartyMoneyUse = Funs.DB.Party_PartyMoneyUse.FirstOrDefault(e => e.PartyMoneyUseId == partyMoneyUse.PartyMoneyUseId);
if (newPartyMoneyUse != null)
{
newPartyMoneyUse.UseDate = partyMoneyUse.UseDate;
newPartyMoneyUse.Purpose = partyMoneyUse.Purpose;
newPartyMoneyUse.Cost = partyMoneyUse.Cost;
newPartyMoneyUse.Partyers = partyMoneyUse.Partyers;
Funs.DB.SubmitChanges();
}
}
/// <summary>
/// 根据主键删除党组织工作经费使用
/// </summary>
/// <param name="partyMoneyUseId"></param>
public static void DeletePartyMoneyUseById(string partyMoneyUseId)
{
Model.Party_PartyMoneyUse partyMoneyUse = Funs.DB.Party_PartyMoneyUse.FirstOrDefault(e => e.PartyMoneyUseId == partyMoneyUseId);
if (partyMoneyUse != null)
{
CommonService.DeleteAttachFileById(partyMoneyUseId);
Funs.DB.Party_PartyMoneyUse.DeleteOnSubmit(partyMoneyUse);
Funs.DB.SubmitChanges();
}
}
}
}
@@ -0,0 +1,77 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BLL
{
/// <summary>
/// 党员先锋岗、示范岗
/// </summary>
public class PartyPioneerDemonstrationService
{
/// <summary>
/// 根据主键获取党员先锋岗、示范岗
/// </summary>
/// <param name="partyPioneerDemonstrationId"></param>
/// <returns></returns>
public static Model.Party_PartyPioneerDemonstration GetPartyPioneerDemonstrationById(string partyPioneerDemonstrationId)
{
return Funs.DB.Party_PartyPioneerDemonstration.FirstOrDefault(e => e.PartyPioneerDemonstrationId == partyPioneerDemonstrationId);
}
/// <summary>
/// 添加党员先锋岗、示范岗
/// </summary>
/// <param name="partyPioneerDemonstration"></param>
public static void AddPartyPioneerDemonstration(Model.Party_PartyPioneerDemonstration partyPioneerDemonstration)
{
Model.Party_PartyPioneerDemonstration newPartyPioneerDemonstration = new Model.Party_PartyPioneerDemonstration
{
PartyPioneerDemonstrationId = partyPioneerDemonstration.PartyPioneerDemonstrationId,
Year = partyPioneerDemonstration.Year,
PartyerId = partyPioneerDemonstration.PartyerId,
Introduce = partyPioneerDemonstration.Introduce,
Deeds = partyPioneerDemonstration.Deeds,
Summary = partyPioneerDemonstration.Summary,
CompileMan = partyPioneerDemonstration.CompileMan,
CompileDate = partyPioneerDemonstration.CompileDate
};
Funs.DB.Party_PartyPioneerDemonstration.InsertOnSubmit(newPartyPioneerDemonstration);
Funs.DB.SubmitChanges();
}
/// <summary>
/// 修改党员先锋岗、示范岗
/// </summary>
/// <param name="partyPioneerDemonstration"></param>
public static void UpdatePartyPioneerDemonstration(Model.Party_PartyPioneerDemonstration partyPioneerDemonstration)
{
Model.Party_PartyPioneerDemonstration newPartyPioneerDemonstration = Funs.DB.Party_PartyPioneerDemonstration.FirstOrDefault(e => e.PartyPioneerDemonstrationId == partyPioneerDemonstration.PartyPioneerDemonstrationId);
if (newPartyPioneerDemonstration != null)
{
newPartyPioneerDemonstration.PartyerId = partyPioneerDemonstration.PartyerId;
newPartyPioneerDemonstration.Introduce = partyPioneerDemonstration.Introduce;
newPartyPioneerDemonstration.Deeds = partyPioneerDemonstration.Deeds;
newPartyPioneerDemonstration.Summary = partyPioneerDemonstration.Summary;
Funs.DB.SubmitChanges();
}
}
/// <summary>
/// 根据主键删除党员先锋岗、示范岗
/// </summary>
/// <param name="partyPioneerDemonstrationId"></param>
public static void DeletePartyPioneerDemonstrationById(string partyPioneerDemonstrationId)
{
Model.Party_PartyPioneerDemonstration partyPioneerDemonstration = Funs.DB.Party_PartyPioneerDemonstration.FirstOrDefault(e => e.PartyPioneerDemonstrationId == partyPioneerDemonstrationId);
if (partyPioneerDemonstration != null)
{
CommonService.DeleteAttachFileById(partyPioneerDemonstrationId);
Funs.DB.Party_PartyPioneerDemonstration.DeleteOnSubmit(partyPioneerDemonstration);
Funs.DB.SubmitChanges();
}
}
}
}
+168
View File
@@ -0,0 +1,168 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BLL
{
/// <summary>
/// 党员名册
/// </summary>
public class PartyerService
{
/// <summary>
/// 根据主键获取党员名册
/// </summary>
/// <param name="partyerId"></param>
/// <returns></returns>
public static Model.Party_Partyer GetPartyerById(string partyerId)
{
return Funs.DB.Party_Partyer.FirstOrDefault(e => e.PartyerId == partyerId);
}
/// <summary>
/// 添加党员名册
/// </summary>
/// <param name="partyer"></param>
public static void AddPartyer(Model.Party_Partyer partyer)
{
Model.Party_Partyer newPartyer = new Model.Party_Partyer
{
PartyerId = partyer.PartyerId,
Name = partyer.Name,
Sex = partyer.Sex,
BirthDate = partyer.BirthDate,
Education = partyer.Education,
Nation = partyer.Nation,
JoinPartyDate = partyer.JoinPartyDate,
JoinPostDate = partyer.JoinPostDate,
Post = partyer.Post,
Phone = partyer.Phone,
PartyRelationInDate = partyer.PartyRelationInDate,
PartyRelationOutDate = partyer.PartyRelationOutDate
};
Funs.DB.Party_Partyer.InsertOnSubmit(newPartyer);
Funs.DB.SubmitChanges();
}
/// <summary>
/// 修改党员名册
/// </summary>
/// <param name="partyer"></param>
public static void UpdatePartyer(Model.Party_Partyer partyer)
{
Model.Party_Partyer newPartyer = Funs.DB.Party_Partyer.FirstOrDefault(e => e.PartyerId == partyer.PartyerId);
if (newPartyer != null)
{
newPartyer.Name = partyer.Name;
newPartyer.Sex = partyer.Sex;
newPartyer.BirthDate = partyer.BirthDate;
newPartyer.Education = partyer.Education;
newPartyer.Nation = partyer.Nation;
newPartyer.JoinPartyDate = partyer.JoinPartyDate;
newPartyer.JoinPostDate = partyer.JoinPostDate;
newPartyer.Post = partyer.Post;
newPartyer.Phone = partyer.Phone;
newPartyer.PartyRelationInDate = partyer.PartyRelationInDate;
newPartyer.PartyRelationOutDate = partyer.PartyRelationOutDate;
Funs.DB.SubmitChanges();
}
}
/// <summary>
/// 根据主键删除党员名册
/// </summary>
/// <param name="partyerId"></param>
public static void DeletePartyerById(string partyerId)
{
Model.Party_Partyer partyer = Funs.DB.Party_Partyer.FirstOrDefault(e => e.PartyerId == partyerId);
if (partyer != null)
{
Funs.DB.Party_Partyer.DeleteOnSubmit(partyer);
Funs.DB.SubmitChanges();
}
}
/// <summary>
/// 获取党员下拉选项
/// </summary>
/// <returns></returns>
public static List<Model.Party_Partyer> GetPartyerList()
{
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
List<Model.Party_Partyer> list = new List<Model.Party_Partyer>();
list = (from x in db.Party_Partyer
orderby x.Name
select x).ToList();
return list;
}
}
/// <summary>
/// 党员下拉框
/// </summary>
/// <param name="dropName">下拉框名字</param>
/// <param name="isShowPlease">是否显示请选择</param>
public static void InitPartyerDropDownList(FineUIPro.DropDownList dropName, bool isShowPlease)
{
dropName.DataValueField = "PartyerId";
dropName.DataTextField = "Name";
dropName.DataSource = GetPartyerList();
dropName.DataBind();
if (isShowPlease)
{
Funs.FineUIPleaseSelect(dropName);
}
}
/// <summary>
/// 获取党员姓名
/// </summary>
/// <returns></returns>
public static string GetNameByPartyId(string partyId)
{
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
string name = null;
Model.Party_Partyer partyer = db.Party_Partyer.FirstOrDefault(x=>x.PartyerId== partyId);
if (partyer != null)
{
name = partyer.Name;
}
return name;
}
}
#region ID得到党员名称字符串
/// <summary>
/// 根据多党员ID得到党员名称字符串
/// </summary>
/// <param name="partyIds"></param>
/// <returns></returns>
public static string getNamesPartyIds(object partyIds)
{
string name = string.Empty;
if (partyIds != null)
{
string[] ids = partyIds.ToString().Split(',');
foreach (string id in ids)
{
var q = GetNameByPartyId(id);
if (q != null)
{
name += q + ",";
}
}
if (name != string.Empty)
{
name = name.Substring(0, name.Length - 1); ;
}
}
return name;
}
#endregion
}
}
+73
View File
@@ -0,0 +1,73 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BLL
{
/// <summary>
/// 主题党日活动
/// </summary>
public class ThemePartyDayService
{
/// <summary>
/// 根据主键获取主题党日活动
/// </summary>
/// <param name="themePartyDayId"></param>
/// <returns></returns>
public static Model.Party_ThemePartyDay GetThemePartyDayById(string themePartyDayId)
{
return Funs.DB.Party_ThemePartyDay.FirstOrDefault(e => e.ThemePartyDayId == themePartyDayId);
}
/// <summary>
/// 添加主题党日活动
/// </summary>
/// <param name="themePartyDay"></param>
public static void AddThemePartyDay(Model.Party_ThemePartyDay themePartyDay)
{
Model.Party_ThemePartyDay newThemePartyDay = new Model.Party_ThemePartyDay
{
ThemePartyDayId = themePartyDay.ThemePartyDayId,
Year = themePartyDay.Year,
ConveneDate = themePartyDay.ConveneDate,
Theme = themePartyDay.Theme,
CompileMan = themePartyDay.CompileMan,
CompileDate = themePartyDay.CompileDate
};
Funs.DB.Party_ThemePartyDay.InsertOnSubmit(newThemePartyDay);
Funs.DB.SubmitChanges();
}
/// <summary>
/// 修改主题党日活动
/// </summary>
/// <param name="themePartyDay"></param>
public static void UpdateThemePartyDay(Model.Party_ThemePartyDay themePartyDay)
{
Model.Party_ThemePartyDay newThemePartyDay = Funs.DB.Party_ThemePartyDay.FirstOrDefault(e => e.ThemePartyDayId == themePartyDay.ThemePartyDayId);
if (newThemePartyDay != null)
{
newThemePartyDay.ConveneDate = themePartyDay.ConveneDate;
newThemePartyDay.Theme = themePartyDay.Theme;
Funs.DB.SubmitChanges();
}
}
/// <summary>
/// 根据主键删除主题党日活动
/// </summary>
/// <param name="themePartyDayId"></param>
public static void DeleteThemePartyDayById(string themePartyDayId)
{
Model.Party_ThemePartyDay themePartyDay = Funs.DB.Party_ThemePartyDay.FirstOrDefault(e => e.ThemePartyDayId == themePartyDayId);
if (themePartyDay != null)
{
CommonService.DeleteAttachFileById(themePartyDayId);
Funs.DB.Party_ThemePartyDay.DeleteOnSubmit(themePartyDay);
Funs.DB.SubmitChanges();
}
}
}
}
@@ -0,0 +1,125 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BLL
{
/// <summary>
/// “两优一先”评选表
/// </summary>
public class TwoOneGoodSelectionService
{
/// <summary>
/// 根据主键获取“两优一先”评选表
/// </summary>
/// <param name="twoOneGoodSelectionId"></param>
/// <returns></returns>
public static Model.Party_TwoOneGoodSelection GetTwoOneGoodSelectionById(string twoOneGoodSelectionId)
{
return Funs.DB.Party_TwoOneGoodSelection.FirstOrDefault(e => e.TwoOneGoodSelectionId == twoOneGoodSelectionId);
}
/// <summary>
/// 根据类别获取字符串
/// </summary>
/// <param name="selectionType"></param>
/// <returns></returns>
public static string GetSelectionType(string selectionType)
{
string type = string.Empty;
if (selectionType == "1")
{
type = "优秀党员";
}
else if (selectionType == "2")
{
type = "优秀党务工作者";
}
else if (selectionType == "3")
{
type = "先进基层党支部";
}
return type;
}
/// <summary>
/// 根据主键获取当选人/党支部
/// </summary>
/// <param name="twoOneGoodSelectionId"></param>
/// <returns></returns>
public static string GetName(string twoOneGoodSelectionId)
{
string name = string.Empty;
Model.Party_TwoOneGoodSelection twoOneGoodSelection = Funs.DB.Party_TwoOneGoodSelection.FirstOrDefault(x=>x.TwoOneGoodSelectionId== twoOneGoodSelectionId);
if (twoOneGoodSelection != null)
{
if (twoOneGoodSelection.SelectionType == "3")
{
name = twoOneGoodSelection.PartyBranch;
}
else
{
Model.Party_Partyer partyer = Funs.DB.Party_Partyer.FirstOrDefault(x=>x.PartyerId==twoOneGoodSelection.PartyerId);
if (partyer != null)
{
name = partyer.Name;
}
}
}
return name;
}
/// <summary>
/// 添加“两优一先”评选表
/// </summary>
/// <param name="twoOneGoodSelection"></param>
public static void AddTwoOneGoodSelection(Model.Party_TwoOneGoodSelection twoOneGoodSelection)
{
Model.Party_TwoOneGoodSelection newTwoOneGoodSelection = new Model.Party_TwoOneGoodSelection
{
TwoOneGoodSelectionId = twoOneGoodSelection.TwoOneGoodSelectionId,
Year = twoOneGoodSelection.Year,
SelectionType = twoOneGoodSelection.SelectionType,
PartyerId = twoOneGoodSelection.PartyerId,
PartyBranch = twoOneGoodSelection.PartyBranch,
CompileMan = twoOneGoodSelection.CompileMan,
CompileDate = twoOneGoodSelection.CompileDate
};
Funs.DB.Party_TwoOneGoodSelection.InsertOnSubmit(newTwoOneGoodSelection);
Funs.DB.SubmitChanges();
}
/// <summary>
/// 修改“两优一先”评选表
/// </summary>
/// <param name="twoOneGoodSelection"></param>
public static void UpdateTwoOneGoodSelection(Model.Party_TwoOneGoodSelection twoOneGoodSelection)
{
Model.Party_TwoOneGoodSelection newTwoOneGoodSelection = Funs.DB.Party_TwoOneGoodSelection.FirstOrDefault(e => e.TwoOneGoodSelectionId == twoOneGoodSelection.TwoOneGoodSelectionId);
if (newTwoOneGoodSelection != null)
{
newTwoOneGoodSelection.SelectionType = twoOneGoodSelection.SelectionType;
newTwoOneGoodSelection.PartyerId = twoOneGoodSelection.PartyerId;
newTwoOneGoodSelection.PartyBranch = twoOneGoodSelection.PartyBranch;
Funs.DB.SubmitChanges();
}
}
/// <summary>
/// 根据主键删除“两优一先”评选表
/// </summary>
/// <param name="twoOneGoodSelectionId"></param>
public static void DeleteTwoOneGoodSelectionById(string twoOneGoodSelectionId)
{
Model.Party_TwoOneGoodSelection twoOneGoodSelection = Funs.DB.Party_TwoOneGoodSelection.FirstOrDefault(e => e.TwoOneGoodSelectionId == twoOneGoodSelectionId);
if (twoOneGoodSelection != null)
{
CommonService.DeleteAttachFileById(twoOneGoodSelectionId);
Funs.DB.Party_TwoOneGoodSelection.DeleteOnSubmit(twoOneGoodSelection);
Funs.DB.SubmitChanges();
}
}
}
}
-2
View File
@@ -47,8 +47,6 @@ namespace BLL
Model.Party_WorkPlan newWorkPlan = Funs.DB.Party_WorkPlan.FirstOrDefault(e => e.WorkPlanId == workPlan.WorkPlanId);
if (newWorkPlan != null)
{
newWorkPlan.CompileMan = workPlan.CompileMan;
newWorkPlan.CompileDate = workPlan.CompileDate;
Funs.DB.SubmitChanges();
}
}
@@ -34,16 +34,17 @@ namespace BLL
/// <returns>true-可以,false-不可以</returns>
public static bool IsCanAddInstallation(string installationId)
{
var installation = from x in Funs.DB.Project_Installation
join y in Funs.DB.Project_Installation
on x.InstallationId equals y.SuperInstallationId
join z in Funs.DB.Project_Installation
on y.InstallationId equals z.SuperInstallationId
where z.InstallationId == installationId
select x;
if (installation.Count() > 0)
var installation = Funs.DB.Project_Installation.FirstOrDefault(x => x.InstallationId == installationId);
if (installation != null)
{
return false;
if (installation.IsEnd == true)
{
return false;
}
else
{
return true;
}
}
else
{
@@ -81,6 +82,57 @@ namespace BLL
return (from x in Funs.DB.Project_Installation where x.SuperInstallationId == superInstallationId select x).Count() > 0;
}
/// <summary>
/// 根据id获取所有父级装置id
/// </summary>
/// <param name="installationId">名称</param>
/// <returns></returns>
public static string GetParentInstallationIds(string installationId)
{
string ids = string.Empty;
var ins = Funs.DB.Project_Installation.FirstOrDefault(x => x.InstallationId == installationId);
if (ins != null)
{
ids = GetIds(ins.SuperInstallationId);
}
return ids;
}
/// <summary>
/// 根据id获取末级装置id
/// </summary>
/// <param name="installationId">名称</param>
/// <returns></returns>
public static string GetEndInstallationId(string installationId)
{
string id = string.Empty;
var ins = Funs.DB.Project_Installation.FirstOrDefault(x => x.SuperInstallationId == installationId);
if (ins.IsEnd == true)
{
id = ins.InstallationId;
}
else
{
id = GetEndInstallationId(ins.InstallationId);
}
return id;
}
private static string GetIds(string installationId)
{
string ids = string.Empty;
var ins = Funs.DB.Project_Installation.FirstOrDefault(x => x.InstallationId == installationId.Split(',')[0]);
if (ins != null)
{
ids = GetIds(ins.SuperInstallationId + "," + installationId);
}
else
{
ids = installationId;
}
return ids;
}
/// <summary>
/// 添加装置
/// </summary>
@@ -99,6 +151,7 @@ namespace BLL
newIns.Weights = installation.Weights;
newIns.WeightsMoney = installation.WeightsMoney;
newIns.Def = installation.Def;
newIns.IsEnd = installation.IsEnd;
db.Project_Installation.InsertOnSubmit(newIns);
db.SubmitChanges();
@@ -123,6 +176,7 @@ namespace BLL
newIns.Def = installation.Def;
newIns.SortIndex = installation.SortIndex;
newIns.UnitId = installation.UnitId;
newIns.IsEnd = installation.IsEnd;
db.SubmitChanges();
}