private void ShowContractMoney(EntityData entity, string contractChangeCode) { entity.SetCurrentTable("Contract"); decimal TotalMoney, TotalChangeMoney, OriginalMoney, NewTotalMoney, ChangeMoney, BudgetMoney, AdjustMoney;; OriginalMoney = entity.GetDecimal("OriginalMoney"); BudgetMoney = entity.GetDecimal("BudgetMoney"); AdjustMoney = entity.GetDecimal("AdjustMoney"); TotalMoney = Decimal.Zero; TotalChangeMoney = Decimal.Zero; foreach (DataRow dr in entity.Tables["ContractChange"].Select(string.Format("ContractChangeCode={0}", contractChangeCode), "", System.Data.DataViewRowState.CurrentRows)) { TotalMoney = dr["Money"] != DBNull.Value ? (decimal)dr["Money"] : Decimal.Zero; TotalChangeMoney = dr["TotalChangeMoney"] != DBNull.Value ? (decimal)dr["TotalChangeMoney"] : Decimal.Zero; } NewTotalMoney = BLL.MathRule.SumColumn(entity.Tables["ContractCostChange"].Select(String.Format("ContractChangeCode='{0}' and Status in (0,1)", contractChangeCode)), "NewMoney"); ChangeMoney = NewTotalMoney - TotalMoney; hidOriginalMoney.Value = OriginalMoney.ToString(); hidTotalChangeMoney.Value = TotalChangeMoney.ToString(); txtBudgetMoney.Value = BudgetMoney.ToString("N"); txtAdjustMoney.Value = AdjustMoney.ToString("N"); txtOriginalMoney.Value = OriginalMoney.ToString("N"); txtTotalChangeMoney.Value = TotalChangeMoney.ToString("N"); txtChangeMoney.Value = ChangeMoney.ToString("N"); txtNewTotalMoney.Value = NewTotalMoney.ToString("N"); }
private void ShowContractMoney(EntityData entity, string contractChangeCode) { entity.SetCurrentTable("Contract"); decimal TotalMoney, TotalChangeMoney, OriginalMoney, NewTotalMoney, ChangeMoney, BudgetMoney, AdjustMoney;; OriginalMoney = entity.GetDecimal("OriginalMoney"); BudgetMoney = entity.GetDecimal("BudgetMoney"); AdjustMoney = entity.GetDecimal("AdjustMoney"); TotalMoney = Decimal.Zero; TotalChangeMoney = Decimal.Zero; NewTotalMoney = Decimal.Zero; ChangeMoney = Decimal.Zero; foreach (DataRow dr in entity.Tables["ContractChange"].Select(string.Format("ContractChangeCode={0}", contractChangeCode), "", System.Data.DataViewRowState.CurrentRows)) { TotalMoney = dr["Money"] != DBNull.Value ? (decimal)dr["Money"] : Decimal.Zero; TotalChangeMoney = dr["TotalChangeMoney"] != DBNull.Value ? (decimal)dr["TotalChangeMoney"] : Decimal.Zero; NewTotalMoney = dr["NewMoney"] != DBNull.Value ? (decimal)dr["NewMoney"] : Decimal.Zero; ChangeMoney = dr["ChangeMoney"] != DBNull.Value ? (decimal)dr["ChangeMoney"] : Decimal.Zero; } lblTotalMoney.Text = TotalMoney.ToString("N"); lblTotalChangeMoney.Text = TotalChangeMoney.ToString("N"); lblChangeMoney.Text = ChangeMoney.ToString("N"); lblNewTotalMoney.Text = NewTotalMoney.ToString("N"); }
/// <summary> /// 装载控件数据 /// </summary> public void LoadData() { try { string contractCode = Request["ContractCode"] + ""; string projectCode = Request["ProjectCode"] + ""; EntityData entity = DAL.EntityDAO.ContractDAO.GetStandard_ContractByCode(contractCode); if (!entity.HasRecord()) { return; } //合同基本信息 lblProjectName.Text = BLL.ProjectRule.GetProjectName(projectCode); lblContractID.Text = entity.GetString("ContractID"); lblContractName.Text = entity.GetString("ContractName"); lblSupplierName.Text = BLL.ProjectRule.GetSupplierName(entity.GetString("SupplierCode")); //显示合同金额 decimal TotalMoney, TotalChangeMoney, OriginalMoney, NewTotalMoney, ChangeMoney, BudgetMoney, AdjustMoney, EstimateChangeMoney; string contractLabel = entity.GetString("ContractLabel"); TotalMoney = entity.GetDecimal("TotalMoney"); OriginalMoney = entity.GetDecimal("OriginalMoney"); BudgetMoney = entity.GetDecimal("BudgetMoney"); AdjustMoney = entity.GetDecimal("AdjustMoney"); TotalChangeMoney = TotalMoney - OriginalMoney; if (contractLabel != "") { NewTotalMoney = BLL.MathRule.SumColumn(entity.Tables["ContractCostChange"].Select(String.Format("ContractChangeCode='{0}'", contractLabel)), "NewMoney"); } else { NewTotalMoney = TotalMoney; } ChangeMoney = NewTotalMoney - TotalMoney; EstimateChangeMoney = TotalChangeMoney + ChangeMoney; lblTotalChangeMoney.Text = TotalChangeMoney.ToString("#,##0.00"); lblChangeMoney.Text = ChangeMoney.ToString("#,##0.00"); lblEstimateChangeMoney.Text = EstimateChangeMoney.ToString("#,##0.00"); entity.Dispose(); } catch (Exception ex) { ApplicationLog.WriteLog(this.ToString(), ex, ""); } }
/// <summary> /// 装载控件数据 /// </summary> public void LoadData() { try { string projectCode = Request["ProjectCode"] + ""; string paymentCode = Request["PaymentCode"] + ""; EntityData entity = DAL.EntityDAO.PaymentDAO.GetStandard_PaymentByCode(paymentCode); if (entity.HasRecord()) { string contractCode = entity.GetString("ContractCode"); EntityData entityCon = DAL.EntityDAO.ContractDAO.GetStandard_ContractByCode(contractCode); if (entityCon.HasRecord()) { lblProjectName.Text = BLL.ProjectRule.GetProjectName(projectCode); lblContractName.Text = entityCon.GetString("ContractName"); lblContractID.Text = entityCon.GetString("ContractID"); lblSupplierName.Text = entity.GetString("SupplyName"); lblCheckOpinion.Text = HttpUtility.HtmlEncode(entity.GetString("CheckOpinion")).Replace("\n", "<br>"); //显示合同金额 decimal TotalMoney, TotalChangeMoney, ChangeMoney, OriginalMoney, BudgetMoney, AdjustMoney, NewTotalMoney; TotalMoney = entityCon.GetDecimal("TotalMoney"); OriginalMoney = entityCon.GetDecimal("OriginalMoney"); BudgetMoney = entityCon.GetDecimal("BudgetMoney"); AdjustMoney = entityCon.GetDecimal("AdjustMoney"); TotalChangeMoney = TotalMoney - OriginalMoney; ChangeMoney = BLL.MathRule.SumColumn(entityCon.Tables["ContractChange"].Select("Status in ( 1,2)", "", System.Data.DataViewRowState.CurrentRows), "ChangeMoney"); NewTotalMoney = TotalMoney + ChangeMoney; lblTotalMoney.Text = TotalMoney.ToString("N"); lblTotalChangeMoney.Text = TotalChangeMoney.ToString("N"); lblChangeMoney.Text = ChangeMoney.ToString("N"); lblNewTotalMoney.Text = NewTotalMoney.ToString("N"); } decimal negAHMoney, TotalItemMoney, TotalPayMoney; TotalItemMoney = entity.GetDecimal("Money"); negAHMoney = -BLL.CBSRule.GetAHMoney("", "", "", contractCode, "1", ""); TotalPayMoney = TotalItemMoney - negAHMoney; lblTotalPayMoney.Text = TotalPayMoney.ToString("N"); lblNegAHMoney.Text = negAHMoney.ToString("N"); lblTotalItemMoney.Text = TotalItemMoney.ToString("N"); } } catch (Exception ex) { ApplicationLog.WriteLog(this.ToString(), ex, ""); } }
private void ShowContractMoney(EntityData entity, string contractChangeCode) { entity.SetCurrentTable("Contract"); decimal TotalMoney, TotalChangeMoney, OriginalMoney, NewTotalMoney, ChangeMoney, BudgetMoney, AdjustMoney;; OriginalMoney = entity.GetDecimal("OriginalMoney"); BudgetMoney = entity.GetDecimal("BudgetMoney"); AdjustMoney = entity.GetDecimal("AdjustMoney"); TotalMoney = Decimal.Zero; TotalChangeMoney = Decimal.Zero; NewTotalMoney = Decimal.Zero; ChangeMoney = Decimal.Zero; foreach (DataRow dr in entity.Tables["ContractChange"].Select(string.Format("ContractChangeCode={0}", contractChangeCode), "", System.Data.DataViewRowState.CurrentRows)) { TotalMoney = dr["Money"] != DBNull.Value ? (decimal)dr["Money"] : Decimal.Zero; TotalChangeMoney = dr["TotalChangeMoney"] != DBNull.Value ? (decimal)dr["TotalChangeMoney"] : Decimal.Zero; NewTotalMoney = dr["NewMoney"] != DBNull.Value ? (decimal)dr["NewMoney"] : Decimal.Zero; ChangeMoney = dr["ChangeMoney"] != DBNull.Value ? (decimal)dr["ChangeMoney"] : Decimal.Zero; } //合同原币金额 decimal OriginalCash, NewTotalCash, ChangeCash, TotalChangeCash; string[] arrField = { "OriginalCash" }; decimal[] arrValue = RmsPM.BLL.MathRule.SumColumn(entity.Tables["ContractCostCash"], arrField); OriginalCash = arrValue[0]; string[] arrField2 = { "NewMoney", "NewCash", "TotalChangeCash", "ChangeCash" }; decimal[] arrValue2 = RmsPM.BLL.MathRule.SumColumn(entity.Tables["ContractCostChange"].Select(String.Format("ContractChangeCode='{0}' and Status in (0,1)", contractChangeCode)), arrField2); // NewTotalMoney = arrValue2[0]; NewTotalCash = arrValue2[1]; TotalChangeCash = arrValue2[2]; ChangeCash = arrValue2[3]; hidOriginalMoney.Value = OriginalMoney.ToString(); hidTotalChangeMoney.Value = TotalChangeMoney.ToString(); txtBudgetMoney.Value = BudgetMoney.ToString("N"); txtAdjustMoney.Value = AdjustMoney.ToString("N"); txtOriginalMoney.Value = OriginalCash.ToString("N"); txtTotalChangeMoney.Value = TotalChangeCash.ToString("N"); txtChangeMoney.Value = ChangeCash.ToString("N"); txtNewTotalMoney.Value = NewTotalCash.ToString("N"); }
/// <summary> /// 装载控件数据 /// </summary> public override void LoadData() { try { string ud_sAction = ""; if (this.ApplicationCode != "") { this.OperationCode = RmsPM.BLL.ContractRule.GetContractCodeByAccountCode(this.ApplicationCode); } else if (this.OperationCode != "") { this.ApplicationCode = RmsPM.DAL.EntityDAO.SystemManageDAO.GetNewSysCode("ContractAccountCode"); ud_sAction = "Add"; } else { return; } this.ContractCode = this.OperationCode; EntityData entity = RmsPM.DAL.EntityDAO.ContractDAO.GetStandard_ContractByCode(this.ContractCode); if (ud_sAction == "Add") { //新增 DataRow drAdd = entity.GetNewRecord("ContractAccount"); drAdd["ContractAccountCode"] = this.ApplicationCode; drAdd["ContractCode"] = this.ContractCode; drAdd["Status"] = 0; drAdd["CreateDate"] = DateTime.Now.ToString("yyyy-MM-dd"); drAdd["CreatePerson"] = this.UserCode; entity.Tables["ContractAccount"].Rows.Add(drAdd); } entity.SetCurrentTable("Contract"); if (!entity.HasRecord()) { return; } this.ProjectCode = entity.GetString("ProjectCode"); this.ApplicationType = RmsPM.BLL.SystemGroupRule.GetSystemGroupSortIDByGroupCode(entity.GetString("Type")); this.ApplicationTitle = entity.GetString("ContractName"); string ud_sHyperLinkFormat = "../Contract/ContractInfo.aspx?ContractCode={0}&ProjectCode={1}"; //合同基本信息 lblOperProjectName.Text = RmsPM.BLL.ProjectRule.GetProjectName(this.ProjectCode); lblEyeProjectName.Text = lblOperProjectName.Text; lblOperContractID.Text = entity.GetString("ContractID"); lblEyeContractID.Text = lblOperContractID.Text; lblOperContractName.Text = ShowApplicationHyperLink(entity.GetString("ContractName"), string.Format(ud_sHyperLinkFormat, this.ContractCode, this.ProjectCode)); //entity.GetString("ContractName"); lblEyeContractName.Text = lblOperContractName.Text; lblOperSupplierName.Text = RmsPM.BLL.ProjectRule.GetSupplierName(entity.GetString("SupplierCode")); lblEyeSupplierName.Text = lblOperSupplierName.Text; lblOperSupplier2Name.Text = RmsPM.BLL.ProjectRule.GetSupplierName(entity.GetString("Supplier2Code")); lblEyeSupplier2Name.Text = lblOperSupplier2Name.Text; lblOperBuilding.Text = entity.GetString("Building"); lblEyeBuilding.Text = lblOperBuilding.Text; //显示合同金额 decimal TotalMoney, TotalChangeMoney, OriginalMoney, ChangeMoney, BudgetMoney, AdjustMoney, EstimateChangeMoney; TotalMoney = entity.GetDecimal("TotalMoney"); OriginalMoney = entity.GetDecimal("OriginalMoney"); BudgetMoney = entity.GetDecimal("BudgetMoney"); AdjustMoney = entity.GetDecimal("AdjustMoney"); TotalChangeMoney = TotalMoney - OriginalMoney; ChangeMoney = RmsPM.BLL.MathRule.SumColumn(entity.Tables["ContractChange"].Select("Status in (1,2)"), "ChangeMoney"); EstimateChangeMoney = TotalChangeMoney + ChangeMoney; switch (this.MoneyState) { case ModuleState.Sightless: //不可见的 case ModuleState.Begin: //不可见的 case ModuleState.End: //不可见的 txtOperOriginalMoney.Value = "***************"; txtOperTotalChangeMoney.Value = "***************"; txtOperNewTotalMoney.Value = "***************"; txtOperBudgetMoney.Value = "***************"; txtOperAdjustMoney.Value = "***************"; txtOperEstimateChangeMoney.Value = "***************"; break; case ModuleState.Operable: //可操作的 case ModuleState.Eyeable: //可见的 txtOperOriginalMoney.Value = OriginalMoney.ToString("N"); txtOperTotalChangeMoney.Value = TotalChangeMoney.ToString("N"); txtOperNewTotalMoney.Value = TotalMoney.ToString("N"); txtOperBudgetMoney.Value = BudgetMoney.ToString("N"); txtOperAdjustMoney.Value = AdjustMoney.ToString("N"); txtOperEstimateChangeMoney.Value = EstimateChangeMoney.ToString("N"); break; default: tabOperMoney.Visible = false; tabEyeMoney.Visible = false; break; } txtEyeOriginalMoney.Value = txtOperOriginalMoney.Value; txtEyeTotalChangeMoney.Value = txtOperTotalChangeMoney.Value; txtEyeNewTotalMoney.Value = txtOperNewTotalMoney.Value; txtEyeBudgetMoney.Value = txtOperBudgetMoney.Value; txtEyeAdjustMoney.Value = txtOperAdjustMoney.Value; txtEyeEstimateChangeMoney.Value = txtOperEstimateChangeMoney.Value; hidOriginalMoney.Value = OriginalMoney.ToString(); //1.原合同金额 txtOperSupplierOriginalMoney.Value = OriginalMoney.ToString("N"); txtEyeSupplierOriginalMoney.Value = txtOperSupplierOriginalMoney.Value; txtOperConsultantOriginalMoney.Value = OriginalMoney.ToString("N"); txtEyeConsultantOriginalMoney.Value = txtOperConsultantOriginalMoney.Value; txtOperProjectOriginalMoney.Value = OriginalMoney.ToString("N"); txtEyeProjectOriginalMoney.Value = txtOperProjectOriginalMoney.Value; //合同结算信息 entity.SetCurrentTable("ContractAccount"); foreach (DataRow dr in entity.CurrentTable.Select(String.Format("ContractAccountCode='{0}'", this.ApplicationCode))) { txtOperContractAccountID.Value = dr["ContractAccountID"].ToString(); lblEyeContractAccountID.Text = txtOperContractAccountID.Value; txtOperReason.Value = dr["Reason"].ToString(); lblEyeReason.Text = HttpUtility.HtmlEncode(txtOperReason.Value).Replace("\n", "<br>"); decimal SupplierTotalChangeMoney, ConsultantTotalAuditMoney, ProjectTotalAuditMoney; decimal SupplierTotalMoney, ConsultantTotalMoney, ProjectTotalMoney; SupplierTotalChangeMoney = RmsPM.BLL.MathRule.SumColumn(entity.Tables["ContractChange"].Select(String.Format("ContractCode='{0}' and Status=0", this.ContractCode)), "SupplierChangeMoney"); ConsultantTotalAuditMoney = RmsPM.BLL.MathRule.SumColumn(entity.Tables["ContractChange"].Select(String.Format("ContractCode='{0}' and Status=0", this.ContractCode)), "ConsultantAuditMoney"); ProjectTotalAuditMoney = RmsPM.BLL.MathRule.SumColumn(entity.Tables["ContractChange"].Select(String.Format("ContractCode='{0}' and Status=0", this.ContractCode)), "ProjectAuditMoney"); SupplierTotalMoney = OriginalMoney + SupplierTotalChangeMoney; ConsultantTotalMoney = OriginalMoney + ConsultantTotalAuditMoney; ProjectTotalMoney = OriginalMoney + ProjectTotalAuditMoney; //2.变更总额 txtOperSupplierTotalChangeMoney.Value = SupplierTotalChangeMoney.ToString("N"); txtEyeSupplierTotalChangeMoney.Value = txtOperSupplierTotalChangeMoney.Value; txtOperConsultantTotalAuditMoney.Value = ConsultantTotalAuditMoney.ToString("N"); txtEyeConsultantTotalAuditMoney.Value = txtOperConsultantTotalAuditMoney.Value; txtOperProjectTotalAuditMoney.Value = ProjectTotalAuditMoney.ToString("N"); txtEyeProjectTotalAuditMoney.Value = txtOperProjectTotalAuditMoney.Value; //3. 其他(调整/扣款) txtOperSupplierTotalMoney.Value = SupplierTotalMoney.ToString("N"); txtEyeSupplierTotalMoney.Value = txtOperSupplierTotalMoney.Value; txtOperConsultantTotalMoney.Value = ConsultantTotalMoney.ToString("N"); txtEyeConsultantTotalMoney.Value = txtOperConsultantTotalMoney.Value; //string str = Request["ContractChangeCode"]; //if (String.IsNullOrEmpty(str)) str = entity.Tables["ContractAccount"].Rows[0]["contractchangeid"].ToString(); //foreach (DataRow dr in entity.Tables["contractchange"].Select(String.Format("ContractChangeCode='{0}'", str), "", DataViewRowState.CurrentRows)) //{ //} //txtOperProjectAdjustMoney.Value = ""; txtOperProjectTotalMoney.Value = ProjectTotalMoney.ToString("N"); txtEyeProjectTotalMoney.Value = txtOperProjectTotalMoney.Value; } //业务流程属性保存 string ContractChangeCode = Request["ContractChangeCode"]; if (String.IsNullOrEmpty(ContractChangeCode)) { string temp = string.Empty; foreach (DataRow dr in entity.Tables["ContractAccount"].Select(String.Format("ContractAccountCode='{0}'", this.ApplicationCode), "", DataViewRowState.CurrentRows)) { temp = dr["contractchangeid"].ToString(); } ContractChangeCode = temp; } decimal sum = 0; foreach (DataRow dr in entity.Tables["ContractCostChange"].Select(String.Format("ContractChangeCode='{0}'", ContractChangeCode), "", DataViewRowState.CurrentRows)) { try { sum += RmsPM.BLL.ConvertRule.ToDecimal(dr["changemoney"]); } catch { } } try { txtOperProjectAdjustMoney.Value = sum.ToString("N"); txtEyeProjectAdjustMoney.Value = sum.ToString("N"); } catch { } try { txtOperProjectTotalMoney.Value = (RmsPM.BLL.ConvertRule.ToDecimal(txtOperProjectTotalMoney.Value) + sum).ToString("N"); txtEyeProjectTotalMoney.Value = (RmsPM.BLL.ConvertRule.ToDecimal(txtOperProjectTotalMoney.Value) + sum).ToString("N"); } catch { } if (!String.IsNullOrEmpty(ContractChangeCode) && ContractChangeCode != "0") { int changecount = 0; try { changecount = entity.Tables["contractchange"].Rows.Count; txtOperSupplierAdjustMoney.Value = RmsPM.BLL.ConvertRule.ToDecimal(entity.Tables["contractchange"].Rows[changecount - 1]["SupplierChangeMoney"].ToString()).ToString("N"); } catch { } try { txtOperConsultantAdjustMoney.Value = RmsPM.BLL.ConvertRule.ToDecimal(entity.Tables["contractchange"].Rows[changecount - 1]["ConsultantAuditMoney"].ToString()).ToString("N"); } catch { } txtEyeSupplierAdjustMoney.Value = txtOperSupplierAdjustMoney.Value; txtEyeConsultantAdjustMoney.Value = txtOperConsultantAdjustMoney.Value; } SaveOperationProperty("合同金额", OriginalMoney.ToString()); //xyq 2008.2.8 累计变更要包括本次结算变更金额 SaveOperationProperty("累计变更", (TotalChangeMoney + sum).ToString()); // SaveOperationProperty("累计变更", TotalChangeMoney.ToString()); SaveOperationProperty("结算金额", sum.ToString()); entity.Dispose(); } catch (Exception ex) { ApplicationLog.WriteLog(this.ToString(), ex, ""); Response.Write(Rms.Web.JavaScript.Alert(true, "读取合同结算信息出错:" + ex.Message)); } }
/// <summary> /// 装载控件数据 /// </summary> public override void LoadData() { try { if (this.ApplicationCode != "") { this.OperationCode = this.ApplicationCode; } else if (this.OperationCode != "") { this.ApplicationCode = this.OperationCode; } else { return; } this.ContractCode = this.OperationCode; EntityData entity = RmsPM.DAL.EntityDAO.ContractDAO.GetStandard_ContractByCode(this.ContractCode); entity.SetCurrentTable("Contract"); if (!entity.HasRecord()) { return; } this.ProjectCode = entity.GetString("ProjectCode"); this.ApplicationTitle = entity.GetString("ContractName"); this.ApplicationType = RmsPM.BLL.SystemGroupRule.GetSystemGroupSortIDByGroupCode(entity.GetString("Type")); string ud_sHyperLinkFormat = "../Contract/ContractInfo.aspx?ContractCode={0}&ProjectCode={1}"; //合同基本信息 lblOperProjectName.Text = RmsPM.BLL.ProjectRule.GetProjectName(this.ProjectCode); lblEyeProjectName.Text = lblOperProjectName.Text; txtOperContractID.Value = entity.GetString("ContractID"); lblEyeContractID.Text = txtOperContractID.Value; txtOperContractName.Value = entity.GetString("ContractName"); lblEyeContractName.Text = ShowApplicationHyperLink(entity.GetString("ContractName"), string.Format(ud_sHyperLinkFormat, this.ContractCode, this.ProjectCode)); inputOperSystemGroup.Value = entity.GetString("Type"); lblEyeSystemGroupName.Text = inputOperSystemGroup.Text; txtOperSupplierCode.Value = entity.GetString("SupplierCode"); txtOperSupplierName.Value = RmsPM.BLL.ProjectRule.GetSupplierName(entity.GetString("SupplierCode")); lblEyeSupplierName.Text = txtOperSupplierName.Value; txtOperContractObject.Value = entity.GetString("ContractObject"); lblEyeContractObject.Text = HttpUtility.HtmlEncode(txtOperContractObject.Value).Replace("\n", "<br>"); OperContractDate.Value = entity.GetDateTimeOnlyDate("ContractDate"); lblEyeContractDate.Text = OperContractDate.Value; txtOperSupplier2Code.Value = entity.GetString("Supplier2Code"); txtOperSupplier2Name.Value = RmsPM.BLL.ProjectRule.GetSupplierName(entity.GetString("Supplier2Code")); lblEyeSupplier2Name.Text = txtOperSupplier2Name.Value; txtOperBuilding.Value = entity.GetString("Building"); lblEyeBuilding.Text = txtOperBuilding.Value; //显示合同金额 decimal TotalMoney, TotalChangeMoney, OriginalMoney, BudgetMoney, AdjustMoney; string contractLabel = entity.GetString("ContractLabel"); TotalMoney = entity.GetDecimal("TotalMoney"); OriginalMoney = entity.GetDecimal("OriginalMoney"); BudgetMoney = entity.GetDecimal("BudgetMoney"); AdjustMoney = entity.GetDecimal("AdjustMoney"); TotalChangeMoney = TotalMoney - OriginalMoney; switch (this.MoneyState) { case ModuleState.Sightless: //不可见的 case ModuleState.Begin: //不可见的 case ModuleState.End: //不可见的 txtOperOriginalMoney.Value = "***************"; txtOperTotalChangeMoney.Value = "***************"; txtOperNewTotalMoney.Value = "***************"; txtOperBudgetMoney.Value = "***************"; txtOperAdjustMoney.Value = "***************"; break; case ModuleState.Operable: //可操作的 case ModuleState.Eyeable: //可见的 txtOperOriginalMoney.Value = OriginalMoney.ToString("N"); txtOperTotalChangeMoney.Value = TotalChangeMoney.ToString("N"); txtOperNewTotalMoney.Value = TotalMoney.ToString("N"); txtOperBudgetMoney.Value = BudgetMoney.ToString("N"); txtOperAdjustMoney.Value = AdjustMoney.ToString("N"); break; default: tabOperMoney.Visible = false; tabEyeMoney.Visible = false; break; } txtEyeOriginalMoney.Value = txtOperOriginalMoney.Value; txtEyeTotalChangeMoney.Value = txtOperTotalChangeMoney.Value; txtEyeNewTotalMoney.Value = txtOperNewTotalMoney.Value; txtEyeBudgetMoney.Value = txtOperBudgetMoney.Value; txtEyeAdjustMoney.Value = txtOperAdjustMoney.Value; //业务流程属性保存 SaveOperationProperty("合同金额", entity.GetDecimal("TotalMoney").ToString()); SaveOperationProperty("主要标段", entity.GetInt("Mostly").ToString()); entity.Dispose(); } catch (Exception ex) { ApplicationLog.WriteLog(this.ToString(), ex, ""); } }
/// <summary> /// 装载控件数据 /// </summary> public override void LoadData() { try { if (this.ApplicationCode != "") { this.OperationCode = this.ApplicationCode; } else if (this.OperationCode != "") { this.ApplicationCode = this.OperationCode; } else { return; } this.ContractCode = RmsPM.BLL.ContractRule.GetContractCodeByChangeCode(this.OperationCode); EntityData entity = RmsPM.DAL.EntityDAO.ContractDAO.GetStandard_ContractByCode(this.ContractCode); entity.SetCurrentTable("Contract"); if (!entity.HasRecord()) { return; } this.ProjectCode = entity.GetString("ProjectCode"); this.ApplicationType = RmsPM.BLL.SystemGroupRule.GetSystemGroupSortIDByGroupCode(entity.GetString("Type")); this.ApplicationTitle = entity.GetString("ContractName"); string ud_sHyperLinkFormat = "../Contract/ContractInfo.aspx?ContractCode={0}&ProjectCode={1}"; decimal TotalChangeMoney, ChangeMoney; TotalChangeMoney = decimal.Zero; ChangeMoney = decimal.Zero; //合同基本信息 lblProjectName.Text = RmsPM.BLL.ProjectRule.GetProjectName(this.ProjectCode); lblContractID.Text = entity.GetString("ContractID"); lblOperContractName.Text = ShowApplicationHyperLink(entity.GetString("ContractName"), string.Format(ud_sHyperLinkFormat, this.ContractCode, this.ProjectCode)); lblEyeContractName.Text = lblOperContractName.Text; lblOperSupplierName.Text = RmsPM.BLL.ProjectRule.GetSupplierName(entity.GetString("SupplierCode")); lblEyeSupplierName.Text = lblOperSupplierName.Text; lblOperSupplier2Name.Text = RmsPM.BLL.ProjectRule.GetSupplierName(entity.GetString("Supplier2Code")); lblEyeSupplier2Name.Text = lblOperSupplier2Name.Text; lblOperBuilding.Text = entity.GetString("Building"); lblEyeBuilding.Text = lblOperBuilding.Text; //显示合同金额 decimal TotalMoney, OriginalMoney, NewTotalMoney, BudgetMoney, AdjustMoney; //合同原币金额 decimal ChangeCash, NewCash, OriginalCash, TotalChangeCash; TotalMoney = entity.GetDecimal("TotalMoney"); OriginalMoney = entity.GetDecimal("OriginalMoney"); BudgetMoney = entity.GetDecimal("BudgetMoney"); AdjustMoney = entity.GetDecimal("AdjustMoney"); NewTotalMoney = TotalMoney; foreach (DataRow dr in entity.Tables["ContractChange"].Select(string.Format("ContractChangeCode={0}", this.ApplicationCode), "", System.Data.DataViewRowState.CurrentRows)) { NewTotalMoney = (decimal)dr["NewMoney"]; TotalChangeMoney = (decimal)dr["TotalChangeMoney"]; ChangeMoney = (decimal)dr["ChangeMoney"]; } //本次原币变更金额 2007.1.25 string[] arrField = { "ChangeCash", "NewCash", "OriginalCash", "TotalChangeCash" }; decimal[] arrValue = RmsPM.BLL.MathRule.SumColumn(entity.Tables["ContractCostChange"].Select(string.Format("ContractChangeCode={0}", this.ApplicationCode)), arrField); ChangeCash = arrValue[0]; NewCash = arrValue[1]; OriginalCash = arrValue[2]; TotalChangeCash = arrValue[3]; //显示原币币种 xyq 2007.1.25 if (entity.Tables["ContractCostCash"].Rows.Count > 0) { this.lblOperMoneyType.Text = RmsPM.BLL.ConvertRule.ToString(entity.Tables["ContractCostCash"].Rows[0]["MoneyType"]); this.lblEyeMoneyType.Text = this.lblOperMoneyType.Text; } switch (this.MoneyState) { case ModuleState.Sightless: //不可见的 case ModuleState.Begin: //不可见的 case ModuleState.End: //不可见的 txtOperOriginalMoney.Value = "***************"; txtOperTotalChangeMoney.Value = "***************"; txtOperChangeMoney.Value = "***************"; txtOperNewTotalMoney.Value = "***************"; txtOperBudgetMoney.Value = "***************"; txtOperAdjustMoney.Value = "***************"; break; case ModuleState.Operable: //可操作的 case ModuleState.Eyeable: //可见的 txtOperOriginalMoney.Value = OriginalCash.ToString("N"); txtOperTotalChangeMoney.Value = TotalChangeCash.ToString("N"); txtOperChangeMoney.Value = ChangeCash.ToString("N"); txtOperNewTotalMoney.Value = NewCash.ToString("N"); txtOperBudgetMoney.Value = BudgetMoney.ToString("N"); txtOperAdjustMoney.Value = AdjustMoney.ToString("N"); break; default: tabOperMoney.Visible = false; tabEyeMoney.Visible = false; break; } txtEyeOriginalMoney.Value = txtOperOriginalMoney.Value; txtEyeTotalChangeMoney.Value = txtOperTotalChangeMoney.Value; txtEyeChangeMoney.Value = txtOperChangeMoney.Value; txtEyeNewTotalMoney.Value = txtOperNewTotalMoney.Value; txtEyeBudgetMoney.Value = txtOperBudgetMoney.Value; txtEyeAdjustMoney.Value = txtOperAdjustMoney.Value; //合同变更信息 entity.SetCurrentTable("ContractChange"); foreach (DataRow dr in entity.CurrentTable.Select(String.Format("ContractChangeCode='{0}'", this.ApplicationCode))) { txtOperVoucher.Value = dr["Voucher"].ToString(); lblEyeVoucher.Text = txtOperVoucher.Value; txtOperChangeId.Value = dr["ContractChangeId"].ToString(); lblEyeChangeId.Text = txtOperChangeId.Value; txtOperChangeReason.Value = dr["ChangeReason"].ToString(); lblEyeChangeReason.Text = HttpUtility.HtmlEncode(txtOperChangeReason.Value).Replace("\n", "<br>"); txtOperSupplierChangeMoney.Value = dr["SupplierChangeMoney"].ToString(); lblEyeSupplierChangeMoney.Text = txtOperSupplierChangeMoney.Text; txtOperConsultantAuditMoney.Value = dr["ConsultantAuditMoney"].ToString(); lblEyeConsultantAuditMoney.Text = txtOperConsultantAuditMoney.Text; txtOperProjectAuditMoney.Value = dr["ProjectAuditMoney"].ToString(); lblEyeProjectAuditMoney.Text = txtOperProjectAuditMoney.Text; } entity.Dispose(); //业务流程属性保存 SaveOperationProperty("合同金额", OriginalMoney.ToString()); SaveOperationProperty("单一变更", ChangeMoney.ToString()); SaveOperationProperty("累计变更", TotalChangeMoney.ToString()); } catch (Exception ex) { ApplicationLog.WriteLog(this.ToString(), ex, ""); } }