/// <summary>
        /// 根据选择银行加载银行账号
        /// </summary>
        private void LoadBankAccount()
        {
            if (DdlBank.SelectedIndex < 0)
            {
                return;
            }
            FirmAccountInfo bankInfo = FirmAccountInfoManager.GetModel(int.Parse(DdlBank.SelectedValue));

            txtBankAccount.Text = bankInfo.account.Trim();
        }
        public string getamount(object id)
        {
            int firmid = 0;

            int.TryParse(id.ToString(), out firmid);
            FirmAccountInfo model   = FirmAccountInfoManager.GetModel(firmid);
            decimal         collect = FirmAccountInfoManager.GetMoneySum(id.ToString(), "1", model.ystime.ToString("yyyy-MM-dd"));
            decimal         pay     = FirmAccountInfoManager.GetMoneySum(id.ToString(), "0", model.ystime.ToString("yyyy-MM-dd"));

            return((model.amount + collect - pay).ToString());
        }
Beispiel #3
0
 /// <summary>
 /// 选择银行之后显示帐号信息
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void ddlBank_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (ddlBank.SelectedIndex > 0)
     {
         FirmAccountInfo bankInfo = FirmAccountInfoManager.GetModel(int.Parse(ddlBank.SelectedValue));
         this.lblBankAccount.Text = bankInfo.account.Trim();
     }
     else
     {
         this.lblBankAccount.Text = "";
     }
 }
Beispiel #4
0
 /// <summary>
 /// 初始化数据table
 /// </summary>
 /// <returns></returns>
 private DataTable initializeDataTable()
 {
     if (dtExpense != null && dtExpense.Rows.Count > 0)
     {
         return(dtExpense);
     }
     else
     {
         string bankId = Request.QueryString["bankid"];
         if (!string.IsNullOrEmpty(bankId))
         {
             FirmAccountInfo accountinfo = FirmAccountInfoManager.GetModel(int.Parse(bankId));
             string          sqlstr      = " and comebankid = " + bankId;
             sqlstr += accountinfo.ystime.ToString() != "" ? " and comedate >='" + accountinfo.ystime.ToString("yyyy-MM-dd") + "' " : "";
             decimal   preinstallMoney = accountinfo.amount; //得到账户预设余额
             DataTable dt = FirmAccountInfoManager.GetExpense(sqlstr, "comedate asc");
             dt.Columns.Add("balance");                      //增加余额一列
             for (int i = 0; i < dt.Rows.Count; i++)
             {
                 if (dt.Rows[i]["InMoney"].ToString() == "-") // 表示是一条付款记录
                 {
                     decimal d = 0;
                     decimal.TryParse(dt.Rows[i]["OutMoney"].ToString(), out d);
                     preinstallMoney      -= d;
                     dt.Rows[i]["balance"] = preinstallMoney.ToString("0.00");
                 }
                 else //一条收款记录
                 {
                     decimal d = 0;
                     decimal.TryParse(dt.Rows[i]["InMoney"].ToString(), out d);
                     preinstallMoney      += d;
                     dt.Rows[i]["balance"] = preinstallMoney.ToString("0.00");
                 }
             }
             dtExpense = dt.Copy();
             dtExpense.Columns["comedate"].DataType = typeof(DateTime);
             return(dtExpense);
         }
         else
         {
             return(null);
         }
     }
 }