Beispiel #1
0
        private void BindCustomerAndBank()
        {
            try
            {
                customerservice = new ClientService();
                int accountId    = Convert.ToInt32(comboAccount.SelectedValue);
                var customerList = customerservice.GetClientList(accountId);
                customerList.Insert(0, new Client {
                    Id = 0, BusinessName = ""
                });
                comboCustomerName.DataSource    = customerList.ToArray();
                comboCustomerName.ValueMember   = "Id";
                comboCustomerName.DisplayMember = "BusinessName";

                accountBankDetailService = new AccountBankDetailService();
                var bankList = accountBankDetailService.GetAccountBankList(accountId);
                bankList.Insert(0, new AccountBankDetail {
                    Id = 0, BankName = ""
                });
                comboBank.DataSource    = bankList.ToArray();
                comboBank.ValueMember   = "Id";
                comboBank.DisplayMember = "BankName";
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, Comman.Product_Name, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Beispiel #2
0
 private void comboBank_SelectedIndexChanged(object sender, EventArgs e)
 {
     try
     {
         accountBankDetailService = new AccountBankDetailService();
         int bankId = 0;
         int.TryParse(Convert.ToString(comboBank.SelectedValue), out bankId);
         if (bankId <= 0)
         {
             return;
         }
         var bankDetails = accountBankDetailService.GetBankDataById(bankId);
         if (bankDetails != null)
         {
             txtAccountNumber.Text = bankDetails.AccountNumber;
             txtBranchName.Text    = bankDetails.BranchName;
             txtIFSCcode.Text      = bankDetails.IFSCcode;
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, Comman.Product_Name, MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }