Esempio n. 1
0
        /// <summary>
        /// 保存按钮
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnAdd_Click(object sender, ImageClickEventArgs e)
        {
            string id  = Request.QueryString["id"];
            string msg = string.Empty;

            if (!string.IsNullOrEmpty(id))
            {
                Business_BankBLL bllBank = new Business_BankBLL();
                Business_Bank    model   = bllBank.Find(p => p.BankID == id);
                model.Bank_Name        = txtBank_Name.Text.Trim();
                model.Bank_No          = txtBank_No.Text.Trim();
                model.Bank_Contact     = txtBank_Contact.Text.Trim();
                model.Bank_Telephone   = txtBank_Telephone.Text.Trim();
                model.Bank_Type        = ddlBank_Type.SelectedValue;
                model.Bank_Address     = txtBank_Address.Text.Trim();
                model.Bank_Account     = txtBank_Account.Text.Trim();
                model.Bank_AccountName = txtBank_AccountName.Text.Trim();
                model.Bank_AccountType = ddlBank_AccountType.SelectedValue;
                model.Bank_OpenBName   = txtBank_OpenBName.Text.Trim();
                bool bol = bllBank.Update(model, out msg);
                if (bol)
                {
                    MessageBox.ShowAndRedirect(this, "保存成功!", "BankList.aspx");
                }
            }
            else
            {
                MessageBox.Show(this, msg);
            }
        }
Esempio n. 2
0
        /// <summary>
        /// 加载页面信息
        /// </summary>
        private void BindShow()
        {
            string id = Request.QueryString["id"];

            if (!string.IsNullOrEmpty(id))
            {
                Business_BankBLL bllBank = new Business_BankBLL();
                Business_Bank    model   = bllBank.Find(p => p.BankID == id);
                if (model == null)
                {
                    MessageBox.ShowAndRedirect(this, "该数据不存在!", "BankList.aspx");
                }
                else
                {
                    txtBank_Name.Text                 = model.Bank_Name;
                    txtBank_No.Text                   = model.Bank_No;
                    txtBank_Contact.Text              = model.Bank_Contact;
                    txtBank_Telephone.Text            = model.Bank_Telephone;
                    ddlBank_Type.SelectedValue        = model.Bank_Type;
                    txtBank_Address.Text              = model.Bank_Address;
                    txtBank_Account.Text              = model.Bank_Account;
                    txtBank_AccountName.Text          = model.Bank_AccountName;
                    ddlBank_AccountType.SelectedValue = model.Bank_AccountType;
                    txtBank_OpenBName.Text            = model.Bank_OpenBName;
                }
            }
        }
Esempio n. 3
0
        /// <summary>
        /// 保存按钮
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnAdd_Click(object sender, ImageClickEventArgs e)
        {
            string           id      = Request.QueryString["id"];
            string           msg     = string.Empty;
            Business_BankBLL bllBank = new Business_BankBLL();

            //编辑保存
            if (!string.IsNullOrEmpty(id))
            {
                Business_Bank model = bllBank.Find(p => p.BankID == id);
                FormModel.GetForm <Business_Bank>(this, model, "txt");
                FormModel.GetForm <Business_Bank>(this, model, "ddl");
                model.Bank_UpdateTime   = DateTime.Now;
                model.Bank_UpdateUserId = base.CurrUserInfo().UserID;
                bool bol = bllBank.Update(model, out msg);
                if (bol)
                {
                    MessageBox.ShowAndRedirect(this, "保存成功!", "BankList.aspx");
                }
                else
                {
                    MessageBox.Show(this, msg);
                }
            }
            else  //新增保存
            {
                Business_Bank model = new Business_Bank();
                FormModel.GetForm <Business_Bank>(this, model, "txt");
                FormModel.GetForm <Business_Bank>(this, model, "ddl");
                model.BankID       = Guid.NewGuid().ToString();
                model.Bank_Deleted = false;
                bool bol = bllBank.Add(model, out msg);
                if (bol)
                {
                    MessageBox.ShowAndRedirect(this, "保存成功!", "BankList.aspx");
                }
                else
                {
                    MessageBox.Show(this, msg);
                }
            }
        }
Esempio n. 4
0
        /// <summary>
        /// 删除一条银行数据
        /// </summary>
        /// <param name="id"></param>
        public string DelBank(string id)
        {
            string           msg     = string.Empty;
            Business_BankBLL bllBank = new Business_BankBLL();
            Business_Bank    model   = new Business_Bank();

            model = bllBank.Find(p => p.BankID == id);
            model.Bank_UpdateTime   = DateTime.Now;
            model.Bank_UpdateUserId = base.CurrUserInfo().UserID;
            model.Bank_Deleted      = true;
            bool bol = bllBank.Update(model, out msg);

            if (bol)
            {
                //删除成功
                msg = "1";
            }
            else
            {
                //删除失败
                msg = "0";
            }
            return(msg);
        }