protected void btnSave_Click(object sender, EventArgs e)
        {
            try
            {

                Bank objBank = new Bank();

                objBank.BankCode = txtBankCode.Value;
                objBank.BankName = txtBankName.Value;
                objBank.ContactPerson = txtContactPerson.Value;
                objBank.ContactDesignation = txtDesignation.Value;
                objBank.ContactNo = txtContactNo.Value;
                objBank.ContactEmail = txtEmail.Value;
                objBank.CompanyId = _company.CompanyId;
                objBank.UpdatedBy = _user.UserId;
                objBank.UpdatedDate = DateTime.Today;
                objBank.IsActive = chkIsActive.Checked;

                int sucess = 0;
                if (lblId.Text == "" || lblId.Text == "0")
                {
                    objBank.BankId = new Bank().GetMaxBankId() + 1;

                    sucess = objBank.InsertBank();

                    if (sucess > 0)
                    {
                        Alert.Show("Bank info saved successfully");
                        this.Clear();
                    }
                }
                else
                {
                    objBank.BankId = int.Parse(lblId.Text);
                    sucess = objBank.UpdateBank();

                    if (sucess > 0)
                    {
                        Response.Redirect("BankLists.aspx", true);
                    }
                }
            }
            catch (Exception ex)
            {
                Alert.Show(ex.Message);
            }
        }
Пример #2
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            Bank objBank = new Bank();

            objBank.BankCode = txtBankCode.Value;
            objBank.BankName = txtBankName.Value;
            objBank.ContactPerson = txtContactPerson.Value;
            objBank.ContactDesignation = txtDesignation.Value;
            objBank.ContactNo = txtContactNo.Value;
            objBank.ContactEmail = txtEmail.Value;
            objBank.CompanyId = _company.CompanyId;
            objBank.UpdatedBy = _user.UserId;
            objBank.UpdatedDate = DateTime.Today;
            objBank.IsActive = chkIsActive.Checked;

            int sucess = 0;
            if (lblId.Text == "" || lblId.Text == "0")
            {
                objBank.BankId = new Bank().GetMaxBankId(objBank.CompanyId);
                objBank.BankId++;

                sucess = objBank.InsertBank();
            }
            else
            {
                objBank.BankId = int.Parse(lblId.Text==""?"0":lblId.Text);
                sucess = objBank.UpdateBank();
            }

            if (sucess > 0)
            {
                Alert.Show("Bank info saved successfully");
                this.Clear();
                this.LoadBankTable();
            }
        }
Пример #3
0
        protected void btnSaveBankInfo_Click(object sender, EventArgs e)
        {
            Bank objBank = new Bank();

            List<Bank> myList = objBank.GetAllBank(_company.CompanyId);
            int bankId = myList.Count;

            objBank.BankId = bankId;
            objBank.BankCode = txtBankCode.Value;
            objBank.BankName = txtBankName.Value;
            objBank.ContactPerson = txtContactPerson.Value;
            objBank.ContactDesignation = txtDesignation.Value;
            objBank.ContactNo = txtContactNo.Value;
            objBank.ContactEmail = txtEmail.Value;
            objBank.CompanyId = _company.CompanyId;
            objBank.UpdatedBy = _user.UserId;
            objBank.UpdatedDate = DateTime.Today;
            objBank.IsActive = chkIsActive.Checked;

            int sucess = 0;
            sucess = objBank.InsertBank();

            if (sucess > 0)
            {
                Alert.Show("Bank info Saved successfully");
                this.Clear();
                this.LoadBankTable();
                this.LoadBankNames();
                AccountInfoPageDiv.Disabled = false;
            }
        }