Exemple #1
0
 private void btnEditBranch_Click(object sender, EventArgs e)
 {
     try
     {
         frmAddEditBankBranch frm = new frmAddEditBankBranch(this.SelectedBranchID);
         frm.BankID = this.SelectedBankID;
         if (frm.ShowDialog() == DialogResult.OK)
         {
             PopulateBankBranchesGrid();
         }
     }
     catch (Exception ex)
     {
         string errMessage = ex.Message;
         if (ex.InnerException != null)
         {
             errMessage += string.Format("\n{0}", ex.InnerException.Message);
         }
         MessageBox.Show(errMessage, "PageBankMaster::btnEditBranch_Click", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
 private void btnAddNewBankBranch_Click(object sender, EventArgs e)
 {
     try
     {
         int bankId = ((SelectListItem)cboBankName.SelectedItem).ID;
         frmAddEditBankBranch frm = new frmAddEditBankBranch();
         frm.BankID = bankId;
         if (frm.ShowDialog() == DialogResult.OK)
         {
             PopulateBankBranchesDropdown();
             cboBankBranchName.SelectedItem = ((List <SelectListItem>)cboBankBranchName.DataSource).Where(x => x.ID == frm.BankBranchID).FirstOrDefault();
         }
     }
     catch (Exception ex)
     {
         string errMessage = ex.Message;
         if (ex.InnerException != null)
         {
             errMessage += string.Format("\n{0}", ex.InnerException.Message);
         }
         MessageBox.Show(errMessage, "PageBankMaster::btnAddNewBranch_Click", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }