Exemplo n.º 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!base.IsPostBack)
            {
                if (base.Request["Id"] != null)
                {
                    this.btnAdd.Visible = false;
                    Out_BankFlow model = this.outBankSer.GetModel(Convert.ToInt32(base.Request["Id"]));
                    this.lblNumber.Text          = model.Number;
                    this.lblReferenceNumber.Text = model.ReferenceNumber;
                    this.ddlOutType.Text         = model.OutType;
                    this.txtProNo.Text           = model.ProNo;
                    this.txtOutTotal.Text        = model.OutTotal.ToString();
                    this.txtRemark.Text          = model.Remark;
                }
                else
                {
                    lblReferenceNumber.Text = Request["TransactionReferenceNumber"].ToString();
                    this.btnUpdate.Visible  = false;
                }
                BankFlowService bandFlowSer = new BankFlowService();
                var             list        = bandFlowSer.GetListArray(string.Format("TransactionReferenceNumber='{0}'", lblReferenceNumber.Text));
                if (list.Count > 0)
                {
                    lblInPayeeName.Text = list[0].InPayeeName;
                    lblTradeAmount.Text = System.Math.Abs(list[0].TradeAmount).ToString();
                    lblTime.Text        = list[0].TransactionDate.ToString();

                    string sql = string.Format("select ISNULL(SUM(OutTotal),0) AS SUMOutTotal FROM Out_BankFlow  where ReferenceNumber='{0}'", lblReferenceNumber.Text);
                    //if (base.Request["Id"] != null)
                    //{
                    //    sql += " and id<>" + Request["Id"];
                    //}
                    var total = Convert.ToDecimal(DBHelp.ExeScalar(sql));
                    lblLastTotal.Text = (System.Math.Abs(list[0].TradeAmount) - total).ToString();

                    var outList = outBankSer.GetListArray(string.Format("  ReferenceNumber='{0}'", lblReferenceNumber.Text));
                    var time    = Convert.ToDateTime(lblTime.Text);
                    foreach (var m in outList)
                    {
                        m.Time = time;
                    }

                    gvLiuShui.DataSource = outList;
                    gvLiuShui.DataBind();
                }
            }
        }
Exemplo n.º 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!base.IsPostBack)
            {
                if (base.Request["Id"] != null)
                {
                    this.btnAdd.Visible = false;
                    In_BankFlow model = this.inBankSer.GetModel(Convert.ToInt32(base.Request["Id"]));
                    this.lblNumber.Text          = model.Number;
                    this.lblReferenceNumber.Text = model.ReferenceNumber;
                    this.ddlInType.Text          = model.InType;
                    this.txtFPNo.Text            = model.FPNo;
                    this.txtFPTotal.Text         = model.FPTotal.ToString();
                    this.txtRemark.Text          = model.Remark;

                    if (ddlInType.Text == "发票回款")
                    {
                        txtFPNo.Enabled = true;
                    }
                    else
                    {
                        txtFPNo.Enabled = false;
                    }
                }
                else
                {
                    lblReferenceNumber.Text = Request["TransactionReferenceNumber"].ToString();

                    this.btnUpdate.Visible = false;
                }
                BankFlowService bandFlowSer = new BankFlowService();
                var             list        = bandFlowSer.GetListArray(string.Format("TransactionReferenceNumber='{0}'", lblReferenceNumber.Text));
                if (list.Count > 0)
                {
                    lblOutPayerName.Text = list[0].OutPayerName;
                }
            }
        }