コード例 #1
0
        private void LoadBankList()
        {
            DataTable dt = FirmAccountInfoManager.GetList("");

            rpBankList.DataSource = dt;
            rpBankList.DataBind();
        }
コード例 #2
0
        ///<summary>
        /// 删除公司资料
        /// </summary>
        /// <param name="id">公司id值</param>
        private void DelFirm(int id)
        {
            string    result = "";
            string    strsql = " ',' + firmidlist + ',' like '%," + id.ToString() + ",%'";
            DataTable tbl    = LoginInfoManager.getList(strsql);

            if (tbl.Rows.Count == 0)
            {
                string strdel = " firmid=" + id.ToString();
                FirmAccountInfoManager.Del(strdel);
                if (FirmInfoManager.Delete(id))
                {
                    result = "<script>alert('删除成功')</script>";
                }
                else
                {
                    result = "<script>alert('删除失败')</script>";
                }
            }
            else
            {
                result = "<script>alert('删除失败,有关联的用户资料')</script>";
            }
            Page.ClientScript.RegisterClientScriptBlock(Page.GetType(), "del", result, false);
        }
コード例 #3
0
        /// <summary>
        /// 根据选择银行加载银行账号
        /// </summary>
        private void LoadBankAccount()
        {
            if (DdlBank.SelectedIndex < 0)
            {
                return;
            }
            FirmAccountInfo bankInfo = FirmAccountInfoManager.GetModel(int.Parse(DdlBank.SelectedValue));

            txtBankAccount.Text = bankInfo.account.Trim();
        }
コード例 #4
0
        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());
        }
コード例 #5
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 = "";
     }
 }
コード例 #6
0
        /// <summary>
        /// 绑定银行信息
        /// </summary>
        private void Load_Bank()
        {
            DataTable dtBanks = FirmAccountInfoManager.GetList("");
            DataRow   dr      = dtBanks.NewRow();

            dr["bankname"] = "——请选择——";
            dr["id"]       = "0";
            dtBanks.Rows.InsertAt(dr, 0);
            ddlBank.DataTextField  = "bankname";
            ddlBank.DataValueField = "id";
            ddlBank.DataSource     = dtBanks;
            ddlBank.DataBind();
        }
コード例 #7
0
        /// <summary>
        /// 绑定银行
        /// </summary>
        private void BindBank()
        {
            ddlAcount.Items.Clear();
            DataTable dt = FirmAccountInfoManager.GetList("");
            DataRow   dr = dt.NewRow();

            dr["bankname"] = "——请选择——";
            dr["id"]       = "0";
            dt.Rows.InsertAt(dr, 0);
            ddlAcount.DataTextField  = "bankname";
            ddlAcount.DataValueField = "id";
            ddlAcount.DataSource     = dt;
            ddlAcount.DataBind();
        }
コード例 #8
0
        /// <summary>
        /// 加载支付帐号信息
        /// </summary>
        private void LoadPayAccount()
        {
            this.payAccount.Items.Clear();
            this.payAccount.Items.Add(new ListItem("——请选择——", "0"));
            DataTable dt = FirmAccountInfoManager.GetList("");

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                ListItem adItem = new ListItem();
                adItem.Text  = "开户银行:" + dt.Rows[i]["bankname"].ToString() + ", 银行帐号:" + dt.Rows[i]["account"].ToString() + ", 开户名称:" + dt.Rows[i]["accountUser"].ToString();
                adItem.Value = dt.Rows[i]["bankname"].ToString() + "," + dt.Rows[i]["account"].ToString() + "," + dt.Rows[i]["accountUser"].ToString() + "," + dt.Rows[i]["id"].ToString();
                this.payAccount.Items.Add(adItem);
            }
        }
コード例 #9
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);
         }
     }
 }
コード例 #10
0
        /// <summary>
        /// 加载银行信息
        /// </summary>
        private void LoadBank(string bank = "")
        {
            if (ddlUnit.SelectedIndex < 0)
            {
                return;
            }
            DataTable dtBanks = FirmAccountInfoManager.GetList(string.Format(" firmid={0}", ddlUnit.SelectedValue));

            DdlBank.DataTextField  = "bankname";
            DdlBank.DataValueField = "id";
            DdlBank.DataSource     = dtBanks;
            DdlBank.DataBind();

            if (!string.IsNullOrEmpty(bank))
            {
                ListItem item = DdlBank.Items.FindByText(bank);
                if (item != null)
                {
                    DdlBank.SelectedIndex = DdlBank.Items.IndexOf(item);
                }
            }
        }