Esempio n. 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;
            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");
        }
Esempio n. 2
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;

            lblOperContractName.Text = ShowApplicationHyperLink(entity.GetString("ContractName"), string.Format(ud_sHyperLinkFormat, this.ContractCode, this.ProjectCode));
            lblEyeContractName.Text  = lblOperContractName.Text;

            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, OriginalMoney, BudgetMoney, AdjustMoney;

            //合同原币金额
            decimal OriginalCash, TotalChangeCash, TotalCash;

            string contractLabel = entity.GetString("ContractLabel");

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

            string[]  arrField = { "Cash", "OriginalCash" };
            decimal[] arrValue = RmsPM.BLL.MathRule.SumColumn(entity.Tables["ContractCostCash"], arrField);
            TotalCash       = arrValue[0];
            OriginalCash    = arrValue[1];
            TotalChangeCash = TotalCash - OriginalCash;

            //显示原币币种 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 = "***************";
                txtOperNewTotalMoney.Value    = "***************";
                txtOperBudgetMoney.Value      = "***************";
                txtOperAdjustMoney.Value      = "***************";
                break;

            case ModuleState.Operable:   //可操作的
            case ModuleState.Eyeable:    //可见的

                txtOperOriginalMoney.Value    = OriginalCash.ToString("N");
                txtOperTotalChangeMoney.Value = TotalChangeCash.ToString("N");
                txtOperNewTotalMoney.Value    = TotalCash.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, "");
        }
    }