示例#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;
            }


            lblTotalMoney.Text       = TotalMoney.ToString("N");
            lblTotalChangeMoney.Text = TotalChangeMoney.ToString("N");
            lblChangeMoney.Text      = ChangeMoney.ToString("N");
            lblNewTotalMoney.Text    = NewTotalMoney.ToString("N");
        }
示例#3
0
        /// <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, "");
            }
        }
    /// <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, "");
        }
    }