Пример #1
0
        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");
        }
Пример #2
0
        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));
        }
    }
Пример #4
0
    /// <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, "");
        }
    }
Пример #5
0
    /// <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 ud_deMoney, ud_deTotalChangeMoney, ud_deChangeMoney;

            ud_deMoney            = decimal.Zero;
            ud_deTotalChangeMoney = decimal.Zero;
            ud_deChangeMoney      = 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;

            TotalMoney    = entity.GetDecimal("TotalMoney");
            OriginalMoney = entity.GetDecimal("OriginalMoney");
            BudgetMoney   = entity.GetDecimal("BudgetMoney");
            AdjustMoney   = entity.GetDecimal("AdjustMoney");

            NewTotalMoney = TotalMoney;

            ud_deMoney = TotalMoney;

            foreach (DataRow dr in entity.Tables["ContractChange"].Select(string.Format("ContractChangeCode={0}", this.ApplicationCode), "", System.Data.DataViewRowState.CurrentRows))
            {
                NewTotalMoney = (decimal)dr["NewMoney"];

                ud_deTotalChangeMoney = (decimal)dr["TotalChangeMoney"];
                ud_deChangeMoney      = (decimal)dr["ChangeMoney"];
            }



            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    = OriginalMoney.ToString("N");
                txtOperTotalChangeMoney.Value = ud_deTotalChangeMoney.ToString("N");
                txtOperChangeMoney.Value      = ud_deChangeMoney.ToString("N");
                txtOperNewTotalMoney.Value    = NewTotalMoney.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("合同金额", ud_deMoney.ToString());
            SaveOperationProperty("单一变更", ud_deChangeMoney.ToString());
            SaveOperationProperty("累计变更", ud_deTotalChangeMoney.ToString());
        }
        catch (Exception ex)
        {
            ApplicationLog.WriteLog(this.ToString(), ex, "");
        }
    }