From d0440ce2fb97a80d10323f29e1db2a5d969a1eff Mon Sep 17 00:00:00 2001 From: fly-l <1420031550@qq.com> Date: Tue, 24 Oct 2023 14:23:46 +0800 Subject: [PATCH] 2023-10-24 --- .vs/SGGL_SeDin/v17/.wsuo | Bin 265216 -> 264192 bytes DataBase/版本日志/SGGLDB_V2023-10-24.sql | 3 + .../PhtglContracttrackService .cs | 55 ++ .../PhtglContracttrackprogressService.cs | 82 ++- SGGL/FineUIPro.Web/FineUIPro.Web.csproj | 8 + .../ContractTrackComparison.aspx | 18 +- .../ContractTrackComparison.aspx.cs | 64 +- .../ContractTrackComparison.aspx.designer.cs | 27 - .../ContractCompile/ContractTrackList.aspx | 195 +----- .../ContractCompile/ContractTrackList.aspx.cs | 497 +++++++------- .../ContractTrackList.aspx.designer.cs | 225 ------- .../ContractTrackProgressDetection.aspx | 44 +- .../ContractTrackProgressDetection.aspx.cs | 44 +- ...actTrackProgressDetection.aspx.designer.cs | 54 ++ .../ContractTrackProgressDetectionGrid.aspx | 87 +++ ...ContractTrackProgressDetectionGrid.aspx.cs | 604 ++++++++++++++++++ ...rackProgressDetectionGrid.aspx.designer.cs | 143 +++++ SGGL/FineUIPro.Web/common/Menu_DigData.xml | 63 +- SGGL/FineUIPro.Web/common/Menu_PHTGL.xml | 9 +- SGGL/FineUIPro.Web/common/Menu_ZHGL.xml | 37 -- 20 files changed, 1406 insertions(+), 853 deletions(-) create mode 100644 DataBase/版本日志/SGGLDB_V2023-10-24.sql create mode 100644 SGGL/FineUIPro.Web/PHTGL/ContractCompile/ContractTrackProgressDetectionGrid.aspx create mode 100644 SGGL/FineUIPro.Web/PHTGL/ContractCompile/ContractTrackProgressDetectionGrid.aspx.cs create mode 100644 SGGL/FineUIPro.Web/PHTGL/ContractCompile/ContractTrackProgressDetectionGrid.aspx.designer.cs diff --git a/.vs/SGGL_SeDin/v17/.wsuo b/.vs/SGGL_SeDin/v17/.wsuo index b7abaf608b485145db2dbe1e6478c8798dc30905..8deb1efc87ca3b79ce1806b8d50fcd1d1aea4464 100644 GIT binary patch delta 2453 zcmb8x2~<>77{KwlZw480K#)O3MI8`H*&J4J$wss=6_+%ZM03E%QWFgj1O@jNEa4WT zl`UhbttwMeR!T~{DOzD!mMxy+DbJ~6Xi)+EFAj#w>DW8x_wM)Z{pP*9yk$x^`j>9- z-!L?^lTN48(A?6}LZK4~f(6~s(;bk!MO0{GMIRZe_4f5Yd~~zZ>$r%btyC6jMPjo& zr;V4jK{l~g=IO`D13_`VIke7$+We(31dBi!kQ~_Gi{k)rv6c>$W`v?MY_P%)P10cq zoUXFerux>@8eQ0_V-s2Js#+pA?%%F1))Pll_VvVFJmnzz(#Oz=q3&{6JYzeeSxwvj zb7Z=t~FCl$;HZCONjK3Of;z*t8LO-vvVWsOe#xF=sMjAdAk5|p}|x}}LL=OVX9nX8xf|Hm@Ux3$+-4#=x@ zK(ev-nAWMhbk?kOvR1Rn+|UUoHOK82z}*mP(kdcG8QY!`HTmw`h%&v~oP376!0d|F zWL#FBJTW`ny+3T2s7N+RYqGV(#6#f=Klno}MgV1?CpJ?GmQ~dU6I;*?-O&Rf=!stF z4J$$shCT>KUqs+K^h19{B1$m3(F8Gw#Q@k4hj=6)5lKkKK%`(024e_@;(83j4X|T4 zQZWJ}aU*U*8b;w}jK&zj>W(Ey$2g3~1Wd#&n1so=6;m)3(=Z*kVFofV6SHtTX2XF@ zWMK~OKsN5gT-=4bF|UN(d@R5{Scn`f!eZQuT;w4iOHhD9EJYEDu?)+h&R2>RScz3w zjWt+{b+`}r;{lXB$gT|Q@em%y29%=$5|7|fRKkgk*o4RMIG(^}Jc+09G@gMATktHN z!&Yp=c07+4)cU_j@Dg6eE7*aZ*o7*%@hV=!ZdBuSyn#J<6K~;d?8QFR;2rG80o3AM zyodMk0Y1b>YW+VZIEYVh2!~OJBRGmr@fkixJ&xfEe2L@u3SZ*{zQMORiSO_|e!!17 zg`c3Fq>Gz3(OD|X9U&>dQ8wTl&f|Cdfkym^zoCBEMA;1W8CS<{dw7kI)&Q&0QN8ap zTDtQc|Ai;tc=hIxwq}?8sxJ=VvS}5u4PHyRPJ(QVEfR$?Z@?-s#oai`j%O0(OM^0RP_HdKwadrAA$8rKw~d(q5^!aZ^3PHoHZ*_vC-Y3c0B)>h_k%@;1$ zT%$Afkd{%oOY@VqgFen*eKlisu~l0ws&ck#&eLI;XM17=_!POmAW5Da z5>mb(&THCXKHvPG7$Qpx`$==MMb;GBon1Q^;{D=A4$e5eW6!C5YfkUoo3S=p+ZwH} fm#ODxIcFIR#g&~5*-pFOP*ZI;8fx^FUIzO=gcrp1 delta 2204 zcmcJQTWnNC7{_Nf>xhmx3aYkr+!FR-j)Ae4q;WK{coW zwSe`WMy*M@zQB{Q0nG-m5j+E^I5)h#7mZiIZtyDD1NuNe*bDZ7AP9j0upbP91K=PS z0@y+2l@L5D^6y2VCQRl0;;f)c zxeIc5Q4ggB-OJjbv#aDy;i=?G3k_s9rilXBE}k`)I8L{+n;oprC7vS3D3mj7Jqj)D z!3h;lNY`?=>uv}+f08!5l|kpT^qDM=O+BHD@r42L@VIrdt>Z;VV(Hf zoE5rN;h1yz9gJm^UKA}tzzNWR0#;xHcHjUhAQj979MRb&bJkeSto9G)q(>U?e?y$@ z%M#unA^QpZ41P`MT|@mFxDI{?H^5Es2iq3wXwA$-{i#{;WzU;g_P-nzO*y|z6a0Sj zqrr~&aCCm+>HwE$os869&{@6&Bz59>Ums5v3a%ZEu9uPgpx8*E{9(~Rx9}~ZkZVM4 zLadkCRC#yo9F12+nSqLux@R06O9)7qMH;=wixtH zVGs3o7-Y1cp)IX@qT3wfF9}JaXf+SVjLuye{nF!%c4la>rgOW?@z3DbHh_2i1)A<@ zp)0*k+STifgkxTV@Z}ZmL^4hZ6q3(*Yd?|$>m&~Hlf zy4>sQ?po1S)>&nS-O`Be6OjSKoODYkZ5!xyz$5?c>diHp@=%ID-8^Ph(_@8FnjWhv z5aldbM)Rtd8uXkyzOPxes5)WS9MpXucoHUkAEAq zk*@D+gNJvx2My%s_4bTvL^iOa%`?WiW}96t eH?P`NK|;%Co>1zvIawkNbF-#g6E3Ab)cyk5D#(`r diff --git a/DataBase/版本日志/SGGLDB_V2023-10-24.sql b/DataBase/版本日志/SGGLDB_V2023-10-24.sql new file mode 100644 index 00000000..947354a9 --- /dev/null +++ b/DataBase/版本日志/SGGLDB_V2023-10-24.sql @@ -0,0 +1,3 @@ +alter table dbo.Sys_Const + alter column ConstValue nvarchar(500) +go \ No newline at end of file diff --git a/SGGL/BLL/PHTGL/ContractCompile/PhtglContracttrackService .cs b/SGGL/BLL/PHTGL/ContractCompile/PhtglContracttrackService .cs index cf08d95d..e44b799a 100644 --- a/SGGL/BLL/PHTGL/ContractCompile/PhtglContracttrackService .cs +++ b/SGGL/BLL/PHTGL/ContractCompile/PhtglContracttrackService .cs @@ -214,6 +214,56 @@ namespace BLL PhtglContracttrackmatchwbsService.DeleteModelByContractTrackId(id); } + /// + /// 重新校验合同权重 + /// + /// + /// + public static void CheckContractWeightByContractId(string contractid ,string projectid) + { + Model.PHTGL_ContractTrack table = new Model.PHTGL_ContractTrack(); + table.ProjectId = projectid; + table.ContractId = contractid; + var list= GetPHTGL_ContractTrackByModle(table); + foreach (var item in list) + { + item .ContractWeight = GetContractWeightById(item.Id); + UpdatePHTGL_ContractTrack(item); + + } + } + /// + /// 获取清单的合同权重 + /// + /// + /// + public static string GetContractWeightById(string id ) + { + string ContractWeight = "0"; + var model = GetPHTGL_ContractTrackById(id); + if (model != null) + { + if (GetSumSettledAmountByContractId(model.ContractId, model.ProjectId) == 0) return ContractWeight; + var result = + (model.SettledAmount / GetSumSettledAmountByContractId(model.ContractId, model.ProjectId)) * 100; + ContractWeight = string.Format("{0:F}", result); + } + + return ContractWeight; + } + /// + /// 根据合同id 获取合同预算金额 + /// + public static decimal GetSumSettledAmountByContractId(string contractid, string projectid) + { + decimal SumSettledAmount = 0; + SumSettledAmount = + (from x in Funs.DB.PHTGL_ContractTrack + where x.ProjectId == projectid && x.ContractId == contractid + select x.SettledAmount ?? 0).ToList().Sum(); + return SumSettledAmount; + } + public static ResponeData ImportData(string path, string contractid, string projectid) { var responeData = new ResponeData(); @@ -252,6 +302,11 @@ namespace BLL if (string.IsNullOrEmpty(item.ProjectCode)) continue; var resultModel = GetPHTGL_ContractTrackByModle(phtglContractTrack); item.ContractNum = ContractService.GetContractById(contractid)?.ContractNum; + if (!string .IsNullOrEmpty(item.ProjectCode)&& !item.ProjectCode.Contains("-")) + { + + item.ProjectCode = item.MainItemCode + "-" + item.ProjectCode; + } if (resultModel.Any()) { item.Id = resultModel[0].Id; diff --git a/SGGL/BLL/PHTGL/ContractCompile/PhtglContracttrackprogressService.cs b/SGGL/BLL/PHTGL/ContractCompile/PhtglContracttrackprogressService.cs index 4e3841e5..4cbc8a94 100644 --- a/SGGL/BLL/PHTGL/ContractCompile/PhtglContracttrackprogressService.cs +++ b/SGGL/BLL/PHTGL/ContractCompile/PhtglContracttrackprogressService.cs @@ -1,6 +1,7 @@ using System; using System.Collections; using System.Collections.Generic; +using System.Globalization; using System.Linq; using FineUIPro; using Model; @@ -69,7 +70,15 @@ namespace BLL return Funs.DB.PHTGL_ContractTrackProgress.FirstOrDefault(x => x.ContractTrackProgressId == ContractTrackProgressId); } - + public static PHTGL_ContractTrackProgress GetPHTGL_ContractTrackProgressByTrackIdAndDate(string ContractTrackId,string date) + { + return Funs.DB.PHTGL_ContractTrackProgress.FirstOrDefault(x => + x.ContractTrackId == ContractTrackId && x.Date==date); + } + /// + /// 根据合同价格信息主键创建进度日期数据 + /// + /// public static void CreateTemplateByContractTrackId(string ContractTrackId) { var model = PhtglContractTrackService.GetPHTGL_ContractTrackById(ContractTrackId); @@ -80,7 +89,7 @@ namespace BLL { var startDate = (DateTime)contractmode.ContractStartDate; var endDate = (DateTime)contractmode.ContractEndDate; - List months = GetMonthsBetween(startDate, endDate); + List months = GetMonthsBetween(startDate, endDate);//获取合同起止日期 foreach (DateTime month in months) { @@ -101,6 +110,7 @@ namespace BLL } } } + public static List GetMonthsBetween(DateTime startDate, DateTime endDate) { List months = new List(); @@ -135,9 +145,8 @@ namespace BLL Funs.DB.SubmitChanges(); } - public static void UpdatePHTGL_ContractTrackProgress(PHTGL_ContractTrackProgress newtable) - { + { var table = Funs.DB.PHTGL_ContractTrackProgress.FirstOrDefault(x => x.ContractTrackProgressId == newtable.ContractTrackProgressId); if (table != null) @@ -154,6 +163,71 @@ namespace BLL Funs.DB.SubmitChanges(); } } + /// + /// 重新校验计算进度数据 + /// + /// + public static void CheckProgressByContractTrackId(string contractTrackId) + { + var modeContractTrack = PhtglContractTrackService.GetPHTGL_ContractTrackById(contractTrackId); + if (modeContractTrack!=null) + { + var totalCostFixedComprehensiveUnitPrice = Funs.GetNewDecimalOrZero(modeContractTrack.TotalCostFixedComprehensiveUnitPrice); //全费用综合单价 + var settledAmount = modeContractTrack.SettledAmount??0;//预算金额 + var contractWeight= Funs.GetNewDecimalOrZero(modeContractTrack.ContractWeight)==0?0: Funs.GetNewDecimalOrZero(modeContractTrack.ContractWeight)/100;//合同权重 + var quserytable = new Model.PHTGL_ContractTrackProgress(); + quserytable.ContractTrackId = contractTrackId; + var list= GetPHTGL_ContractTrackProgressByModle(quserytable); + foreach (var item in list) + { + //产值=计划工程量*全费用综合单价(来源于“费用对比统计”), + // 百分比 =(产值 / 预算金额)*合同权重 + item.ACWP_OutputValue = (item.ACWP_Quantity??0)* totalCostFixedComprehensiveUnitPrice; + if (settledAmount == 0) + { + item.ACWP_Percentage = 0; + } + else + { + item.ACWP_Percentage = Math.Round(((item.ACWP_Quantity ?? 0) / settledAmount) * contractWeight * 100, 2); + } + + item.BCWS_OutputValue = (item.BCWS_Quantity ?? 0) * totalCostFixedComprehensiveUnitPrice; + if (settledAmount == 0) + { + item.BCWS_Percentage = 0; + } + else + { + item.BCWS_Percentage = Math.Round(((item.BCWS_Quantity ?? 0) / settledAmount) * contractWeight * 100, 2) ; + } + UpdatePHTGL_ContractTrackProgress(item); + } + } + } + /// + /// 获取累计进程情况 + /// + /// + /// + public static PHTGL_ContractTrackProgress GetSumProgress(string contractTrackProgressId) + { + var result=new PHTGL_ContractTrackProgress(); + var model = GetPHTGL_ContractTrackProgressById(contractTrackProgressId); + var q = (from x in Funs.DB.PHTGL_ContractTrackProgress + where x.ContractTrackId == model.ContractTrackId && string.Compare(x.Date,model.Date)<=0 + select x).ToList(); + result.ACWP_Quantity = q.Sum(x => x.ACWP_Quantity ??0); + result.ACWP_OutputValue = q.Sum(x => x.ACWP_OutputValue ?? 0); + result.ACWP_Percentage = q.Sum(x => x.ACWP_Percentage ?? 0); + + result.BCWS_Quantity = q.Sum(x => x.BCWS_Quantity ?? 0); + result.BCWS_OutputValue = q.Sum(x => x.BCWS_OutputValue ?? 0); + result.BCWS_Percentage = q.Sum(x => x.BCWS_Percentage ?? 0); + + return result; + + } public static void DeleteModleById(string ContractTrackProgressId) { diff --git a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj index 4ce286b6..aa4510f8 100644 --- a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj +++ b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj @@ -1274,6 +1274,7 @@ + @@ -12490,6 +12491,13 @@ ContractTrackProgressDetection.aspx + + ContractTrackProgressDetectionGrid.aspx + ASPXCodeBehind + + + ContractTrackProgressDetectionGrid.aspx + ContractWBS.aspx ASPXCodeBehind diff --git a/SGGL/FineUIPro.Web/PHTGL/ContractCompile/ContractTrackComparison.aspx b/SGGL/FineUIPro.Web/PHTGL/ContractCompile/ContractTrackComparison.aspx index 1836809d..18568252 100644 --- a/SGGL/FineUIPro.Web/PHTGL/ContractCompile/ContractTrackComparison.aspx +++ b/SGGL/FineUIPro.Web/PHTGL/ContractCompile/ContractTrackComparison.aspx @@ -37,7 +37,7 @@ ClicksToEdit="1" DataIDField="Id" AllowSorting="true" SortField="Id" SortDirection="DESC" OnSort="Grid1_Sort" EnableColumnLines="true" AllowPaging="False" IsDatabasePaging="true" PageSize="10" OnPageIndexChange="Grid1_PageIndexChange" - EnableRowDoubleClickEvent="true" OnRowDoubleClick="Grid1_RowDoubleClick" OnRowClick="Grid1_OnRowClick" EnableRowClickEvent="True"> + EnableRowDoubleClickEvent="true" OnRowClick="Grid1_OnRowClick" EnableRowClickEvent="True"> @@ -47,12 +47,7 @@ - - - - + @@ -70,9 +65,6 @@ - - @@ -190,7 +182,7 @@ - @@ -232,9 +224,9 @@ - + <%-- - + --%> diff --git a/SGGL/FineUIPro.Web/PHTGL/ContractCompile/ContractTrackComparison.aspx.cs b/SGGL/FineUIPro.Web/PHTGL/ContractCompile/ContractTrackComparison.aspx.cs index a8e8e597..9cf8db00 100644 --- a/SGGL/FineUIPro.Web/PHTGL/ContractCompile/ContractTrackComparison.aspx.cs +++ b/SGGL/FineUIPro.Web/PHTGL/ContractCompile/ContractTrackComparison.aspx.cs @@ -129,23 +129,6 @@ namespace FineUIPro.Web.PHTGL.ContractCompile #endregion #region 数据编辑事件 - /// - /// 新增 - /// - /// - /// - protected void btnNew_Click(object sender, EventArgs e) - { - if (!string.IsNullOrEmpty(ContractId)) - { - PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ContractTrackEdit.aspx?Id={0}", string.Empty, "增加 - "))); - - } - else - { - ShowNotify("请选择施工分包合同!", MessageBoxIcon.Information); - } - } /// /// 编辑按钮 @@ -307,6 +290,15 @@ namespace FineUIPro.Web.PHTGL.ContractCompile PhtglContractTrackService.UpdatePHTGL_ContractTrack(model); } } + if (!string.IsNullOrEmpty(ContractId)) + { + BLL.PhtglContractTrackService.CheckContractWeightByContractId(ContractId, this.CurrUser.LoginProjectId); + } + else + { + ShowNotify("计算合同权重失败,请选择施工分包合同后重新保存", MessageBoxIcon.Question); + } + BindGrid(); } @@ -315,22 +307,6 @@ namespace FineUIPro.Web.PHTGL.ContractCompile BindGrid(); } - protected void btnGetChart_Click(object sender, EventArgs e) - { - if (!string.IsNullOrEmpty(ContractId)) - { - var model = ContractService.GetContractByContractNum(DropContractCode.SelectedValue); - if (model != null) - { - PageContext.RegisterStartupScript( - Window2.GetShowReference(string.Format("ContractTrackProgressChart.aspx?ContractId={0}", model.ContractId, "图表 - "))); - } - } - else - { - ShowNotify("请选择施工分包合同", MessageBoxIcon.Question); - } - } #endregion #region 关闭弹出窗 @@ -356,10 +332,7 @@ namespace FineUIPro.Web.PHTGL.ContractCompile var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.PersonId, BLL.Const.PHTGL_ContractTrackComparisonMenuId); if (buttonList.Count > 0) { - if (buttonList.Contains(BLL.Const.BtnAdd)) - { - this.btnNew.Hidden = false; - } + if (buttonList.Contains(BLL.Const.BtnModify)) { this.btnMenuEdit.Hidden = false; @@ -448,23 +421,6 @@ namespace FineUIPro.Web.PHTGL.ContractCompile BindGrid(); } - protected void btnImport_Click(object sender, EventArgs e) - { - if (!string.IsNullOrEmpty(ContractId)) - { - var model = ContractService.GetContractByContractNum(DropContractCode.SelectedValue); - if (model != null) - { - PageContext.RegisterStartupScript( - Window2.GetShowReference(string.Format("ContractTrackIn.aspx?ContractId={0}", model.ContractId, "导入 - "))); - } - } - else - { - ShowNotify("请选择施工分包合同", MessageBoxIcon.Question); - } - } - protected void Window3_OnClose(object sender, WindowCloseEventArgs e) { diff --git a/SGGL/FineUIPro.Web/PHTGL/ContractCompile/ContractTrackComparison.aspx.designer.cs b/SGGL/FineUIPro.Web/PHTGL/ContractCompile/ContractTrackComparison.aspx.designer.cs index 076beb91..6240e815 100644 --- a/SGGL/FineUIPro.Web/PHTGL/ContractCompile/ContractTrackComparison.aspx.designer.cs +++ b/SGGL/FineUIPro.Web/PHTGL/ContractCompile/ContractTrackComparison.aspx.designer.cs @@ -86,24 +86,6 @@ namespace FineUIPro.Web.PHTGL.ContractCompile /// protected global::FineUIPro.Label txtContractName; - /// - /// btnNew 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.Button btnNew; - - /// - /// btnImport 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.Button btnImport; - /// /// btnOut 控件。 /// @@ -158,15 +140,6 @@ namespace FineUIPro.Web.PHTGL.ContractCompile /// protected global::FineUIPro.Button btnQuery; - /// - /// btnGetChart 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.Button btnGetChart; - /// /// lblNumber 控件。 /// diff --git a/SGGL/FineUIPro.Web/PHTGL/ContractCompile/ContractTrackList.aspx b/SGGL/FineUIPro.Web/PHTGL/ContractCompile/ContractTrackList.aspx index ede7e4c6..d58edceb 100644 --- a/SGGL/FineUIPro.Web/PHTGL/ContractCompile/ContractTrackList.aspx +++ b/SGGL/FineUIPro.Web/PHTGL/ContractCompile/ContractTrackList.aspx @@ -37,7 +37,7 @@ ClicksToEdit="1" DataIDField="Id" AllowSorting="true" SortField="Id" SortDirection="DESC" OnSort="Grid1_Sort" EnableColumnLines="true" AllowPaging="False" IsDatabasePaging="true" PageSize="10" OnPageIndexChange="Grid1_PageIndexChange" - EnableRowDoubleClickEvent="true" OnRowDoubleClick="Grid1_RowDoubleClick" OnRowClick="Grid1_OnRowClick" EnableRowClickEvent="True"> + EnableRowDoubleClickEvent="true" OnRowDoubleClick="Grid1_RowDoubleClick" EnableRowClickEvent="True"> @@ -70,9 +70,6 @@ - - @@ -108,13 +105,13 @@ - - @@ -188,54 +185,7 @@ - - <%-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --%> - + @@ -258,136 +208,6 @@ - - - + /// /// - protected void Grid1_OnRowClick(object sender, GridRowClickEventArgs e) - { - BindGrid2(); - BindGrid3(); - } + /// /// Grid行双击事件 @@ -234,206 +184,206 @@ namespace FineUIPro.Web.PHTGL.ContractCompile } } - protected void btnMatchWBS_Save_OnClick(object sender, EventArgs e) - { - SaveGrid2(); - } + //protected void btnMatchWBS_Save_OnClick(object sender, EventArgs e) + //{ + // SaveGrid2(); + //} - protected void btnMatchWBS_Delete_OnClick(object sender, EventArgs e) - { - if (Grid2.SelectedRowIndexArray.Length > 0) - { - Model.SGGLDB db = Funs.DB; - var controlItemAndCycles = from x in db.WBS_ControlItemAndCycle - where x.ProjectId == this.CurrUser.LoginProjectId - select x; - var unitWorks = from x in db.WBS_UnitWork - where x.ProjectId == this.CurrUser.LoginProjectId - select x; - var workPackages = (from x in db.WBS_WorkPackage - where x.ProjectId == this.CurrUser.LoginProjectId - select x).ToList(); - foreach (int rowIndex in Grid2.SelectedRowIndexArray) - { - string rowID = Grid2.DataKeys[rowIndex][0].ToString(); - var p = BLL.PhtglContracttrackmatchwbsService.GetPHTGL_ContractTrackMatchWBSById(rowID); - if (p != null) - { - decimal changePlanCost = 0 - (p.WorkPackageEstimate ?? 0); - var c = controlItemAndCycles.First(x => x.ControlItemAndCycleId == p.ControlItemAndCycleId); - c.PlanCost = 0; - BLL.ControlItemAndCycleService.UpdateControlItemAndCycle(c); - //更新上级WBS内容概算费用 - BLL.WorkPackageService.UpdateWorkPackagesPlanCost(workPackages, c.WorkPackageId, changePlanCost); - var workPackage = workPackages.FirstOrDefault(x => x.WorkPackageId == c.WorkPackageId); - if (workPackage != null) - { - var unitWork = unitWorks.FirstOrDefault(x => x.UnitWorkId == workPackage.UnitWorkId); - if (unitWork.PlanCost == null) - { - unitWork.PlanCost = changePlanCost; - } - else - { - unitWork.PlanCost += changePlanCost; - } - } - db.SubmitChanges(); - PhtglContracttrackmatchwbsService.DeleteModelById(rowID); - } - } - BindGrid2(); - ShowNotify("删除数据成功!", MessageBoxIcon.Success); - } - } + //protected void btnMatchWBS_Delete_OnClick(object sender, EventArgs e) + //{ + // if (Grid2.SelectedRowIndexArray.Length > 0) + // { + // Model.SGGLDB db = Funs.DB; + // var controlItemAndCycles = from x in db.WBS_ControlItemAndCycle + // where x.ProjectId == this.CurrUser.LoginProjectId + // select x; + // var unitWorks = from x in db.WBS_UnitWork + // where x.ProjectId == this.CurrUser.LoginProjectId + // select x; + // var workPackages = (from x in db.WBS_WorkPackage + // where x.ProjectId == this.CurrUser.LoginProjectId + // select x).ToList(); + // foreach (int rowIndex in Grid2.SelectedRowIndexArray) + // { + // string rowID = Grid2.DataKeys[rowIndex][0].ToString(); + // var p = BLL.PhtglContracttrackmatchwbsService.GetPHTGL_ContractTrackMatchWBSById(rowID); + // if (p != null) + // { + // decimal changePlanCost = 0 - (p.WorkPackageEstimate ?? 0); + // var c = controlItemAndCycles.First(x => x.ControlItemAndCycleId == p.ControlItemAndCycleId); + // c.PlanCost = 0; + // BLL.ControlItemAndCycleService.UpdateControlItemAndCycle(c); + // //更新上级WBS内容概算费用 + // BLL.WorkPackageService.UpdateWorkPackagesPlanCost(workPackages, c.WorkPackageId, changePlanCost); + // var workPackage = workPackages.FirstOrDefault(x => x.WorkPackageId == c.WorkPackageId); + // if (workPackage != null) + // { + // var unitWork = unitWorks.FirstOrDefault(x => x.UnitWorkId == workPackage.UnitWorkId); + // if (unitWork.PlanCost == null) + // { + // unitWork.PlanCost = changePlanCost; + // } + // else + // { + // unitWork.PlanCost += changePlanCost; + // } + // } + // db.SubmitChanges(); + // PhtglContracttrackmatchwbsService.DeleteModelById(rowID); + // } + // } + // BindGrid2(); + // ShowNotify("删除数据成功!", MessageBoxIcon.Success); + // } + //} - protected void btnProgress_Save_OnClick(object sender, EventArgs e) - { - SaveGrid3(); - } + //protected void btnProgress_Save_OnClick(object sender, EventArgs e) + //{ + // SaveGrid3(); + //} - private void SaveGrid2() - { - JArray EditorArr = Grid2.GetMergedData(); - if (EditorArr.Count > 0) - { - for (int i = 0; i < EditorArr.Count; i++) - { - JObject objects = (JObject)EditorArr[i]; - var Id = objects["id"].ToString(); - var WorkPackageEstimate = Funs.GetNewDecimal(objects["values"]["WorkPackageEstimate"].ToString()); + //private void SaveGrid2() + //{ + // JArray EditorArr = Grid2.GetMergedData(); + // if (EditorArr.Count > 0) + // { + // for (int i = 0; i < EditorArr.Count; i++) + // { + // JObject objects = (JObject)EditorArr[i]; + // var Id = objects["id"].ToString(); + // var WorkPackageEstimate = Funs.GetNewDecimal(objects["values"]["WorkPackageEstimate"].ToString()); - var model = PhtglContracttrackmatchwbsService.GetPHTGL_ContractTrackMatchWBSById(Id); - model.WorkPackageEstimate = WorkPackageEstimate; - PhtglContracttrackmatchwbsService.UpdatePHTGL_ContractTrackMatchWBS(model); - } - } - ShowNotify("保存成功", MessageBoxIcon.Success); - } + // var model = PhtglContracttrackmatchwbsService.GetPHTGL_ContractTrackMatchWBSById(Id); + // model.WorkPackageEstimate = WorkPackageEstimate; + // PhtglContracttrackmatchwbsService.UpdatePHTGL_ContractTrackMatchWBS(model); + // } + // } + // ShowNotify("保存成功", MessageBoxIcon.Success); + //} - private void SaveGrid3() - { - Model.SGGLDB db = Funs.DB; - var list = (from x in db.PHTGL_ContractTrackProgress - where x.ContractTrackId == Grid1.SelectedRowID - select x).ToList(); - PhtglContracttrackprogressService.DeleteModleByContractTrackId(Grid1.SelectedRowID); - decimal totalWeights = 0; - var SelectedList = (from x in db.PHTGL_ContractTrackMatchWBS - where x.ContractTrackId == Grid1.SelectedRowID - select x.ControlItemAndCycleId).ToList(); - var totalControlItemAndCycles = from x in db.WBS_ControlItemAndCycle - where x.ProjectId == this.CurrUser.LoginProjectId - select x; - var unitWorks = from x in db.WBS_UnitWork - where x.ProjectId == this.CurrUser.LoginProjectId - select x; - var workPackages = (from x in db.WBS_WorkPackage - where x.ProjectId == this.CurrUser.LoginProjectId - select x).ToList(); - var controlItemAndCycles = from x in totalControlItemAndCycles - where SelectedList.Contains(x.ControlItemAndCycleId) - select x; - foreach (var controlItemAndCycle in controlItemAndCycles) - { - totalWeights += controlItemAndCycle.Weights ?? 0; - } - JArray EditorArr = Grid3.GetMergedData(); - if (EditorArr.Count > 0) - { - Model.PHTGL_ContractTrackProgress model = null; - for (int i = 0; i < EditorArr.Count; i++) - { - JObject objects = (JObject)EditorArr[i]; - model = new Model.PHTGL_ContractTrackProgress(); - model.ContractTrackProgressId = SQLHelper.GetNewID(typeof(Model.PHTGL_ContractTrackProgress)); - model.ContractTrackId = Grid1.SelectedRowID; - model.BCWS_Quantity = Funs.GetNewDecimal(objects["values"]["BCWS_Quantity"].ToString()); - model.BCWS_OutputValue = Funs.GetNewDecimal(objects["values"]["BCWS_OutputValue"].ToString()); - model.BCWS_Percentage = Funs.GetNewDecimal(objects["values"]["BCWS_Percentage"].ToString()); - model.ACWP_Quantity = Funs.GetNewDecimal(objects["values"]["ACWP_Quantity"].ToString()); - model.ACWP_OutputValue = Funs.GetNewDecimal(objects["values"]["ACWP_OutputValue"].ToString()); - model.ACWP_Percentage = Funs.GetNewDecimal(objects["values"]["ACWP_Percentage"].ToString()); - model.Date = objects["values"]["Date"].ToString(); - BLL.PhtglContracttrackprogressService.AddPHTGL_ContractTrackProgress(model); - var old = list.FirstOrDefault(x => x.Date == model.Date); - decimal oldValue = 0; - if (old != null) - { - oldValue = old.ACWP_OutputValue ?? 0; - } - decimal changeValue = (model.ACWP_OutputValue ?? 0) - oldValue; - if (changeValue != 0) - { - foreach (var item in controlItemAndCycles) - { - var c = controlItemAndCycles.First(x => x.ControlItemAndCycleId == item.ControlItemAndCycleId); - decimal thisValue = 0; - if (totalWeights > 0 && c.Weights.HasValue) - { - thisValue = decimal.Round(c.Weights.Value / totalWeights * changeValue, 2); - } - DateTime? months = Funs.GetNewDateTime(model.Date + "-01"); - var WorkPackage = workPackages.FirstOrDefault(x => x.WorkPackageId == item.WorkPackageId); - Model.WBS_WorkPackageDetail WorkPackageDetail = BLL.WorkPackageDetailService.GetWorkPackageDetailByWorkPackageIdAndMonths(item.WorkPackageId, months.Value); - if (WorkPackageDetail != null) - { - WorkPackageDetail.ThisValue += thisValue; - } - else - { - WorkPackageDetail = new Model.WBS_WorkPackageDetail(); - WorkPackageDetail.WorkPackageDetailId = SQLHelper.GetNewID(); - WorkPackageDetail.WorkPackageId = item.WorkPackageId; - WorkPackageDetail.Months = months; - WorkPackageDetail.ThisValue = thisValue; - db.WBS_WorkPackageDetail.InsertOnSubmit(WorkPackageDetail); - } - //更新上级WBS内容每月实际费用 - UpdateWorkPackageParentThisValue(db, WorkPackage.SuperWorkPackageId, months.Value, thisValue); - ////更新单位工程 - Model.WBS_WorkPackageParentDetail unitWorkDetail = BLL.WorkPackageParentDetailService.GetWorkPackageParentDetailByParentIdAndMonths(WorkPackage.UnitWorkId, months.Value); - if (unitWorkDetail != null) - { - unitWorkDetail.ThisValue += thisValue; - } - else - { - unitWorkDetail = new Model.WBS_WorkPackageParentDetail(); - unitWorkDetail.WorkPackageParentDetailId = SQLHelper.GetNewID(); - unitWorkDetail.ParentId = WorkPackage.UnitWorkId; - unitWorkDetail.Months = months; - unitWorkDetail.ThisValue = thisValue; - db.WBS_WorkPackageParentDetail.InsertOnSubmit(unitWorkDetail); - } - ////更新建筑、安装工程 - Model.WBS_UnitWork unitWork = unitWorks.FirstOrDefault(x => x.UnitWorkId == WorkPackage.UnitWorkId); - if (unitWork != null) - { - Model.WBS_WorkPackageParentDetail projectType = BLL.WorkPackageParentDetailService.GetWorkPackageParentDetailByParentIdAndMonths(unitWork.ProjectType, this.CurrUser.LoginProjectId, months.Value); - if (projectType != null) - { - projectType.ThisValue += thisValue; - } - else - { - projectType = new Model.WBS_WorkPackageParentDetail(); - projectType.WorkPackageParentDetailId = SQLHelper.GetNewID(); - projectType.ParentId = unitWork.ProjectType; - projectType.ProjectId = this.CurrUser.LoginProjectId; - projectType.Months = months; - projectType.ThisValue = thisValue; - db.WBS_WorkPackageParentDetail.InsertOnSubmit(projectType); - } - } - db.SubmitChanges(); - } - } - } - } - ShowNotify("保存成功", MessageBoxIcon.Success); + //private void SaveGrid3() + //{ + // Model.SGGLDB db = Funs.DB; + // var list = (from x in db.PHTGL_ContractTrackProgress + // where x.ContractTrackId == Grid1.SelectedRowID + // select x).ToList(); + // PhtglContracttrackprogressService.DeleteModleByContractTrackId(Grid1.SelectedRowID); + // decimal totalWeights = 0; + // var SelectedList = (from x in db.PHTGL_ContractTrackMatchWBS + // where x.ContractTrackId == Grid1.SelectedRowID + // select x.ControlItemAndCycleId).ToList(); + // var totalControlItemAndCycles = from x in db.WBS_ControlItemAndCycle + // where x.ProjectId == this.CurrUser.LoginProjectId + // select x; + // var unitWorks = from x in db.WBS_UnitWork + // where x.ProjectId == this.CurrUser.LoginProjectId + // select x; + // var workPackages = (from x in db.WBS_WorkPackage + // where x.ProjectId == this.CurrUser.LoginProjectId + // select x).ToList(); + // var controlItemAndCycles = from x in totalControlItemAndCycles + // where SelectedList.Contains(x.ControlItemAndCycleId) + // select x; + // foreach (var controlItemAndCycle in controlItemAndCycles) + // { + // totalWeights += controlItemAndCycle.Weights ?? 0; + // } + // JArray EditorArr = Grid3.GetMergedData(); + // if (EditorArr.Count > 0) + // { + // Model.PHTGL_ContractTrackProgress model = null; + // for (int i = 0; i < EditorArr.Count; i++) + // { + // JObject objects = (JObject)EditorArr[i]; + // model = new Model.PHTGL_ContractTrackProgress(); + // model.ContractTrackProgressId = SQLHelper.GetNewID(typeof(Model.PHTGL_ContractTrackProgress)); + // model.ContractTrackId = Grid1.SelectedRowID; + // model.BCWS_Quantity = Funs.GetNewDecimal(objects["values"]["BCWS_Quantity"].ToString()); + // model.BCWS_OutputValue = Funs.GetNewDecimal(objects["values"]["BCWS_OutputValue"].ToString()); + // model.BCWS_Percentage = Funs.GetNewDecimal(objects["values"]["BCWS_Percentage"].ToString()); + // model.ACWP_Quantity = Funs.GetNewDecimal(objects["values"]["ACWP_Quantity"].ToString()); + // model.ACWP_OutputValue = Funs.GetNewDecimal(objects["values"]["ACWP_OutputValue"].ToString()); + // model.ACWP_Percentage = Funs.GetNewDecimal(objects["values"]["ACWP_Percentage"].ToString()); + // model.Date = objects["values"]["Date"].ToString(); + // BLL.PhtglContracttrackprogressService.AddPHTGL_ContractTrackProgress(model); + // var old = list.FirstOrDefault(x => x.Date == model.Date); + // decimal oldValue = 0; + // if (old != null) + // { + // oldValue = old.ACWP_OutputValue ?? 0; + // } + // decimal changeValue = (model.ACWP_OutputValue ?? 0) - oldValue; + // if (changeValue != 0) + // { + // foreach (var item in controlItemAndCycles) + // { + // var c = controlItemAndCycles.First(x => x.ControlItemAndCycleId == item.ControlItemAndCycleId); + // decimal thisValue = 0; + // if (totalWeights > 0 && c.Weights.HasValue) + // { + // thisValue = decimal.Round(c.Weights.Value / totalWeights * changeValue, 2); + // } + // DateTime? months = Funs.GetNewDateTime(model.Date + "-01"); + // var WorkPackage = workPackages.FirstOrDefault(x => x.WorkPackageId == item.WorkPackageId); + // Model.WBS_WorkPackageDetail WorkPackageDetail = BLL.WorkPackageDetailService.GetWorkPackageDetailByWorkPackageIdAndMonths(item.WorkPackageId, months.Value); + // if (WorkPackageDetail != null) + // { + // WorkPackageDetail.ThisValue += thisValue; + // } + // else + // { + // WorkPackageDetail = new Model.WBS_WorkPackageDetail(); + // WorkPackageDetail.WorkPackageDetailId = SQLHelper.GetNewID(); + // WorkPackageDetail.WorkPackageId = item.WorkPackageId; + // WorkPackageDetail.Months = months; + // WorkPackageDetail.ThisValue = thisValue; + // db.WBS_WorkPackageDetail.InsertOnSubmit(WorkPackageDetail); + // } + // //更新上级WBS内容每月实际费用 + // UpdateWorkPackageParentThisValue(db, WorkPackage.SuperWorkPackageId, months.Value, thisValue); + // ////更新单位工程 + // Model.WBS_WorkPackageParentDetail unitWorkDetail = BLL.WorkPackageParentDetailService.GetWorkPackageParentDetailByParentIdAndMonths(WorkPackage.UnitWorkId, months.Value); + // if (unitWorkDetail != null) + // { + // unitWorkDetail.ThisValue += thisValue; + // } + // else + // { + // unitWorkDetail = new Model.WBS_WorkPackageParentDetail(); + // unitWorkDetail.WorkPackageParentDetailId = SQLHelper.GetNewID(); + // unitWorkDetail.ParentId = WorkPackage.UnitWorkId; + // unitWorkDetail.Months = months; + // unitWorkDetail.ThisValue = thisValue; + // db.WBS_WorkPackageParentDetail.InsertOnSubmit(unitWorkDetail); + // } + // ////更新建筑、安装工程 + // Model.WBS_UnitWork unitWork = unitWorks.FirstOrDefault(x => x.UnitWorkId == WorkPackage.UnitWorkId); + // if (unitWork != null) + // { + // Model.WBS_WorkPackageParentDetail projectType = BLL.WorkPackageParentDetailService.GetWorkPackageParentDetailByParentIdAndMonths(unitWork.ProjectType, this.CurrUser.LoginProjectId, months.Value); + // if (projectType != null) + // { + // projectType.ThisValue += thisValue; + // } + // else + // { + // projectType = new Model.WBS_WorkPackageParentDetail(); + // projectType.WorkPackageParentDetailId = SQLHelper.GetNewID(); + // projectType.ParentId = unitWork.ProjectType; + // projectType.ProjectId = this.CurrUser.LoginProjectId; + // projectType.Months = months; + // projectType.ThisValue = thisValue; + // db.WBS_WorkPackageParentDetail.InsertOnSubmit(projectType); + // } + // } + // db.SubmitChanges(); + // } + // } + // } + // } + // ShowNotify("保存成功", MessageBoxIcon.Success); - } + //} #region 更新上级WBS内容每月实际费用 /// @@ -494,14 +444,14 @@ namespace FineUIPro.Web.PHTGL.ContractCompile var CalculationRule = objects["values"]["CalculationRule"].ToString(); var WorkContent = objects["values"]["WorkContent"].ToString(); var Remarks = objects["values"]["Remarks"].ToString(); - var ConstructionSubcontractor = objects["values"]["ConstructionSubcontractor"].ToString(); - var ContractWeight = objects["values"]["ContractWeight"].ToString(); - var MaterialSupplier = objects["values"]["MaterialSupplier"].ToString(); - var IsWithinGeneralContractScope = objects["values"]["IsWithinGeneralContractScope"].ToString(); - var EstimatedQuantity = objects["values"]["EstimatedQuantity"].ToString(); - var EstimatedAmount = objects["values"]["EstimatedAmount"].ToString(); - var SettledQuantity = objects["values"]["SettledQuantity"].ToString(); - var SettledAmount = objects["values"]["SettledAmount"].ToString(); + //var ConstructionSubcontractor = objects["values"]["ConstructionSubcontractor"].ToString(); + //var ContractWeight = objects["values"]["ContractWeight"].ToString(); + //var MaterialSupplier = objects["values"]["MaterialSupplier"].ToString(); + //var IsWithinGeneralContractScope = objects["values"]["IsWithinGeneralContractScope"].ToString(); + //var EstimatedQuantity = objects["values"]["EstimatedQuantity"].ToString(); + //var EstimatedAmount = objects["values"]["EstimatedAmount"].ToString(); + //var SettledQuantity = objects["values"]["SettledQuantity"].ToString(); + //var SettledAmount = objects["values"]["SettledAmount"].ToString(); var model = PhtglContractTrackService.GetPHTGL_ContractTrackById(Id); model.MainItemCode = MainItemCode; @@ -519,18 +469,20 @@ namespace FineUIPro.Web.PHTGL.ContractCompile model.CalculationRule = CalculationRule; model.WorkContent = WorkContent; model.Remarks = Remarks; - model.ConstructionSubcontractor = ConstructionSubcontractor; - model.ContractWeight = ContractWeight; - model.MaterialSupplier = MaterialSupplier; - model.IsWithinGeneralContractScope = bool.Parse(IsWithinGeneralContractScope); - model.EstimatedQuantity = EstimatedQuantity; - model.EstimatedAmount = Funs.GetNewDecimal(EstimatedAmount); - model.SettledQuantity = SettledQuantity; - model.SettledAmount = Funs.GetNewDecimal(SettledAmount); + //model.ConstructionSubcontractor = ConstructionSubcontractor; + //model.ContractWeight = ContractWeight; + //model.MaterialSupplier = MaterialSupplier; + //model.IsWithinGeneralContractScope = bool.Parse(IsWithinGeneralContractScope); + //model.EstimatedQuantity = EstimatedQuantity; + //model.EstimatedAmount = Funs.GetNewDecimal(EstimatedAmount); + //model.SettledQuantity = SettledQuantity; + //model.SettledAmount = Funs.GetNewDecimal(SettledAmount); PhtglContractTrackService.UpdatePHTGL_ContractTrack(model); } + } + ShowNotify("保存成功", MessageBoxIcon.Success); BindGrid(); } @@ -539,22 +491,6 @@ namespace FineUIPro.Web.PHTGL.ContractCompile BindGrid(); } - protected void btnGetChart_Click(object sender, EventArgs e) - { - if (!string.IsNullOrEmpty(ContractId)) - { - var model = ContractService.GetContractByContractNum(DropContractCode.SelectedValue); - if (model != null) - { - PageContext.RegisterStartupScript( - Window2.GetShowReference(string.Format("ContractTrackProgressChart.aspx?ContractId={0}", model.ContractId, "图表 - "))); - } - } - else - { - ShowNotify("请选择施工分包合同", MessageBoxIcon.Question); - } - } #endregion #region 关闭弹出窗 @@ -690,11 +626,6 @@ namespace FineUIPro.Web.PHTGL.ContractCompile } - protected void Window3_OnClose(object sender, WindowCloseEventArgs e) - { - BindGrid2(); - } - } } \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/PHTGL/ContractCompile/ContractTrackList.aspx.designer.cs b/SGGL/FineUIPro.Web/PHTGL/ContractCompile/ContractTrackList.aspx.designer.cs index f9e9e9af..5b8601b2 100644 --- a/SGGL/FineUIPro.Web/PHTGL/ContractCompile/ContractTrackList.aspx.designer.cs +++ b/SGGL/FineUIPro.Web/PHTGL/ContractCompile/ContractTrackList.aspx.designer.cs @@ -158,15 +158,6 @@ namespace FineUIPro.Web.PHTGL.ContractCompile /// protected global::FineUIPro.Button btnQuery; - /// - /// btnGetChart 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.Button btnGetChart; - /// /// lblNumber 控件。 /// @@ -347,213 +338,6 @@ namespace FineUIPro.Web.PHTGL.ContractCompile /// protected global::FineUIPro.DropDownList ddlPageSize; - /// - /// panelBottomRegion 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.Panel panelBottomRegion; - - /// - /// Panel7 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.Panel Panel7; - - /// - /// Grid2 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.Grid Grid2; - - /// - /// Toolbar1 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.Toolbar Toolbar1; - - /// - /// ToolbarFill2 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.ToolbarFill ToolbarFill2; - - /// - /// btnMatchWBS_New 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.Button btnMatchWBS_New; - - /// - /// btnMatchWBS_Delete 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.Button btnMatchWBS_Delete; - - /// - /// btnMatchWBS_Save 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.Button btnMatchWBS_Save; - - /// - /// NumberBox1 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.NumberBox NumberBox1; - - /// - /// Panel8 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.Panel Panel8; - - /// - /// Grid3 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.Grid Grid3; - - /// - /// Toolbar3 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.Toolbar Toolbar3; - - /// - /// ToolbarFill1 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.ToolbarFill ToolbarFill1; - - /// - /// btnProgress_New 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.Button btnProgress_New; - - /// - /// btnProgress_Delete 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.Button btnProgress_Delete; - - /// - /// btnProgress_Save 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.Button btnProgress_Save; - - /// - /// TextBox1 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.TextBox TextBox1; - - /// - /// NumberBox4 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.NumberBox NumberBox4; - - /// - /// NumberBox5 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.NumberBox NumberBox5; - - /// - /// NumberBox6 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.NumberBox NumberBox6; - - /// - /// NumberBox7 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.NumberBox NumberBox7; - - /// - /// NumberBox8 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.NumberBox NumberBox8; - - /// - /// NumberBox9 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.NumberBox NumberBox9; - /// /// Window1 控件。 /// @@ -572,15 +356,6 @@ namespace FineUIPro.Web.PHTGL.ContractCompile /// protected global::FineUIPro.Window Window2; - /// - /// Window3 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.Window Window3; - /// /// Menu1 控件。 /// diff --git a/SGGL/FineUIPro.Web/PHTGL/ContractCompile/ContractTrackProgressDetection.aspx b/SGGL/FineUIPro.Web/PHTGL/ContractCompile/ContractTrackProgressDetection.aspx index 74cc0878..a5ac0f85 100644 --- a/SGGL/FineUIPro.Web/PHTGL/ContractCompile/ContractTrackProgressDetection.aspx +++ b/SGGL/FineUIPro.Web/PHTGL/ContractCompile/ContractTrackProgressDetection.aspx @@ -2,15 +2,51 @@ + - - + + 进度检测 + +
-
-
+ + + + + + + + + + + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/PHTGL/ContractCompile/ContractTrackProgressDetection.aspx.cs b/SGGL/FineUIPro.Web/PHTGL/ContractCompile/ContractTrackProgressDetection.aspx.cs index 912e8656..28ce3cd1 100644 --- a/SGGL/FineUIPro.Web/PHTGL/ContractCompile/ContractTrackProgressDetection.aspx.cs +++ b/SGGL/FineUIPro.Web/PHTGL/ContractCompile/ContractTrackProgressDetection.aspx.cs @@ -1,17 +1,57 @@ -using System; +using BLL; +using Newtonsoft.Json.Linq; +using System; using System.Collections.Generic; using System.Linq; +using System.Text; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; namespace FineUIPro.Web.PHTGL.ContractCompile { - public partial class ContractTrackProgressDetection : System.Web.UI.Page + public partial class ContractTrackProgressDetection : PageBase { + + public string ContractId + { + get => (string)ViewState["ContractId"]; + set => ViewState["ContractId"] = value; + } protected void Page_Load(object sender, EventArgs e) { + if (!IsPostBack) + { + //主合同编号 + this.DropContractCode.DataTextField = "ContractNum"; + this.DropContractCode.DataValueField = "ContractNum"; + this.DropContractCode.DataSource = BLL.PHTGL_ContractReviewService.GetContractReview_CompleteData(this.CurrUser.LoginProjectId); + this.DropContractCode.DataBind(); + Funs.FineUIPleaseSelect(this.DropContractCode); + DropMainContractCode_SelectedIndexChanged(null, null); + + } + } + + protected void DropMainContractCode_SelectedIndexChanged(object sender, EventArgs e) + { + if (!string.IsNullOrEmpty(DropContractCode.SelectedValue)) + { + var model = ContractService.GetContractByContractNum(DropContractCode.SelectedValue); + if (model != null) + { + ContractId = model.ContractId; + this.txtContractName.Text = model.ContractName; + } + else + { + ContractId = ""; + this.txtContractName.Text = string.Empty; + } + + panelCenterRegion.IFrameUrl = "./ContractTrackProgressDetectionGrid.aspx?ContractId="+ContractId; + } } } } \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/PHTGL/ContractCompile/ContractTrackProgressDetection.aspx.designer.cs b/SGGL/FineUIPro.Web/PHTGL/ContractCompile/ContractTrackProgressDetection.aspx.designer.cs index 2c60b552..db099d71 100644 --- a/SGGL/FineUIPro.Web/PHTGL/ContractCompile/ContractTrackProgressDetection.aspx.designer.cs +++ b/SGGL/FineUIPro.Web/PHTGL/ContractCompile/ContractTrackProgressDetection.aspx.designer.cs @@ -22,5 +22,59 @@ namespace FineUIPro.Web.PHTGL.ContractCompile /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// Panel3 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel Panel3; + + /// + /// panelCenterRegion 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel panelCenterRegion; + + /// + /// Toolbar2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar2; + + /// + /// DropContractCode 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList DropContractCode; + + /// + /// txtContractName 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label txtContractName; } } diff --git a/SGGL/FineUIPro.Web/PHTGL/ContractCompile/ContractTrackProgressDetectionGrid.aspx b/SGGL/FineUIPro.Web/PHTGL/ContractCompile/ContractTrackProgressDetectionGrid.aspx new file mode 100644 index 00000000..7a019c1b --- /dev/null +++ b/SGGL/FineUIPro.Web/PHTGL/ContractCompile/ContractTrackProgressDetectionGrid.aspx @@ -0,0 +1,87 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ContractTrackProgressDetectionGrid.aspx.cs" Inherits="FineUIPro.Web.PHTGL.ContractCompile.ContractTrackProgressDetectionGrid" %> + + + + + + + + 进度检测 + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/PHTGL/ContractCompile/ContractTrackProgressDetectionGrid.aspx.cs b/SGGL/FineUIPro.Web/PHTGL/ContractCompile/ContractTrackProgressDetectionGrid.aspx.cs new file mode 100644 index 00000000..1fc5b2e5 --- /dev/null +++ b/SGGL/FineUIPro.Web/PHTGL/ContractCompile/ContractTrackProgressDetectionGrid.aspx.cs @@ -0,0 +1,604 @@ +using BLL; +using Newtonsoft.Json.Linq; +using System; +using System.Collections.Generic; +using System.Data; +using System.Linq; +using System.Text; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +namespace FineUIPro.Web.PHTGL.ContractCompile +{ + public partial class ContractTrackProgressDetectionGrid : PageBase + { + #region Page_Init + + // 注意:动态创建的代码需要放置于Page_Init(不是Page_Load),这样每次构造页面时都会执行 + protected void Page_Init(object sender, EventArgs e) + { + InitGrid(); + } + public DataTable GridTable=new DataTable(); + private void InitGrid() + { + FineUIPro.BoundField bf; + FineUIPro.RenderField rf; + FineUIPro.TextBox txTextBox; + + + ContractId = Request.Params["ContractId"]; + + GridTable.Columns.Add("Id"); + ListItem[] list = new ListItem[8]; + list[0] = new ListItem("主项号", "MainItemCode"); + list[1] = new ListItem("主项名称", "MainItemName"); + list[2] = new ListItem("专业工程名称", "MajorName"); + list[3] = new ListItem("专业代码", "MajorCode"); + list[4] = new ListItem("分部工程", "SubProject"); + list[5] = new ListItem("分项工程", "SubItemProject"); + list[6] = new ListItem("项目编码", "ProjectCode"); + list[7] = new ListItem("项目名称", "ProjectName"); + + foreach (var item in list) + { + bf = new FineUIPro.BoundField(); + bf.ColumnID = item.Value; + bf.DataField = item.Value; + bf.HeaderText = item.Text; + bf.HeaderTextAlign = TextAlign.Center; + bf.TextAlign = TextAlign.Center; + Grid1.Columns.Add(bf); + GridTable.Columns.Add(item.Value); + } + if (!string.IsNullOrEmpty(ContractId)) + { + Model.PHTGL_ContractTrack queryContractTrack = new Model.PHTGL_ContractTrack(); + queryContractTrack.ProjectId = this.CurrUser.LoginProjectId; + queryContractTrack.ContractId = this.ContractId; + var modelContractTracks = BLL.PhtglContractTrackService.GetPHTGL_ContractTrackByModle(queryContractTrack); + if (modelContractTracks.Count==0) return; + + + Model.PHTGL_ContractTrackProgress table = new Model.PHTGL_ContractTrackProgress(); + table.ContractTrackId = modelContractTracks[0].Id; + var tb = BLL.PhtglContracttrackprogressService.GetPHTGL_ContractTrackProgressByModle(table); + foreach (var item in tb) + { + //string date = item.Date.Replace("-", ""); + string date = item.Date+"#" ; + GroupField p = new GroupField(); + p.HeaderText = item.Date; + p.TextAlign = TextAlign.Center; + + GroupField p1 = new GroupField(); + p1.HeaderText = "当月进展情况"; + p1.TextAlign = TextAlign.Center; + + GroupField p1BCWS = new GroupField(); + p1BCWS.HeaderText = "BCWS"; + p1BCWS.TextAlign = TextAlign.Center; + + GroupField p1ACWP = new GroupField(); + p1ACWP.HeaderText = "ACWP"; + p1ACWP.TextAlign = TextAlign.Center; + + + GroupField p2 = new GroupField(); + p2.HeaderText = "累计进展情况"; + p2.TextAlign = TextAlign.Center; + + + + GroupField p2BCWS = new GroupField(); + p2BCWS.HeaderText = "BCWS"; + p2BCWS.TextAlign = TextAlign.Center; + + GroupField p2ACWP = new GroupField(); + p2ACWP.HeaderText = "ACWP"; + p2ACWP.TextAlign = TextAlign.Center; + + #region 当月进展情况 + + #region BCWS + + txTextBox = new FineUIPro.TextBox(); + txTextBox.ID = "txt" +date+ "BCWS_Quantity"; + rf = new RenderField(); + rf.ColumnID = date+"BCWS_Quantity"; + rf.DataField = date+"BCWS_Quantity"; + rf.HeaderText = "工程量"; + rf.TextAlign = FineUIPro.TextAlign.Left; + rf.Editor.Add(txTextBox); + p1BCWS.Columns.Add(rf); + + GridTable.Columns.Add(date + "BCWS_Quantity"); + + bf = new FineUIPro.BoundField(); + bf.ColumnID = date + "BCWS_OutputValue"; + bf.DataField = date + "BCWS_OutputValue"; + bf.HeaderText = "产值"; + bf.HeaderTextAlign = TextAlign.Center; + bf.TextAlign = TextAlign.Center; + p1BCWS.Columns.Add(bf); + GridTable.Columns.Add(date + "BCWS_OutputValue"); + + bf = new FineUIPro.BoundField(); + bf.ColumnID = date + "BCWS_Percentage"; + bf.DataField = date + "BCWS_Percentage"; + bf.HeaderText = "百分比"; + bf.HeaderTextAlign = TextAlign.Center; + bf.TextAlign = TextAlign.Center; + p1BCWS.Columns.Add(bf); + GridTable.Columns.Add(date + "BCWS_Percentage"); + #endregion + + #region ACWP + + txTextBox = new FineUIPro.TextBox(); + txTextBox.ID = "txt" + date + "ACWP_Quantity"; + rf = new RenderField(); + rf.ColumnID = date + "ACWP_Quantity"; + rf.DataField = date + "ACWP_Quantity"; + rf.HeaderText = "工程量"; + rf.TextAlign = FineUIPro.TextAlign.Left; + rf.Editor.Add(txTextBox); + p1ACWP.Columns.Add(rf); + GridTable.Columns.Add(date + "ACWP_Quantity"); + + bf = new FineUIPro.BoundField(); + bf.ColumnID = date + "ACWP_OutputValue"; + bf.DataField = date + "ACWP_OutputValue"; + bf.HeaderText = "产值"; + bf.HeaderTextAlign = TextAlign.Center; + bf.TextAlign = TextAlign.Center; + p1ACWP.Columns.Add(bf); + GridTable.Columns.Add(date + "ACWP_OutputValue"); + + bf = new FineUIPro.BoundField(); + bf.ColumnID = date + "ACWP_Percentage"; + bf.DataField = date + "ACWP_Percentage"; + bf.HeaderText = "百分比"; + bf.HeaderTextAlign = TextAlign.Center; + bf.TextAlign = TextAlign.Center; + p1ACWP.Columns.Add(bf); + GridTable.Columns.Add(date + "ACWP_Percentage"); + #endregion + + #endregion + + + #region 累计进展情况 + + #region BCWS + + txTextBox = new FineUIPro.TextBox(); + txTextBox.ID = "txt" + date + "SumBCWS_Quantity"; + rf = new RenderField(); + rf.ColumnID = date + "SumBCWS_Quantity"; + rf.DataField = date + "SumBCWS_Quantity"; + rf.HeaderText = "工程量"; + rf.TextAlign = FineUIPro.TextAlign.Left; + rf.Editor.Add(txTextBox); + p2BCWS.Columns.Add(rf); + + GridTable.Columns.Add(date + "SumBCWS_Quantity"); + + bf = new FineUIPro.BoundField(); + bf.ColumnID = date + "SumBCWS_OutputValue"; + bf.DataField = date + "SumBCWS_OutputValue"; + bf.HeaderText = "产值"; + bf.HeaderTextAlign = TextAlign.Center; + bf.TextAlign = TextAlign.Center; + p2BCWS.Columns.Add(bf); + GridTable.Columns.Add(date + "SumBCWS_OutputValue"); + + bf = new FineUIPro.BoundField(); + bf.ColumnID = date + "SumBCWS_Percentage"; + bf.DataField = date + "SumBCWS_Percentage"; + bf.HeaderText = "百分比"; + bf.HeaderTextAlign = TextAlign.Center; + bf.TextAlign = TextAlign.Center; + p2BCWS.Columns.Add(bf); + GridTable.Columns.Add(date + "SumBCWS_Percentage"); + #endregion + + #region ACWP + + txTextBox = new FineUIPro.TextBox(); + txTextBox.ID = "txt" + date + "SumACWP_Quantity"; + rf = new RenderField(); + rf.ColumnID = date + "SumACWP_Quantity"; + rf.DataField = date + "SumACWP_Quantity"; + rf.HeaderText = "工程量"; + rf.TextAlign = FineUIPro.TextAlign.Left; + rf.Editor.Add(txTextBox); + p2ACWP.Columns.Add(rf); + GridTable.Columns.Add(date + "SumACWP_Quantity"); + + bf = new FineUIPro.BoundField(); + bf.ColumnID = date + "SumACWP_OutputValue"; + bf.DataField = date + "SumACWP_OutputValue"; + bf.HeaderText = "产值"; + bf.HeaderTextAlign = TextAlign.Center; + bf.TextAlign = TextAlign.Center; + p2ACWP.Columns.Add(bf); + GridTable.Columns.Add(date + "SumACWP_OutputValue"); + + bf = new FineUIPro.BoundField(); + bf.ColumnID = date + "SumACWP_Percentage"; + bf.DataField = date + "SumACWP_Percentage"; + bf.HeaderText = "百分比"; + bf.HeaderTextAlign = TextAlign.Center; + bf.TextAlign = TextAlign.Center; + p2ACWP.Columns.Add(bf); + GridTable.Columns.Add(date + "SumACWP_Percentage"); + #endregion + + #endregion + + p1.Columns.Add(p1BCWS); + p1.Columns.Add(p1ACWP); + + + p2.Columns.Add(p2BCWS); + p2.Columns.Add(p2ACWP); + + p.Columns.Add(p1); + p.Columns.Add(p2); + + Grid1.Columns.Add(p); + + } + } + + } + + #endregion + public string ContractId + { + get => (string)ViewState["ContractId"]; + set => ViewState["ContractId"] = value; + } + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + this.GetButtonPower(); + + + // 绑定表格 + this.BindGrid(); + + } + } + + #region 绑定数据 + /// + /// 绑定数据 + /// + private void BindGrid() + { + if (!string .IsNullOrEmpty(ContractId)) + { + DataRow row; + Model.PHTGL_ContractTrack queryContractTrack = new Model.PHTGL_ContractTrack(); + queryContractTrack.ProjectId = this.CurrUser.LoginProjectId; + queryContractTrack.ContractId = this.ContractId; + var modelContractTracks = BLL.PhtglContractTrackService.GetPHTGL_ContractTrackByModle(queryContractTrack); + foreach (var item in modelContractTracks) + { + row= GridTable.NewRow(); + row["Id"] = item.Id; + row["MainItemCode"] = item.MainItemCode; + row["MainItemName"] = item.MainItemName; + row["MajorName"] = item.MajorName; + row["MajorCode"] = item.MajorCode; + row["SubProject"] = item.SubProject; + row["SubItemProject"] = item.SubItemProject; + row["ProjectCode"] = item.ProjectCode; + row["ProjectName"] = item.ProjectName; + + Model.PHTGL_ContractTrackProgress qContractTrackProgress = new Model.PHTGL_ContractTrackProgress(); + qContractTrackProgress.ContractTrackId = item.Id; + var modelContractTrackProgresses = BLL.PhtglContracttrackprogressService.GetPHTGL_ContractTrackProgressByModle(qContractTrackProgress); + foreach (var detail in modelContractTrackProgresses) + { + // var date=detail.Date.Replace("-", ""); + var date=detail.Date + "#"; + row[date+ "BCWS_Quantity"] = detail.BCWS_Quantity; + row[date+ "BCWS_OutputValue"] = detail.BCWS_OutputValue; + row[date+ "BCWS_Percentage"] = detail.BCWS_Percentage; + row[date+ "ACWP_Quantity"] = detail.ACWP_Quantity; + row[date+ "ACWP_OutputValue"] = detail.ACWP_OutputValue; + row[date+ "ACWP_Percentage"] = detail.ACWP_Percentage; + + var SumModel = PhtglContracttrackprogressService.GetSumProgress(detail.ContractTrackProgressId); + row[date + "SumBCWS_Quantity"] = SumModel.BCWS_Quantity; + row[date + "SumBCWS_OutputValue"] = SumModel.BCWS_OutputValue; + row[date + "SumBCWS_Percentage"] = SumModel.BCWS_Percentage; + row[date + "SumACWP_Quantity"] = SumModel.ACWP_Quantity; + row[date + "SumACWP_OutputValue"] = SumModel.ACWP_OutputValue; + row[date + "SumACWP_Percentage"] = SumModel.ACWP_Percentage; + } + + GridTable.Rows.Add(row); + } + + Grid1.DataSource = GridTable; + Grid1.DataBind(); + } + + + } + #endregion + + #region GV 数据操作 + /// + /// 过滤表头 + /// + /// + /// + //protected void Grid1_FilterChange(object sender, EventArgs e) + //{ + // this.BindGrid(); + //} + + /// + /// 分页 + /// + /// + /// + protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e) + { + this.Grid1.PageIndex = e.NewPageIndex; + this.BindGrid(); + } + + /// + /// 排序 + /// + /// + /// + protected void Grid1_Sort(object sender, GridSortEventArgs e) + { + this.Grid1.SortDirection = e.SortDirection; + this.Grid1.SortField = e.SortField; + this.BindGrid(); + } + + /// + /// 分页显示条数下拉框 + /// + /// + /// + protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e) + { + + this.BindGrid(); + } + #endregion + + #region 数据编辑事件 + + /// + /// 编辑按钮 + /// + /// + /// + protected void btnEdit_Click(object sender, EventArgs e) + { + if (Grid1.SelectedRowIndexArray.Length == 0) + { + Alert.ShowInTop("请至少选择一条记录!", MessageBoxIcon.Warning); + return; + } + string ID = Grid1.SelectedRowID; + var model = BLL.PhtglContractTrackService.GetPHTGL_ContractTrackById(ID); + if (model != null) ///已上报时不能删除 + { + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ContractTrackEdit.aspx?Id={0}", ID, "编辑 - "))); + } + } + + /// + /// Grid行双击事件 + /// + /// + /// + protected void Grid1_RowDoubleClick(object sender, GridRowClickEventArgs e) + { + this.btnEdit_Click(null, null); + } + + protected void btnSave_OnClick(object sender, EventArgs e) + { + JArray EditorArr = Grid1.GetMergedData(); + if (EditorArr.Count > 0) + { + for (int i = 0; i < EditorArr.Count; i++) + { + JObject objects = (JObject)EditorArr[i]; + + var listfiled = objects["values"].ToList(); + + var Id = objects["id"].ToString(); + var model = BLL.PhtglContractTrackService.GetPHTGL_ContractTrackById(Id); + + + if (model!=null) + { + foreach (var item in listfiled) //遍历行中的字段 + { + var b = item; + var txtname = b.First.Path.Substring(b.First.Path.LastIndexOf('.') + 1); + var txtvalue = b.First.Value(); + string date = txtname.Split('#')[0].ToString(); + string filed = txtname.Split('#')[1].ToString(); + + var modelContractTrackProgress = PhtglContracttrackprogressService.GetPHTGL_ContractTrackProgressByTrackIdAndDate(Id, date); + if (modelContractTrackProgress!=null) + { + switch (filed) + { + case "ACWP_Quantity": + modelContractTrackProgress.ACWP_Quantity = Funs.GetNewDecimalOrZero(txtvalue) ; + break; + case "BCWS_Quantity": + modelContractTrackProgress.BCWS_Quantity = Funs.GetNewDecimalOrZero(txtvalue); + break; + } + } + PhtglContracttrackprogressService.UpdatePHTGL_ContractTrackProgress(modelContractTrackProgress); + } + + } + + + } + } + + CheckProgressd(); + BindGrid(); + } + /// + /// 修改产值/百分比 + /// + private void CheckProgressd() + { + if (!string.IsNullOrEmpty(ContractId)) + { + Model.PHTGL_ContractTrack queryContractTrack = new Model.PHTGL_ContractTrack(); + queryContractTrack.ProjectId = this.CurrUser.LoginProjectId; + queryContractTrack.ContractId = this.ContractId; + var modelContractTracks = + BLL.PhtglContractTrackService.GetPHTGL_ContractTrackByModle(queryContractTrack); + foreach (var item in modelContractTracks) + { + PhtglContracttrackprogressService.CheckProgressByContractTrackId(item.Id); + } + } + } + + protected void btnQuery_OnClick(object sender, EventArgs e) + { + BindGrid(); + } + + protected void btnGetChart_Click(object sender, EventArgs e) + { + if (!string.IsNullOrEmpty(ContractId)) + { + var model = ContractService.GetContractById(ContractId); + if (model != null) + { + PageContext.RegisterStartupScript( + Window2.GetShowReference(string.Format("ContractTrackProgressChart.aspx?ContractId={0}", model.ContractId, "图表 - "))); + } + } + else + { + ShowNotify("请选择施工分包合同", MessageBoxIcon.Question); + } + } + #endregion + + #region 获取权限按钮 + /// + /// 获取按钮权限 + /// + /// + /// + private void GetButtonPower() + { + var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.PersonId, BLL.Const.PHTGL_ContractTrackProgressDetectionMenuId); + if (buttonList.Count > 0) + { + if (buttonList.Contains(BLL.Const.BtnAdd)) + { + //this.btnNew.Hidden = false; + } + if (buttonList.Contains(BLL.Const.BtnModify)) + { + // this.btnMenuEdit.Hidden = false; + } + if (buttonList.Contains(BLL.Const.BtnDelete)) + { + // this.btnMenuDelete.Hidden = false; + } + } + } + #endregion + + #region 关闭弹出窗 + /// + /// 关闭弹出窗 + /// + /// + /// + protected void Window1_Close(object sender, WindowCloseEventArgs e) + { + BindGrid(); + } + #endregion + + #region 导出按钮 + /// 导出按钮 + ///
+ /// + /// + protected void btnOut_Click(object sender, EventArgs e) + { + Response.ClearContent(); + string filename = Funs.GetNewFileName(); + Response.AddHeader("content-disposition", "attachment; filename=" + System.Web.HttpUtility.UrlEncode("合同执行跟踪表" + filename, System.Text.Encoding.UTF8) + ".xls"); + Response.ContentType = "application/excel"; + Response.ContentEncoding = System.Text.Encoding.UTF8; + this.Grid1.PageSize = 500; + this.BindGrid(); + Response.Write(GetGridTableHtml(Grid1)); + Response.End(); + } + + /// + /// 导出方法 + /// + /// + /// + private string GetGridTableHtml(Grid grid) + { + StringBuilder sb = new StringBuilder(); + sb.Append(""); + sb.Append(""); + sb.Append(""); + foreach (GridColumn column in grid.Columns) + { + sb.AppendFormat("", column.HeaderText); + } + sb.Append(""); + foreach (GridRow row in grid.Rows) + { + sb.Append(""); + foreach (GridColumn column in grid.Columns) + { + string html = row.Values[column.ColumnIndex].ToString(); + if (column.ColumnID == "tfNumber") + { + html = (row.FindControl("lblNumber") as System.Web.UI.WebControls.Label).Text; + } + sb.AppendFormat("", html); + } + + sb.Append(""); + } + + sb.Append("
{0}
{0}
"); + + return sb.ToString(); + } + #endregion + + + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/PHTGL/ContractCompile/ContractTrackProgressDetectionGrid.aspx.designer.cs b/SGGL/FineUIPro.Web/PHTGL/ContractCompile/ContractTrackProgressDetectionGrid.aspx.designer.cs new file mode 100644 index 00000000..dc989cb2 --- /dev/null +++ b/SGGL/FineUIPro.Web/PHTGL/ContractCompile/ContractTrackProgressDetectionGrid.aspx.designer.cs @@ -0,0 +1,143 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.PHTGL.ContractCompile +{ + + + public partial class ContractTrackProgressDetectionGrid + { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// Panel3 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel Panel3; + + /// + /// panelCenterRegion 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel panelCenterRegion; + + /// + /// Grid1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Grid Grid1; + + /// + /// Toolbar4 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar4; + + /// + /// txtProjectCode 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtProjectCode; + + /// + /// txtProjectName 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtProjectName; + + /// + /// btnQuery 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnQuery; + + /// + /// btnGetChart 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnGetChart; + + /// + /// btnSave 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnSave; + + /// + /// btnOut 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnOut; + + /// + /// Window1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Window1; + + /// + /// Window2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Window2; + } +} diff --git a/SGGL/FineUIPro.Web/common/Menu_DigData.xml b/SGGL/FineUIPro.Web/common/Menu_DigData.xml index b532a9bb..bb7a7a34 100644 --- a/SGGL/FineUIPro.Web/common/Menu_DigData.xml +++ b/SGGL/FineUIPro.Web/common/Menu_DigData.xml @@ -1,9 +1,51 @@  - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -16,12 +58,15 @@ + + + - - - - - + + + + + \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/common/Menu_PHTGL.xml b/SGGL/FineUIPro.Web/common/Menu_PHTGL.xml index 4e56de27..3ccb32ac 100644 --- a/SGGL/FineUIPro.Web/common/Menu_PHTGL.xml +++ b/SGGL/FineUIPro.Web/common/Menu_PHTGL.xml @@ -35,9 +35,8 @@ - - - - - + + + + \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/common/Menu_ZHGL.xml b/SGGL/FineUIPro.Web/common/Menu_ZHGL.xml index 03eb9188..9bc36592 100644 --- a/SGGL/FineUIPro.Web/common/Menu_ZHGL.xml +++ b/SGGL/FineUIPro.Web/common/Menu_ZHGL.xml @@ -48,43 +48,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -