예제 #1
0
        private PayoutPaymentModel GetModel(IDataReader dr)
        {
            PayoutPaymentModel model = new PayoutPaymentModel();

            if (dr.FieldCount > 0)
            {
                model.ID             = DBHelper.GetString(dr["ID"]);
                model.PaymentCode    = DBHelper.GetString(dr["PaymentCode"]);
                model.ContractID     = DBHelper.GetString(dr["ContractID"]);
                model.ContractName   = DBHelper.GetString(dr["ContractName"]);
                model.PaymentMoney   = new decimal?(DBHelper.GetDecimal(dr["PaymentMoney"]));
                model.PaymentPerson  = DBHelper.GetString(dr["PaymentPerson"]);
                model.PaymentDate    = DBHelper.GetDateTimeNullable(dr["PaymentDate"]);
                model.Annex          = DBHelper.GetString(dr["Annex"]);
                model.FlowState      = new int?(DBHelper.GetInt(dr["FlowState"]));
                model.Notes          = DBHelper.GetString(dr["Notes"]);
                model.InputPerson    = DBHelper.GetString(dr["InputPerson"]);
                model.InputDate      = new DateTime?(DBHelper.GetDateTime(dr["InputDate"]));
                model.UserCodes      = DBHelper.GetString(dr["UserCodes"]);
                model.ContainPending = DBHelper.GetBool(dr["ContainPending"]);
                model.PrjGuid        = DBHelper.GetString(dr["PrjGuid"]);
                model.Pidcont        = new decimal?(DBHelper.GetDecimal(dr["PidCont"]));
                object obj1 = dr["PayType"];
                model.Paytype       = (dr["PayType"].ToString() != "") ? int.Parse(dr["PayType"].ToString()) : -1;
                model.Capitalnumber = DBHelper.GetString(dr["CapitalNumber"]);
                model.MonthPlanUID  = DBHelper.GetString(dr["MonthPlanUID"]);
                model.Beneficiary   = DBHelper.GetString(dr["Beneficiary"]);
                model.Bank          = DBHelper.GetString(dr["Bank"]);
                model.Account       = DBHelper.GetString(dr["Account"]);
            }
            return(model);
        }
예제 #2
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);
        }
예제 #3
0
 private void ShowGuideLine()
 {
     try
     {
         string             iD    = this.ViewState["PaymentId"].ToString();
         PayoutPaymentModel model = this.payoutPayment.GetModel(iD);
         decimal            num   = decimal.Parse(this.txtBalancedSum.Text);
         this.lblBalancedAmount.Text = this.txtBalancedSum.Text;
         decimal d = decimal.Parse(this.txtPaySum.Text);
         this.lblPaymentedAmount.Text = this.txtPaySum.Text;
         decimal d2 = model.PaymentMoney.HasValue ? model.PaymentMoney.Value : 0m;
         this.lblPaymentAmount.Text = d2.ToString();
         if (num != 0m)
         {
             decimal num2 = (num - d - d2) / num;
             this.lblRate.Text = string.Format("{0:P}", num2);
             string stateByBalanceAmount = this.payoutPayment.GetStateByBalanceAmount(num2);
             this.lblState.Text = stateByBalanceAmount;
             this.SetLableColor(Common2.GetColorByState(stateByBalanceAmount));
         }
         else
         {
             this.lblRate.Text  = "无支付结算";
             this.lblState.Text = "高";
             this.SetLableColor(Common2.GetColorByState("高"));
         }
     }
     catch
     {
     }
 }
예제 #4
0
    private void InintUpdateState()
    {
        PayoutPaymentModel model = this.payoutPayment.GetModel(this.ViewState["PaymentId"].ToString());

        this.contractId            = model.ContractID;
        this.lblPaymentCode.Text   = model.PaymentCode;
        this.lblPaymentMoney.Text  = model.PaymentMoney.ToString();
        this.lblPaymentDate.Text   = model.PaymentDate.Value.ToShortDateString();
        this.lblPaymentPerson.Text = model.PaymentPerson;
        this.lblInputPerson.Text   = model.InputPerson;
        this.lblInputDate.Text     = model.InputDate.Value.ToShortDateString();
        this.lblNotes.Text         = model.Notes;
        decimal number = 0m;

        if (model.PaymentMoney.ToString() != "")
        {
            number = Convert.ToDecimal(model.PaymentMoney);
        }
        this.LblCapitalNumber.Text = ConverRMB.Convert(number);
        if (model.Paytype == -1)
        {
            this.LblPayType.Text = "";
        }
        if (model.Paytype == 0)
        {
            this.LblPayType.Text = "现金";
        }
        if (model.Paytype == 1)
        {
            this.LblPayType.Text = "支票";
        }
        if (model.Paytype == 2)
        {
            this.LblPayType.Text = "转账";
        }
        this.hldfIsFundPlan.Value = model.MonthPlanUID;
        List <string> fundPlanByMonthPlanUID = this.payoutPayment.GetFundPlanByMonthPlanUID(this.hldfIsFundPlan.Value);

        if (fundPlanByMonthPlanUID.Count > 0)
        {
            this.lblMonthDate.Text   = fundPlanByMonthPlanUID[1].ToString();
            this.lblPlanMoney.Text   = fundPlanByMonthPlanUID[2].ToString();
            this.lblUsedMoney.Text   = fundPlanByMonthPlanUID[4].ToString();
            this.lblUsableMoney.Text = fundPlanByMonthPlanUID[5].ToString();
            this.lblRemark.Text      = fundPlanByMonthPlanUID[6].ToString();
        }
        this.lblBeneficiary.Text = model.Beneficiary.Trim();
        this.lblBank.Text        = model.Bank.Trim();
        this.lalAccount.Text     = model.Account.Trim();
        this.InitContractInfo(this.contractId);
    }
예제 #5
0
 private void ShowGuideLine()
 {
     try
     {
         if (!this.configSer.IsExist(this.contractId) || !(
                 from p in this.configSer
                 where p.ContractId == this.contractId
                 select p).FirstOrDefault <ConConfigContract>().IsPaymentAlarm)
         {
             this.trSate.Visible = false;
         }
         else
         {
             string             iD    = this.ViewState["PaymentId"].ToString();
             PayoutPaymentModel model = this.payoutPayment.GetModel(iD);
             decimal            num   = decimal.Parse(this.lblContractMoney.Text);
             this.lblContractAmount.Text = this.lblContractMoney.Text;
             decimal.Parse(this.lblBalancedSum.Text);
             this.lblBalancedAmount.Text = this.lblBalancedSum.Text;
             decimal d = decimal.Parse(this.lblPaySum.Text);
             this.lblPaymentedAmount.Text = d.ToString("0.000");
             decimal num2 = model.PaymentMoney.HasValue ? model.PaymentMoney.Value : 0m;
             this.lblPaymentAmount.Text = num2.ToString("0.000");
             if (num != 0m)
             {
                 decimal num3 = d / num;
                 this.lblRate.Text = string.Format("{0:P}", num3);
                 string payoutPayAmount = this.payoutPayment.GetPayoutPayAmount(num3, this.contractId);
                 this.lblState.Text = payoutPayAmount;
                 this.SetLableColor(Common2.GetColorByState(payoutPayAmount));
             }
             else
             {
                 this.lblRate.Text  = "无合同金额";
                 this.lblState.Text = "高";
                 this.SetLableColor(Common2.GetColorByState("高"));
             }
         }
     }
     catch
     {
     }
 }
예제 #6
0
    private void InintUpdateState()
    {
        PayoutPaymentModel model = this.payoutPayment.GetModel(this.ViewState["PaymentId"].ToString());

        this.contractId                = model.ContractID;
        this.txtPaymentCode.Text       = model.PaymentCode;
        this.txtPaymentMoney.Text      = model.PaymentMoney.ToString();
        this.txtPaymentDate.Text       = model.PaymentDate.Value.ToShortDateString();
        this.txtPaymentPerson.Text     = model.PaymentPerson;
        this.txtInputPerson.Text       = model.InputPerson;
        this.txtInputDate.Text         = model.InputDate.Value.ToShortDateString();
        this.txtNotes.Text             = model.Notes;
        this.chkContainPending.Checked = model.ContainPending;
        this.txtCapitalNumber.Text     = model.Capitalnumber;
        this.txtBeneficiary.Text       = model.Beneficiary;
        this.txtBank.Text              = model.Bank;
        this.txtAccount.Text           = model.Account;
        int arg_131_0 = model.Paytype;

        if (model.Paytype.ToString() != "" && model.Paytype != -1)
        {
            this.RblPayType.SelectedValue = model.Paytype.ToString();
        }
        this.hlfdFundPlanUID.Value = model.MonthPlanUID;
        List <string> fundPlanByMonthPlanUID = this.payoutPayment.GetFundPlanByMonthPlanUID(this.hlfdFundPlanUID.Value);

        if (fundPlanByMonthPlanUID.Count > 0)
        {
            this.txtMonthDate.Value   = fundPlanByMonthPlanUID[1].ToString();
            this.txtPlanMoney.Value   = fundPlanByMonthPlanUID[2].ToString();
            this.txtUsedMoney.Value   = fundPlanByMonthPlanUID[4].ToString();
            this.lblUsableMoney.Value = fundPlanByMonthPlanUID[5].ToString();
            this.txtRemark.Value      = fundPlanByMonthPlanUID[6].ToString();
            Convert.ToDecimal(fundPlanByMonthPlanUID[4]);
            decimal d = Convert.ToDecimal(fundPlanByMonthPlanUID[5]);
            if (d < 0m)
            {
                this.lblUsableMoney.Attributes.Add("style", "display:inline;color:Red;");
            }
        }
        this.InitContractInfo(this.contractId);
        this.txtPaymentCode.Enabled = false;
    }
예제 #7
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();
            }
        }
    }
예제 #8
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());
    }
예제 #9
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);
    }
예제 #10
0
        public bool GreaterBalanceMoney(PayoutPaymentModel model)
        {
            List <PayoutBalanceModel> list = new cn.justwin.contractBLL.PayoutBalance().GetList(string.Format(" Con_Payout_Balance.ContractID = '{0}'", model.ContractID));
            decimal?nullable = 0M;

            foreach (PayoutBalanceModel model2 in list)
            {
                nullable += model2.BalanceMoney;
            }
            string strWhere = string.Format(" Con_Payout_Payment.FlowState != '-2' AND Con_Payout_Payment.ContractID = '{0}' ", model.ContractID);
            List <PayoutPaymentModel> list2 = this.payment.GetList(strWhere);
            decimal?nullable2 = 0M;

            foreach (PayoutPaymentModel model3 in list2)
            {
                nullable2 += model3.PaymentMoney;
            }
            decimal?nullable9  = nullable2;
            decimal?nullable10 = nullable;

            return((nullable9.GetValueOrDefault() > nullable10.GetValueOrDefault()) && (nullable9.HasValue & nullable10.HasValue));
        }
예제 #11
0
 protected void chkContainPendint_CheckedChanged(object sender, EventArgs e)
 {
     try
     {
         if (string.IsNullOrEmpty(this.contractId))
         {
             PayoutPaymentModel model = this.payoutPayment.GetModel(this.ViewState["PaymentId"].ToString());
             this.contractId = model.ContractID;
         }
         decimal d      = decimal.Parse(this.txtBalancedSum.Text);
         decimal paySum = this.payoutPayment.GetPaySum(this.contractId, this.chkContainPending.Checked);
         this.txtPaySum.Text = paySum.ToString();
         decimal num = d - paySum;
         this.txtDiff.Text = num.ToString();
         if (Convert.ToDecimal(this.txtPlanMoney.Value.Trim()) < Convert.ToDecimal(this.txtUsedMoney.Value.Trim()))
         {
             this.lblUsableMoney.Attributes.Add("style", "display:inline;color:Red;");
         }
     }
     catch
     {
     }
 }
예제 #12
0
    protected void btnPlan_Click(object sender, EventArgs e)
    {
        string value = this.hdnRPUID.Value;

        if (this.HdnSub.Value == "0")
        {
            PayoutPayment      payoutPayment = new PayoutPayment();
            PayoutPaymentModel model         = payoutPayment.GetModel(value);
            this.txtRPCode.Text    = model.PaymentCode.ToString();
            this.txtPayMoney.Text  = model.PaymentMoney.ToString();
            this.txtPayOut.Text    = this.AccountBll.getMoneyByPayCode(model.ID).ToString();
            this.txtInMoney.Text   = (model.PaymentMoney - Convert.ToDecimal(this.txtPayOut.Text)).ToString();
            this.txtJianMoney.Text = this.txtInMoney.Text;
            this.txtHandler.Text   = model.InputPerson;
            return;
        }
        this.txtPayOut.Text = this.AccountBll.getMoneyByPayCode(value).ToString();
        string    strwhere  = " inDiaryId ='" + value + "' ";
        DataTable dtByWhere = OrganizationDiary.getDtByWhere(strwhere);

        if (dtByWhere.Rows.Count > 0)
        {
            if (string.IsNullOrEmpty(dtByWhere.Rows[0]["Total"].ToString()))
            {
                this.txtPayMoney.Text = "0.00";
            }
            else
            {
                this.txtPayMoney.Text = dtByWhere.Rows[0]["Total"].ToString();
            }
            this.txtRPCode.Text    = dtByWhere.Rows[0]["Name"].ToString();
            this.txtInMoney.Text   = (Convert.ToDecimal(this.txtPayMoney.Text) - Convert.ToDecimal(this.txtPayOut.Text)).ToString();
            this.txtJianMoney.Text = this.txtInMoney.Text;
            this.txtHandler.Text   = dtByWhere.Rows[0]["issuedBy"].ToString();
        }
    }
예제 #13
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!base.IsPostBack)
     {
         this.hdnAccountID.Value = base.Request.QueryString["ic"].ToString();
         this.accountModel       = this.AccountBll.GetModel(new Guid(this.hdnAccountID.Value));
         this.lblcode.Text       = this.accountModel.PayOutCode.ToString();
         this.lblInDate.Text     = Convert.ToDateTime(this.accountModel.PayOutTime).ToString("yyyy-MM-dd");
         this.lblInPeople.Text   = com.jwsoft.pm.entpm.PageHelper.QueryUser(this, this.accountModel.PayOutPeople);
         PrjInfoModel modelByPrjGuid = this.ptPrjInfo.GetModelByPrjGuid(this.accountModel.prjGuid);
         if (modelByPrjGuid != null)
         {
             this.lblProject.Text = modelByPrjGuid.PrjName;
         }
         this.lblPayMoney.Text = this.AccountBll.getMoneyByPayCode(this.accountModel.RPGuid.ToString()).ToString();
         PayoutPayment      payoutPayment = new PayoutPayment();
         PayoutPaymentModel model         = payoutPayment.GetModel(this.accountModel.RPGuid.ToString());
         if (model != null)
         {
             this.lblContPayCode.Text = model.PaymentCode.ToString();
             this.lblContMoney.Text   = model.PaymentMoney.ToString();
         }
         else
         {
             this.lblWord.Text = "费用名称";
             string    strwhere  = " inDiaryId ='" + this.accountModel.RPGuid.ToString() + "' ";
             DataTable dtByWhere = OrganizationDiary.getDtByWhere(strwhere);
             if (dtByWhere.Rows.Count > 0)
             {
                 if (string.IsNullOrEmpty(dtByWhere.Rows[0]["Total"].ToString()))
                 {
                     this.lblContMoney.Text = "0.00";
                 }
                 else
                 {
                     this.lblContMoney.Text = dtByWhere.Rows[0]["Total"].ToString();
                 }
                 this.lblContPayCode.Text = dtByWhere.Rows[0]["Name"].ToString();
             }
         }
         this.lblInMoney.Text      = this.accountModel.PayOutMoney.ToString();
         this.lblHandler.Text      = this.accountModel.Handler.ToString();
         this.lblRemark.Text       = this.accountModel.Remark.ToString();
         this.lblContractName.Text = this.accountModel.ContractName.ToString();
         this.upload.InnerHtml     = this.FilesBind(this.hdnAccountID.Value);
         this.lblPrintDate.Text    = DateTime.Now.ToShortDateString();
         this.lblPrintPeople.Text  = com.jwsoft.pm.entpm.action.PageHelper.QueryUser(this, base.UserCode);
         this.lblContMoney.Text    = (string.IsNullOrEmpty(this.lblContMoney.Text) ? "0.00" : this.lblContMoney.Text);
         if (this.accountModel.PayOutMoney > Convert.ToDecimal(this.lblContMoney.Text) - Convert.ToDecimal(this.lblPayMoney.Text))
         {
             this.lblInMoney.Attributes.Add("style", "Color:red");
         }
         this.lbljianMoney.Text = (Convert.ToDecimal(this.lblContMoney.Text) - Convert.ToDecimal(this.lblPayMoney.Text)).ToString();
         Fund_Prj_Accoun fund_Prj_Accoun = new Fund_Prj_Accoun();
         string          strwhere2       = " and AccountID='" + fund_Prj_Accoun.getAccountByPrjGuid(this.accountModel.prjGuid.ToString()) + "' ";
         DataTable       accounSumInfo   = fund_Prj_Accoun.getAccounSumInfo(strwhere2);
         this.lblAccountYue.Text = accounSumInfo.Rows[0]["JE"].ToString();
         if (base.Request.QueryString["see"] != null && base.Request.QueryString["see"].ToString() == "see")
         {
             this.lblAccountYue.Attributes.Add("style", "font-weight:bold");
         }
         else
         {
             this.bllProducer.Visible = false;
             this.btnPrnt.Visible     = false;
             if (Convert.ToDecimal(this.lblAccountYue.Text.ToString()) < Convert.ToDecimal(this.lblInMoney.Text.ToString()))
             {
                 Label expr_4D5 = this.lblAccountYue;
                 expr_4D5.Text += "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;本次记账金额大于账户余额!";
                 this.lblAccountYue.Attributes.Add("style", "font-weight:bold;color:red");
             }
         }
         this.ShowGuideLine(this.accountModel.RPGuid.ToString());
     }
 }
예제 #14
0
 public void Update(PayoutPaymentModel model)
 {
     this.payment.Update(model, null);
 }
예제 #15
0
 public void Add(PayoutPaymentModel model)
 {
     this.payment.Add(model, null);
 }
예제 #16
0
        public void Add(PayoutPaymentModel model, SqlTransaction trans)
        {
            StringBuilder builder = new StringBuilder();

            builder.Append("insert into Con_Payout_Payment(");
            builder.Append("ID,PaymentCode,ContractID,PaymentMoney,PaymentPerson,PaymentDate,Annex,FlowState,Notes,InputPerson,InputDate,ContainPending,PayType,CapitalNumber,MonthPlanUID,Beneficiary,Bank,Account)");
            builder.Append(" values (");
            builder.Append("@ID,@PaymentCode,@ContractID,@PaymentMoney,@PaymentPerson,@PaymentDate,@Annex,@FlowState,@Notes,@InputPerson,@InputDate,@ContainPending,@PayType,@CapitalNumber,@MonthPlanUID,@Beneficiary,@Bank,@Account)");
            List <SqlParameter> list = new List <SqlParameter> {
                new SqlParameter("@ID", 12, 0x40),
                new SqlParameter("@PaymentCode", 12, 0x40),
                new SqlParameter("@ContractID", 12, 0x40),
                new SqlParameter("@PaymentMoney", 5, 9),
                new SqlParameter("@PaymentPerson", 12, 0x40),
                new SqlParameter("@PaymentDate", 4),
                new SqlParameter("@Annex", 12, 0x100),
                new SqlParameter("@FlowState", 8, 4),
                new SqlParameter("@Notes", 12),
                new SqlParameter("@InputPerson", 12, 0x40),
                new SqlParameter("@InputDate", 4),
                new SqlParameter("@ContainPending", 2),
                new SqlParameter("@PayType", 0x10),
                new SqlParameter("@CapitalNumber", 12, 0x3e8),
                new SqlParameter("@MonthPlanUID", 12, 0x40),
                new SqlParameter("@Beneficiary", 12, 200),
                new SqlParameter("@Bank", 12, 200),
                new SqlParameter("@Account", 12, 200)
            };

            list[0].Value  = model.ID;
            list[1].Value  = model.PaymentCode;
            list[2].Value  = model.ContractID;
            list[3].Value  = model.PaymentMoney;
            list[4].Value  = model.PaymentPerson;
            list[5].Value  = model.PaymentDate;
            list[6].Value  = model.Annex;
            list[7].Value  = model.FlowState;
            list[8].Value  = model.Notes;
            list[9].Value  = model.InputPerson;
            list[10].Value = model.InputDate;
            list[11].Value = model.ContainPending;
            list[12].Value = model.Paytype;
            list[13].Value = model.Capitalnumber;
            if (model.MonthPlanUID != null)
            {
                list[14].Value = model.MonthPlanUID;
            }
            else
            {
                list[14].Value = DBNull.Value;
            }
            list[15].Value   = model.Beneficiary;
            list[0x10].Value = model.Bank;
            list[0x11].Value = model.Account;
            if (trans == null)
            {
                SqlHelper.ExecuteNonQuery(CommandType.Text, builder.ToString(), list.ToArray());
            }
            else
            {
                SqlHelper.ExecuteNonQuery(trans, CommandType.Text, builder.ToString(), list.ToArray());
            }
        }
예제 #17
0
        public void Update(PayoutPaymentModel model, SqlTransaction trans)
        {
            StringBuilder builder = new StringBuilder();

            builder.Append("update Con_Payout_Payment set ");
            builder.Append("PaymentCode=@PaymentCode,");
            builder.Append("ContractID=@ContractID,");
            builder.Append("PaymentMoney=@PaymentMoney,");
            builder.Append("PaymentPerson=@PaymentPerson,");
            builder.Append("PaymentDate=@PaymentDate,");
            builder.Append("Annex=@Annex,");
            builder.Append("FlowState=@FlowState,");
            builder.Append("Notes=@Notes,");
            builder.Append("InputPerson=@InputPerson,");
            builder.Append("InputDate=@InputDate,");
            builder.Append("ContainPending=@ContainPending,");
            builder.Append("PayType=@PayType,");
            builder.Append("CapitalNumber=@CapitalNumber,");
            builder.Append("MonthPlanUID=@MonthPlanUID,");
            builder.Append("Beneficiary=@Beneficiary,");
            builder.Append("Bank=@Bank,");
            builder.Append("Account=@Account ");
            builder.Append(" where ID=@ID ");
            List <SqlParameter> list = new List <SqlParameter> {
                new SqlParameter("@ID", 12, 0x40),
                new SqlParameter("@PaymentCode", 12, 0x40),
                new SqlParameter("@ContractID", 12, 0x40),
                new SqlParameter("@PaymentMoney", 5, 9),
                new SqlParameter("@PaymentPerson", 12, 0x40),
                new SqlParameter("@PaymentDate", 4),
                new SqlParameter("@Annex", 12, 0x100),
                new SqlParameter("@FlowState", 8, 4),
                new SqlParameter("@Notes", 12),
                new SqlParameter("@InputPerson", 12, 0x40),
                new SqlParameter("@InputDate", 4),
                new SqlParameter("@ContainPending", 2),
                new SqlParameter("@PayType", 0x10),
                new SqlParameter("@CapitalNumber", 12, 0x3e8),
                new SqlParameter("@MonthPlanUID", 12, 0x40),
                new SqlParameter("@Beneficiary", 12, 200),
                new SqlParameter("@Bank", 12, 200),
                new SqlParameter("@Account", 12, 200)
            };

            list[0].Value  = model.ID;
            list[1].Value  = model.PaymentCode;
            list[2].Value  = model.ContractID;
            list[3].Value  = model.PaymentMoney;
            list[4].Value  = model.PaymentPerson;
            list[5].Value  = model.PaymentDate;
            list[6].Value  = model.Annex;
            list[7].Value  = model.FlowState;
            list[8].Value  = model.Notes;
            list[9].Value  = model.InputPerson;
            list[10].Value = model.InputDate;
            list[11].Value = model.ContainPending;
            list[12].Value = model.Paytype;
            list[13].Value = model.Capitalnumber;
            if (model.MonthPlanUID != null)
            {
                list[14].Value = model.MonthPlanUID;
            }
            else
            {
                list[14].Value = DBNull.Value;
            }
            list[15].Value   = model.Beneficiary;
            list[0x10].Value = model.Bank;
            list[0x11].Value = model.Account;
            if (trans == null)
            {
                SqlHelper.ExecuteNonQuery(CommandType.Text, builder.ToString(), list.ToArray());
            }
            else
            {
                SqlHelper.ExecuteNonQuery(trans, CommandType.Text, builder.ToString(), list.ToArray());
            }
        }
예제 #18
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!base.IsPostBack)
     {
         this.hdnZHID.Value = base.Request.QueryString["ZHID"].ToString();
         this.HdnSub.Value  = base.Request.QueryString["Sub"].ToString();
         string          strwhere        = " and AccountID='" + base.Request["ZHID"].ToString() + "' ";
         Fund_Prj_Accoun fund_Prj_Accoun = new Fund_Prj_Accoun();
         DataTable       accounSumInfo   = fund_Prj_Accoun.getAccounSumInfo(strwhere);
         this.hdnyue.Value = accounSumInfo.Rows[0]["JE"].ToString();
         if (this.HdnSub.Value == "0")
         {
             this.lblSel.Text = "资金支付申请";
         }
         else
         {
             this.lblSel.Text = "费用名称";
         }
         if (base.Request.QueryString["Action"] == "Add")
         {
             this.txtAccCode.Text     = DateTime.Now.ToString("yyyyMMddHHmmssfff");
             this.hdnAccountID.Value  = Guid.NewGuid().ToString();
             this.txtInDate.Text      = DateTime.Now.ToString("yyyy-MM-dd");
             this.txtInPeople.Text    = com.jwsoft.pm.entpm.PageHelper.QueryUser(this, base.UserCode);
             this.hdnPeopleCode.Value = base.UserCode;
             this.aM = this.al.GetModel(this.hdnZHID.Value);
             if (!this.aM.PrjGuid.StartsWith("'"))
             {
                 PrjInfoModel modelByPrjGuid = this.ptPrjInfo.GetModelByPrjGuid(this.aM.PrjGuid);
                 if (modelByPrjGuid != null)
                 {
                     this.txtPrjName.Text      = modelByPrjGuid.PrjName;
                     this.hdnProjectCode.Value = this.aM.PrjGuid;
                 }
             }
         }
         else
         {
             this.hdnAccountID.Value   = base.Request.QueryString["AccountID"].ToString();
             this.accountModel         = this.AccountBll.GetModel(new Guid(this.hdnAccountID.Value));
             this.txtAccCode.Text      = this.accountModel.PayOutCode.ToString();
             this.txtInDate.Text       = Convert.ToDateTime(this.accountModel.PayOutTime).ToString("yyyy-MM-dd");
             this.txtInPeople.Text     = com.jwsoft.pm.entpm.PageHelper.QueryUser(this, this.accountModel.PayOutPeople);
             this.hdnPeopleCode.Value  = this.accountModel.PayOutPeople;
             this.hdnProjectCode.Value = this.accountModel.prjGuid.ToString();
             PrjInfoModel modelByPrjGuid2 = this.ptPrjInfo.GetModelByPrjGuid(this.accountModel.prjGuid);
             if (modelByPrjGuid2 != null)
             {
                 this.txtPrjName.Text = modelByPrjGuid2.PrjName;
             }
             this.txtRemark.Text   = this.accountModel.Remark.ToString();
             this.txtInMoney.Text  = this.accountModel.PayOutMoney.ToString();
             this.txtHandler.Text  = this.accountModel.Handler.ToString();
             this.hdnRPUID.Value   = this.accountModel.RPGuid.ToString();
             this.txtPayOut.Text   = this.AccountBll.getMoneyByPayCode(this.accountModel.RPGuid.ToString()).ToString();
             this.txtPayMoney.Text = "0.00";
             if (this.HdnSub.Value == "0")
             {
                 PayoutPayment      payoutPayment = new PayoutPayment();
                 PayoutPaymentModel model         = payoutPayment.GetModel(this.accountModel.RPGuid.ToString());
                 if (model != null)
                 {
                     this.txtRPCode.Text   = model.PaymentCode.ToString();
                     this.txtPayMoney.Text = model.PaymentMoney.ToString();
                 }
             }
             else
             {
                 string    strwhere2 = " inDiaryId ='" + this.accountModel.RPGuid.ToString() + "' ";
                 DataTable dtByWhere = OrganizationDiary.getDtByWhere(strwhere2);
                 if (dtByWhere.Rows.Count > 0)
                 {
                     if (string.IsNullOrEmpty(dtByWhere.Rows[0]["Total"].ToString()))
                     {
                         this.txtPayMoney.Text = "0.00";
                     }
                     else
                     {
                         this.txtPayMoney.Text = dtByWhere.Rows[0]["Total"].ToString();
                     }
                     this.txtRPCode.Text = dtByWhere.Rows[0]["Name"].ToString();
                 }
             }
             this.txtJianMoney.Text = (Convert.ToDecimal(this.txtPayMoney.Text) - Convert.ToDecimal(this.txtPayOut.Text)).ToString();
         }
         this.FileUpload1.Class      = "AccountPayOut";
         this.FileUpload1.RecordCode = this.hdnAccountID.Value;
     }
 }
예제 #19
0
    private void UpdatePayment()
    {
        PayoutPaymentModel payment = this.payoutPayment.GetModel(this.ViewState["PaymentId"].ToString());

        if (!string.IsNullOrEmpty(this.txtPaymentMoney.Text.Trim()))
        {
            payment.PaymentMoney = new decimal?(Convert.ToDecimal(this.txtPaymentMoney.Text.Trim()));
        }
        if (!string.IsNullOrEmpty(this.txtPaymentDate.Text.Trim()))
        {
            payment.PaymentDate = new DateTime?(Convert.ToDateTime(this.txtPaymentDate.Text.Trim()));
        }
        payment.PaymentPerson  = this.txtPaymentPerson.Text.Trim();
        payment.Notes          = this.txtNotes.Text.Trim();
        payment.ContainPending = this.chkContainPending.Checked;
        if (this.hldfIsFundPlan.Value.Trim() != "0")
        {
            if (this.hlfdFundPlanUID.Value.Trim() != "")
            {
                payment.MonthPlanUID = this.hlfdFundPlanUID.Value;
            }
            else
            {
                payment.MonthPlanUID = null;
            }
        }
        else
        {
            payment.MonthPlanUID = null;
        }
        if (this.RblPayType.SelectedIndex == -1)
        {
            payment.Paytype = -1;
        }
        else
        {
            payment.Paytype = int.Parse(this.RblPayType.SelectedValue);
        }
        payment.Capitalnumber = this.txtCapitalNumber.Text.Trim();
        payment.Beneficiary   = this.txtBeneficiary.Text.Trim();
        payment.Bank          = this.txtBank.Text.Trim();
        payment.Account       = this.txtAccount.Text.Trim();
        try
        {
            if (this.hldfIsFundPlan.Value != "0" && Convert.ToDecimal(this.txtPaymentMoney.Text.Trim()) > Convert.ToDecimal(this.lblUsableMoney.Value.Trim()))
            {
                base.RegisterScript("hideFundPlan(); top.ui.alert('本次支付金额大于计划可用金额');");
            }
            this.payoutPayment.Update(payment);
            StringBuilder stringBuilder = new StringBuilder();
            bool          flag          = this.configSer.IsExist(payment.ContractID) && (
                from p in this.configSer
                where p.ContractId == payment.ContractID
                select p).FirstOrDefault <ConConfigContract>().IsPaymentAlarm;
            if (flag && this.payoutPayment.GreaterBalanceMoney(payment))
            {
                stringBuilder.Append("hideFundPlan(); top.ui.alert('支付金额大于结算金额\\n修改成功');");
            }
            else
            {
                stringBuilder.Append("hideFundPlan(); top.ui.show('修改成功');");
            }
            stringBuilder.Append(Environment.NewLine);
            stringBuilder.Append("winclose('PaymentEdit', 'PayoutPaymentEdit.aspx?ContractID=" + payment.ContractID + "', true)");
            base.RegisterScript(stringBuilder.ToString());
        }
        catch (Exception)
        {
            base.RegisterHintScript("Update", false, string.Empty);
        }
    }