Exemple #1
0
 private void InitContractInfo(string contractId)
 {
     if (!string.IsNullOrEmpty(contractId))
     {
         PayoutContractModel model = new PayoutContract().GetModel(contractId);
         this.txtContractCode.Text = model.ContractCode;
         this.txtContractName.Text = model.ContractName;
         PTPrjInfoService pTPrjInfoService = new PTPrjInfoService();
         string           prjCode          = pTPrjInfoService.GetById(model.PrjGuid).PrjCode;
         this.txtPrjCode.Text       = prjCode;
         this.txtProject.Text       = model.PrjName;
         this.txtContractMoney.Text = model.ModifiedMoney.ToString();
         this.txtSignDate.Text      = Convert.ToDateTime(model.SignDate).ToShortDateString();
         PayoutPayment payoutPayment = new PayoutPayment();
         decimal?      paySum        = payoutPayment.GetPaySum(contractId);
         decimal?      invoiceSum    = this.invoice.GetInvoiceSum(contractId);
         this.txtPaymentSum.Text = paySum.ToString();
         this.txtInvoiceSum.Text = invoiceSum.ToString();
         this.txtDiff.Text       = Convert.ToString(paySum - invoiceSum);
         this.txtPayer.Text      = model.AName;
         this.txtPayee.Text      = model.CorpName;
         XPMBasicContactCorp xPMBasicContactCorp = this.GetbasiCorp(model.BName);
         this.txtTaxNo.Text    = xPMBasicContactCorp.TaxCard;
         this.txtContact.Text  = xPMBasicContactCorp.Address + xPMBasicContactCorp.Telephone;
         this.txtBankCode.Text = xPMBasicContactCorp.AccountBank + xPMBasicContactCorp.BankAccounts;
     }
 }
Exemple #2
0
    private void InitContractInfo(string conId)
    {
        PayoutContract      payoutContract = new PayoutContract();
        PayoutContractModel model          = payoutContract.GetModel(conId);

        this.lblContractCode.Text = model.ContractCode;
        this.lblContractName.Text = model.ContractName;
        this.lblPrintDate.Text    = DateTime.Now.ToShortDateString();
        string    userCode  = this.Session["yhdm"].ToString();
        DataTable dataTable = PersonnelAction.QueryPersonnelById(userCode);

        if (dataTable != null && dataTable.Rows.Count == 1)
        {
            this.lblBllProducer.Text = dataTable.Rows[0]["v_xm"].ToString();
        }
        decimal balancedAmount = new PayoutBalance().GetBalancedAmount(conId, false);

        this.lblBalancedSum.Text = balancedAmount.ToString("0.000");
        bool    containPending = this.payoutPayment.GetModel(this.ViewState["PaymentId"].ToString()).ContainPending;
        decimal paySum         = this.payoutPayment.GetPaySum(this.contractId, containPending);

        this.lblPaySum.Text = paySum.ToString("0.000");
        decimal num = balancedAmount - paySum;

        this.lblDiff.Text          = num.ToString("0.000");
        this.lblContractMoney.Text = model.ModifiedMoney.ToString();
        this.lblSignedDate.Text    = model.SignDate.Value.ToShortDateString();
    }
Exemple #3
0
    private string GetContractNameByContractID(string _ContractID)
    {
        string result = string.Empty;

        if (_ContractID.Length == 36)
        {
            if (this.plantype != "" && this.plantype == "payout")
            {
                PayoutContract payoutContract = new PayoutContract();
                result = payoutContract.GetModel(_ContractID).ContractName;
            }
            else
            {
                if (this.plantype != "" && this.plantype == "income")
                {
                    DataTable table = Common2.GetTable("Con_Incomet_Contract", " where ContractID='" + _ContractID + "'");
                    if (table.Rows.Count > 0 && table.Rows[0]["ContractName"] != null)
                    {
                        result = table.Rows[0]["ContractName"].ToString();
                    }
                }
            }
        }
        return(result);
    }
Exemple #4
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!base.IsPostBack)
     {
         this.hfldIsWBSRelevance.Value = this.isWBSRelevance;
         if (!string.IsNullOrEmpty(this.pcode))
         {
             PurchaseModel model = this.purchase.GetModel(this.pcode);
             this.lblPpcode.Text  = model.pcode;
             this.DateInTime.Text = model.intime.ToString("yyyy-MM-dd");
             this.txtPerson.Text  = model.person;
             this.lblExplain.Text = model.explain;
             if (!string.IsNullOrEmpty(model.contract))
             {
                 PayoutContract      payoutContract = new PayoutContract();
                 PayoutContractModel model2         = payoutContract.GetModel(model.contract);
                 if (model2 != null)
                 {
                     this.lblContract.Text = model2.ContractName;
                 }
             }
             this.purchaseStock.GetPrjID(this.pcode);
             DataTable purchaseStockByPscode = this.purchaseStock.GetPurchaseStockByPscode(this.pcode);
             this.ViewState[Equ_Purchase_EquipmentPurchaseView.resourceDataSourceName] = purchaseStockByPscode;
             this.DataBindPurchaseplanStock();
             this.lblBllProducer.Text = model.person;
             this.lblAccessory.Text   = StringUtility.FilesBind(model.pid, "EquipmentPurchase");
             this.lblPrintDate.Text   = DateTime.Now.ToShortDateString();
         }
     }
 }
        public int addIncomePayment(SqlTransaction trans, string id)
        {
            IncometPaymentModel      model = new IncometPayment().GetModel(id);
            fund_AccountOperateModle modle = new fund_AccountOperateModle {
                AccountNum  = Guid.NewGuid().ToString(),
                Acredence   = Guid.NewGuid().ToString(),
                AccounType  = 1,
                AccountMony = model.CllectionPrice,
                RealMony    = model.CllectionPrice
            };
            PtYhmcBll bll = new PtYhmcBll();

            modle.DepID      = bll.GetModelById(base.UserCode).i_bmdm.ToString();
            modle.SumitMan   = base.UserCode;
            modle.SumiTime   = model.CllectionTime;
            modle.IsAccount  = 0;
            modle.contracnum = model.ContractID;
            modle.projnum    = "";
            cn.justwin.stockBLL.AccountManage.accBaise.accBaise baise = new cn.justwin.stockBLL.AccountManage.accBaise.accBaise();
            if (baise.GetModel(1).accAllot == 0)
            {
                PayoutContractModel model3 = new PayoutContract().GetModel(model.ContractID);
                modle.projnum    = model3.PrjGuid;
                modle.contracnum = "";
            }
            modle.AccountMan = string.Empty;
            return(this.dal.AddList(trans, modle));
        }
Exemple #6
0
        public void CommitEvent(object key)
        {
            PayoutPaymentModel       model = this.pm.GetModel(key.ToString());
            fund_AccountOperateModle modle = new fund_AccountOperateModle {
                AccountNum  = Guid.NewGuid().ToString(),
                Acredence   = Guid.NewGuid().ToString(),
                AccounType  = 1,
                AccountMony = new decimal?(Convert.ToDecimal("-" + model.PaymentMoney.ToString())),
                RealMony    = new decimal?(Convert.ToDecimal("-" + model.PaymentMoney.ToString()))
            };
            PtYhmcBll bll = new PtYhmcBll();

            modle.DepID      = bll.GetModelById(base.UserCode).i_bmdm.ToString();
            modle.SumitMan   = base.UserCode;
            modle.SumiTime   = model.InputDate;
            modle.IsAccount  = 0;
            modle.contracnum = model.ContractID;
            modle.projnum    = "";
            cn.justwin.stockBLL.AccountManage.accBaise.accBaise baise = new cn.justwin.stockBLL.AccountManage.accBaise.accBaise();
            if (baise.GetModel(1).accAllot == 0)
            {
                PayoutContractModel model3 = new PayoutContract().GetModel(model.ContractID);
                modle.projnum    = model3.PrjGuid;
                modle.contracnum = "";
            }
            modle.AccountMan  = string.Empty;
            modle.AccountMark = string.Empty;
            new fund_AccountOperateBLL().Add(modle);
        }
Exemple #7
0
    protected string GetContrName(string contrnum)
    {
        PayoutContract      payoutContract = new PayoutContract();
        PayoutContractModel model          = payoutContract.GetModel(contrnum);

        if (model != null)
        {
            return(contrnum = ((model.ContractName == null) ? "无" : model.ContractName));
        }
        return("无");
    }
Exemple #8
0
    private string GetContractName(string contractID)
    {
        PayoutContract      payoutContract = new PayoutContract();
        PayoutContractModel model          = payoutContract.GetModel(contractID);

        if (model == null)
        {
            return(string.Empty);
        }
        return(model.ContractName);
    }
Exemple #9
0
    private DataTable GetData()
    {
        System.DateTime startDate       = Common2.GetStartDate(this.txtStartDate);
        System.DateTime endDate         = Common2.GetEndDate(this.txtEndDate);
        PayoutContract  payoutContract  = new PayoutContract();
        string          reportCondition = payoutContract.GetReportCondition(startDate, endDate, this.txtConType.Text.Trim(), this.txtProject.Text.Trim(), this.txtContractName.Text.Trim(), this.txtContractCode.Text.Trim(), this.txtBName.Text.Trim(), this.dropPrjKindClass.SelectedItem.Text, this.txtSignPersonName.Text.Trim());

        this.contractCount            = this.payoutBalance.Select(reportCondition, base.UserCode);
        this.ViewState["contract"]    = this.contractCount;
        this.AspNetPager1.RecordCount = this.contractCount.Rows.Count;
        return(this.payoutBalance.SelectData(reportCondition, base.UserCode, this.AspNetPager1.CurrentPageIndex, this.AspNetPager1.PageSize));
    }
Exemple #10
0
    private void InitContractInfo(string id)
    {
        PayoutContractModel model = new PayoutContract().GetModel(id);

        this.txtContractCode.Text  = model.ContractCode;
        this.txtContractName.Text  = model.ContractName;
        this.hfldBId.Value         = model.BName;
        this.txtContractMoney.Text = model.ContractMoney.ToString();
        this.txtFinalMoney.Text    = model.ModifiedMoney.ToString();
        this.txtSignDate.Text      = model.SignDate.Value.ToShortDateString();
        this.hdnProjectCode.Value  = model.PrjGuid;
    }
    private void DataBindList()
    {
        PayoutContract payoutContract = new PayoutContract();
        string         text           = base.Request.QueryString["prjCode"];
        DataTable      dataTable      = null;
        decimal        d  = 0m;
        decimal        d2 = 0m;
        decimal        d3 = 0m;
        decimal        d4 = 0m;

        if (!string.IsNullOrEmpty(text))
        {
            string text2 = string.Empty;
            if (!string.IsNullOrEmpty(this.txtCode.Text.Trim()))
            {
                text2 = text2 + " AND taskCode LIKE '%" + this.txtCode.Text.Trim() + "%' ";
            }
            if (!string.IsNullOrEmpty(this.txtName.Text.Trim()))
            {
                text2 = text2 + " AND taskName LIKE '%" + this.txtName.Text.Trim() + "%' ";
            }
            string beginTime = System.DateTime.Now.ToString("yyyy-MM") + "-01";
            string endTime   = System.DateTime.Now.AddMonths(1).ToString("yyyy-MM") + "-01";
            dataTable = payoutContract.GetMonthStatistics(text, beginTime, endTime, text2);
            if (dataTable.Rows.Count > 0)
            {
                foreach (DataRow dataRow in dataTable.Rows)
                {
                    try
                    {
                        if (dataRow["OrderNumber"].ToString().Length / 3 == 1)
                        {
                            d  += System.Convert.ToDecimal(dataRow["Total"]);
                            d2 += System.Convert.ToDecimal(dataRow["mTotal2"]);
                        }
                        d3 += System.Convert.ToDecimal(dataRow["cTotal"]);
                        d4 += System.Convert.ToDecimal(dataRow["tTotal"]);
                    }
                    catch (System.Exception)
                    {
                    }
                }
            }
        }
        this.hfldTotal2.Value = d.ToString();
        this.hfldMTotal.Value = d2.ToString();
        this.hfldCTotal.Value = d3.ToString();
        this.hfldTTotal.Value = d4.ToString();
        this.ViewState["dt"]  = dataTable;
        this.gvwPrjBudgetStatistics.DataSource = dataTable;
        this.gvwPrjBudgetStatistics.DataBind();
    }
Exemple #12
0
    private decimal GetDiffAmount(string contractId, bool containPending)
    {
        PayoutContractModel model          = new PayoutContract().GetModel(contractId);
        decimal             balancedAmount = this.payoutBalance.GetBalancedAmount(contractId, containPending);
        decimal             result;

        if (model.ModifiedMoney.HasValue)
        {
            result = model.ModifiedMoney.Value - balancedAmount;
        }
        else
        {
            result = 0m - balancedAmount;
        }
        return(result);
    }
Exemple #13
0
    private void InitContractInfo(string conId)
    {
        PayoutContract      payoutContract = new PayoutContract();
        PayoutContractModel model          = payoutContract.GetModel(conId);

        this.lblContractCode.Text = model.ContractCode;
        this.lblContractName.Text = model.ContractName;
        this.lblPrintDate.Text    = DateTime.Now.ToShortDateString();
        string    userCode  = this.Session["yhdm"].ToString();
        DataTable dataTable = PersonnelAction.QueryPersonnelById(userCode);

        if (dataTable != null && dataTable.Rows.Count == 1)
        {
            this.lblBllProducer.Text = dataTable.Rows[0]["v_xm"].ToString();
        }
        this.lblContractMoney.Text = model.ModifiedMoney.ToString();
        this.lblSignedDate.Text    = model.SignDate.Value.ToShortDateString();
    }
Exemple #14
0
 private void bindInitData(Guid gid)
 {
     if (gid.ToString() != "")
     {
         MonthDetailModel monthDetailModel = new MonthDetailModel();
         monthDetailModel = this.bll.GetModel(gid);
         if (monthDetailModel != null)
         {
             this.txtPlansubject.Text = monthDetailModel.Plansubject;
             this.TextBox2.Text       = monthDetailModel.ReMark;
             if (monthDetailModel.OldBalance.HasValue && monthDetailModel.OldBalance.ToString() != "")
             {
                 this.txtOldBalance.Text = decimal.Parse(monthDetailModel.OldBalance.ToString()).ToString();
             }
             else
             {
                 this.txtOldBalance.Text = "0.00";
             }
             if (monthDetailModel.PlanMoney.HasValue && monthDetailModel.PlanMoney.ToString() != "")
             {
                 this.txtPlanMoney.Text = decimal.Parse(monthDetailModel.PlanMoney.ToString()).ToString();
             }
             else
             {
                 this.txtPlanMoney.Text = "0.00";
             }
             this.hdfcontrcn.Value = monthDetailModel.ContractID;
             if (this.Plantype != "" && this.Plantype == "payout")
             {
                 PayoutContract payoutContract = new PayoutContract();
                 this.txtContr.Value = payoutContract.GetModel(monthDetailModel.ContractID).ContractName;
                 return;
             }
             if (this.Plantype != "" && this.Plantype == "income")
             {
                 DataTable table = Common2.GetTable("Con_Incomet_Contract", "ContractID='" + monthDetailModel.ContractID + "'");
                 if (table.Rows.Count > 0 && table.Rows[0]["ContractName"] != null)
                 {
                     this.txtContr.Value = table.Rows[0]["ContractName"].ToString();
                 }
             }
         }
     }
 }
Exemple #15
0
    public string GetParty(string party)
    {
        PayoutContract payoutContract = new PayoutContract();
        DataTable      dataTable      = new DataTable();
        string         result         = string.Empty;

        if (!string.IsNullOrEmpty(party))
        {
            dataTable = payoutContract.GetBName(party.Split(new char[]
            {
                ','
            })[0]);
        }
        if (dataTable.Rows.Count > 0)
        {
            result = dataTable.Rows[0]["CorpName"].ToString();
        }
        return(result);
    }
Exemple #16
0
 private void InitContractInfo()
 {
     if (!string.IsNullOrEmpty(this.contractId))
     {
         PayoutContractModel model = new PayoutContract().GetModel(this.contractId);
         if (model != null)
         {
             this.txtContractCode.Text  = model.ContractCode;
             this.txtContractName.Text  = model.ContractName;
             this.txtContractMoney.Text = model.ModifiedMoney.ToString();
             this.txtSignedDate.Text    = model.SignDate.Value.ToShortDateString();
             this.txtContractType.Text  = model.TypeName;
             this.txtAName.Text         = model.AName;
             this.txtBname.Text         = model.CorpName;
             this.txtAddress.Text       = model.Address;
             this.hfldContractId.Value  = model.ContractID;
         }
     }
 }
Exemple #17
0
    private void InitContractInfo(string conId)
    {
        PayoutContract      payoutContract = new PayoutContract();
        PayoutContractModel model          = payoutContract.GetModel(conId);

        this.txtContractCode.Text = model.ContractCode;
        this.txtContractName.Text = model.ContractName;
        decimal balancedAmount = new PayoutBalance().GetBalancedAmount(conId, false);

        this.txtBalancedSum.Text = balancedAmount.ToString();
        decimal paySum = this.payoutPayment.GetPaySum(conId, this.chkContainPending.Checked);

        this.txtPaySum.Text = paySum.ToString();
        decimal num = balancedAmount - paySum;

        this.txtDiff.Text          = num.ToString();
        this.txtContractMoney.Text = model.ModifiedMoney.ToString();
        this.txtSignedDate.Text    = model.SignDate.Value.ToShortDateString();
    }
    protected void BindPage()
    {
        PayoutInvoiceInfo model = this.invoice.GetModel(base.Request["InvoiceId"]);

        if (model != null)
        {
            PayoutContractModel model2 = new PayoutContract().GetModel(model.ContractID);
            if (model2 != null)
            {
                this.lblContractCode.Text = model2.ContractCode;
                this.lblContractName.Text = model2.ContractName;
                PTPrjInfoService pTPrjInfoService = new PTPrjInfoService();
                string           prjCode          = pTPrjInfoService.GetById(model2.PrjGuid).PrjCode;
                this.lblPrjCode.Text       = prjCode;
                this.lblPrjName.Text       = model2.PrjName;
                this.lblContractMoney.Text = model2.ModifiedMoney.ToString();
                this.lblSignedDate.Text    = Convert.ToDateTime(model2.SignDate).ToShortDateString();
                PayoutPayment payoutPayment = new PayoutPayment();
                decimal?      paySum        = payoutPayment.GetPaySum(model2.ContractID);
                decimal?      invoiceSum    = this.invoice.GetInvoiceSum(model2.ContractID);
                this.lblPaymentSum.Text = paySum.ToString();
                this.lblInvoiceSum.Text = invoiceSum.ToString();
                this.lblDiff.Text       = Convert.ToString(paySum - invoiceSum);
            }
            this.lblAmountMoney.Text      = model.Amount.ToString();
            this.lblInvoiceNo.Text        = model.InvoiceNo;
            this.lblInvoiceCode.Text      = model.InvoiceCode;
            this.lblParty.Text            = model.Payer;
            this.lblSecond.Text           = model.Payee;
            this.lblInvoiceType.Text      = this.getInvoiceType(model.InvoiceType);
            this.lblTaxNo.Text            = model.TaxNo;
            this.lblTransactor.Text       = model.Transactor;
            this.lblInvoiceDate.Text      = model.InvoiceDate.ToString();
            this.lblAddress.Text          = model.Contact;
            this.lblBankCode.Text         = model.BankCode;
            this.lblInputUser.Text        = model.InputPerson;
            this.lblInputTime.Text        = Convert.ToDateTime(model.InputDate).ToShortDateString();
            this.lblNote.Text             = model.Notes;
            this.lblOrganizationCode.Text = model.OrganizationCode;
            this.lblUpFiled.Text          = FileView.FilesBind(1911, model.InvoiceID);
        }
    }
Exemple #19
0
    protected void InitProjectInfo(string conId)
    {
        PayoutPaymentModel payoutPaymentModel = new PayoutPaymentModel();

        payoutPaymentModel = this.payoutPayment.GetModel(conId);
        PayoutContractModel payoutContractModel = new PayoutContractModel();
        PayoutContract      payoutContract      = new PayoutContract();

        payoutContractModel = payoutContract.GetModel(payoutPaymentModel.ContractID);
        if (payoutContractModel.PrjGuid != "")
        {
            string    sqlString = " select PrjCode,PrjName,PrjGuid,TypeCode from pt_prjinfo where prjGuid='" + payoutContractModel.PrjGuid + "' ";
            DataTable dataTable = publicDbOpClass.DataTableQuary(sqlString);
            if (dataTable.Rows.Count > 0)
            {
                this.lblProjectCode.Text = dataTable.Rows[0]["PrjCode"].ToString();
                this.lblDepartMent.Text  = dataTable.Rows[0]["PrjName"].ToString();
            }
        }
    }
Exemple #20
0
    public void InitPageInfor(string conId)
    {
        this.InitDepartment();
        this.lblPayMentDate.Text = DateTime.Now.ToShortDateString();
        PayoutContract      payoutContract = new PayoutContract();
        PayoutContractModel model          = payoutContract.GetModel(conId);

        this.lblContent.Text = model.ContractName;
        PayoutPaymentModel model2 = this.payoutPayment.GetModel(this.ViewState["PaymentId"].ToString());

        if (model2.Paytype == -1)
        {
            this.lblPayment.Text = "";
        }
        if (model2.Paytype == 0)
        {
            this.lblPayment.Text = "现金";
        }
        if (model2.Paytype == 1)
        {
            this.lblPayment.Text = "支票";
        }
        if (model2.Paytype == 2)
        {
            this.lblPayment.Text = "转账";
        }
        decimal number = 0m;

        if (model2.PaymentMoney.ToString() != "")
        {
            number = Convert.ToDecimal(model2.PaymentMoney);
        }
        this.lblMoney.Text        = model2.PaymentMoney.ToString();
        this.lblOperator.Text     = model2.InputPerson;
        this.lblCapital.Text      = ConverRMB.Convert(number);
        this.lblRecivePeople.Text = model2.Beneficiary.Trim();
        this.lblBank.Text         = model2.Bank.Trim();
        this.lblAccount.Text      = model2.Account.Trim();
        this.lblTotalMoney.Text   = model2.PaymentMoney.ToString();
        this.lblFileNumber.Text   = this.ser.GetNo("Con_Payout_Payment", this.ViewState["PaymentId"].ToString());
    }
Exemple #21
0
    protected string InitProjectInfoS(string conId)
    {
        string             result             = string.Empty;
        PayoutPaymentModel payoutPaymentModel = new PayoutPaymentModel();

        payoutPaymentModel = this.payoutPayment.GetModel(conId);
        PayoutContractModel payoutContractModel = new PayoutContractModel();
        PayoutContract      payoutContract      = new PayoutContract();

        payoutContractModel = payoutContract.GetModel(payoutPaymentModel.ContractID);
        if (payoutContractModel.PrjGuid != "")
        {
            string    sqlString = " select PrjCode,PrjName,PrjGuid,TypeCode from pt_prjinfo where prjGuid='" + payoutContractModel.PrjGuid + "' ";
            DataTable dataTable = publicDbOpClass.DataTableQuary(sqlString);
            if (dataTable.Rows.Count > 0)
            {
                result = dataTable.Rows[0]["PrjCode"].ToString() + "|" + dataTable.Rows[0]["PrjName"].ToString();
            }
        }
        return(result);
    }
Exemple #22
0
    //本项目的付款累计
    private double GetpaySums(string strProjectName)
    {
        double paySums = 0.00;

        System.DateTime startDate      = new DateTime(0x76c, 1, 1); //Common2.GetStartDate(this.txtStartDate);
        System.DateTime endDate        = new DateTime(0x81f, 6, 6); //Common2.GetEndDate(this.txtEndDate);
        PayoutContract  payoutContract = new PayoutContract();
        //string reportCondition = payoutContract.GetReportCondition(startDate, endDate, this.txtConType.Text.Trim(), strProjectName, this.txtContractName.Text.Trim(), this.txtContractCode.Text.Trim(), this.txtBName.Text.Trim(), this.dropPrjKindClass.SelectedItem.Text, this.txtSignPersonName.Text.Trim());
        string    reportCondition = payoutContract.GetReportCondition(startDate, endDate, "", strProjectName, "", "", "", "", "");
        DataTable dt = this.payment.Select(reportCondition, base.UserCode);

        //PaymentTotal
        if (dt.Rows.Count > 0)
        {
            foreach (DataRow dr in dt.Rows)
            {
                paySums += Convert.ToDouble(dr["PaymentTotal"].ToString().Trim());
            }
        }
        return(paySums);
    }
Exemple #23
0
    private void ShowGuideLine()
    {
        if (!this.configSer.IsExist(this.contractId) || !(
                from p in this.configSer
                where p.ContractId == this.contractId
                select p).FirstOrDefault <ConConfigContract>().IsBalanceAlarm)
        {
            this.trSate.Visible = false;
            return;
        }
        string text = this.ViewState["BalanceId"].ToString();

        if (!string.IsNullOrEmpty(text))
        {
            PayoutBalanceModel  model          = this.balance.GetModel(text);
            PayoutContractModel model2         = new PayoutContract().GetModel(model.ContractID);
            decimal             balancedAmount = this.balance.GetBalancedAmount(model.ContractID, model.ContainPending);
            this.lblBalancedAmount.Text = balancedAmount.ToString("0.000");
            this.lblModifedAmount.Text  = (model2.ModifiedMoney.HasValue ? model2.ModifiedMoney.ToString() : "0.000");
            this.lblBalanceAmount.Text  = (model.BalanceMoney.HasValue ? model.BalanceMoney.ToString() : "0.000");
            decimal d = 0m;
            if (model2.ModifiedMoney.HasValue && model.BalanceMoney.HasValue)
            {
                d = model2.ModifiedMoney.Value - balancedAmount;
            }
            decimal num = 0m;
            if (model2.ModifiedMoney.HasValue && model2.ModifiedMoney.Value != 0m)
            {
                num = d / model2.ModifiedMoney.Value;
            }
            this.lblRate.Text = string.Format("{0:P}", num);
            string balanceAmountState = this.balance.GetBalanceAmountState(num, this.contractId);
            this.lblState.Text = balanceAmountState;
            this.SetLableColor(Common2.GetColorByState(balanceAmountState));
        }
    }
Exemple #24
0
    private DataTable GetData()
    {
        string strProjectName = this.txtProject.Text.Trim();

        try
        {
            if (Request.QueryString["action"].ToString() == "ByProject")
            {
                strProjectName = Request.QueryString["ProjectName"].ToString();
            }
        }
        catch
        {
        }
        System.DateTime startDate       = Common2.GetStartDate(this.txtStartDate);
        System.DateTime endDate         = Common2.GetEndDate(this.txtEndDate);
        PayoutContract  payoutContract  = new PayoutContract();
        string          reportCondition = payoutContract.GetReportCondition(startDate, endDate, this.txtConType.Text.Trim(), strProjectName, this.txtContractName.Text.Trim(), this.txtContractCode.Text.Trim(), this.txtBName.Text.Trim(), this.dropPrjKindClass.SelectedItem.Text, this.txtSignPersonName.Text.Trim());

        this.contractCount            = this.payment.Select(reportCondition, base.UserCode);
        this.ViewState["contract"]    = this.contractCount;
        this.AspNetPager1.RecordCount = this.contractCount.Rows.Count;
        return(this.payment.SelectData(reportCondition, base.UserCode, this.AspNetPager1.CurrentPageIndex, this.AspNetPager1.PageSize));
    }
Exemple #25
0
    protected void Page_Load(object sender, System.EventArgs e)
    {
        if (!base.IsPostBack)
        {
            this.hfldIsWBSRelevance.Value = this.isWBSRelevance;
            if (!string.IsNullOrEmpty(this.pcode))
            {
                PurchaseModel model;
                if (this.pcode.Contains("["))
                {
                    model = this.purchase.GetModel(JsonHelper.GetListFromJson(this.pcode)[0]);
                }
                else
                {
                    model = this.purchase.GetModel(this.pcode);
                }
                this.lblPpcode.Text  = model.pcode;
                this.DateInTime.Text = model.intime.ToString("yyyy-MM-dd");
                this.txtPerson.Text  = model.person;
                this.lblExplain.Text = model.explain;
                if (!string.IsNullOrEmpty(model.Project))
                {
                    PrjInfoModel modelByPrjGuid = this.ptPrjInfo.GetModelByPrjGuid(model.Project);
                    if (modelByPrjGuid != null)
                    {
                        this.lblProject.Text = modelByPrjGuid.PrjName;
                    }
                    else
                    {
                        DataTable tableByPrjGuid = this.ptPrjInfo.GetTableByPrjGuid(model.Project);
                        if (tableByPrjGuid.Rows.Count > 0)
                        {
                            this.lblProject.Text = tableByPrjGuid.Rows[0]["prjName"].ToString().Trim();
                        }
                    }
                }
                if (!string.IsNullOrEmpty(model.contract))
                {
                    PayoutContract      payoutContract = new PayoutContract();
                    PayoutContractModel model2         = payoutContract.GetModel(model.contract);
                    if (model2 != null)
                    {
                        this.lblContract.Text = model2.ContractName;
                    }
                }
                DataTable prjID    = this.purchaseStock.GetPrjID(this.pcode);
                string    strPrjId = prjID.Rows[0][0].ToString();
                DataTable purchaseStockByPscode = this.purchaseStock.GetPurchaseStockByPscode(this.pcode, strPrjId, this.hfldIsWBSRelevance.Value);
                //预算数量
                DataColumn dataColumn6 = new DataColumn("BugetNum", typeof(string));
                dataColumn6.DefaultValue = 0.00;
                purchaseStockByPscode.Columns.Add(dataColumn6);
                //预算单价
                DataColumn dataColumn7 = new DataColumn("BugetPrice", typeof(string));
                dataColumn7.DefaultValue = 0.00;
                purchaseStockByPscode.Columns.Add(dataColumn7);
                //预算合计
                DataColumn dataColumn8 = new DataColumn("BugetSum", typeof(string));
                dataColumn8.DefaultValue = 0.00;
                purchaseStockByPscode.Columns.Add(dataColumn8);
                for (int i = 0; i < purchaseStockByPscode.Rows.Count; i++)
                {
                    DataRow dataRow = purchaseStockByPscode.Rows[i];
                    try
                    {
                        DataTable resByBud = this.materialStock.GetResByBud("", "", "", "", strPrjId, 1, 9999999, 1, isWBSRelevance, "");
                        if (resByBud.Rows.Count > 0)
                        {
                            DataRow[] drs = resByBud.Select(" ResourceCode='" + dataRow["ResourceCode"].ToString() + "'");
                            if (drs.Length > 0)
                            {
                                string BugetNum   = drs[0]["ResourceQuantity"].ToString() == "" ? "0" : drs[0]["ResourceQuantity"].ToString();
                                string BugetPrice = drs[0]["ResourcePrice"].ToString() == "" ? "0" : drs[0]["ResourcePrice"].ToString();
                                if (!string.IsNullOrEmpty(BugetNum))
                                {
                                    dataRow["BugetNum"]   = Convert.ToDecimal(BugetNum);
                                    dataRow["BugetPrice"] = Convert.ToDecimal(BugetPrice);
                                    dataRow["BugetSum"]   = Convert.ToDecimal(BugetNum) * Convert.ToDecimal(BugetPrice);
                                }
                                else
                                {
                                    dataRow["BugetNum"]   = 0.00;
                                    dataRow["BugetPrice"] = 0.00;
                                    dataRow["BugetSum"]   = 0.00;
                                }
                            }
                        }
                        else
                        {
                            dataRow["BugetNum"]   = 0.00;
                            dataRow["BugetPrice"] = 0.00;
                            dataRow["BugetSum"]   = 0.00;
                        }
                    }
                    catch
                    {
                    }
                }


                this.ViewState[StockManage_Purchase_PurchaseView.resourceDataSourceName] = purchaseStockByPscode;
                this.DataBindPurchaseplanStock();
                this.DataBindDiff(prjID.Rows[0][1].ToString(), this.pcode);
                this.flAnnx.MID          = 1801;
                this.flAnnx.FID          = model.pid;
                this.flAnnx.Type         = 1;
                this.lblBllProducer.Text = model.person;
                this.lblPrintDate.Text   = System.DateTime.Now.ToShortDateString();
            }
        }
    }