/// <summary> /// checking 'Account Group' for secondary details or bank details /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void cmbGroup_SelectedValueChanged(object sender, EventArgs e) { try { if (cmbGroup.SelectedValue != null) { List<DataTable> ListObj = new List<DataTable>(); AccountLedgerBll bllAccountLedger = new AccountLedgerBll(); isSundryDebtorOrCreditor = false; isBankAccount = false; ListObj = bllAccountLedger.AccountLedgerForSecondaryDetails(); for (int ini = 0; ini < ListObj[0].Rows.Count; ini++) { strGroup = ListObj[0].Rows[ini].ItemArray[0].ToString(); if (strGroup == cmbGroup.SelectedValue.ToString()) { isSundryDebtorOrCreditor = true; } } ListObj = bllAccountLedger.AccountLedgerForBankDetails(); for (int ini = 0; ini < ListObj[0].Rows.Count; ini++) { strBankAccount = ListObj[0].Rows[ini].ItemArray[0].ToString(); if (strBankAccount == cmbGroup.SelectedValue.ToString()) { isBankAccount = true; } } if (!isBankAccount) { gbxDetails.Visible = false; } else { gbxDetails.Visible = true; } if (cmbGroup.SelectedIndex > 0) { string strNature = bllAccountLedger.CreditOrDebitChecking(Convert.ToDecimal(cmbGroup.SelectedValue.ToString())); cmbOpeningBalanceCrOrDr.Text = strNature.ToString(); } } } catch (Exception ex) { MessageBox.Show("AL48:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }