/// <summary>
 /// Function to check wheteher cash or bank is selected
 /// </summary>
 public void CheckWhetherBankOrCash()
 {
     try
     {
         //----- To make readonly txtChequeNo and txtChequeDate if selected ledger group is cash-----//
         if (cmbCashOrBank.SelectedValue != null && cmbCashOrBank.SelectedValue.ToString() != string.Empty)
         {
             decimal decLedger = Convert.ToDecimal(cmbCashOrBank.SelectedValue.ToString());
             bool isBankAcocunt = false;
             AccountGroupBll bllAccountGroup = new AccountGroupBll();
             List<DataTable> ListObj = new List<DataTable>();
             ListObj = bllAccountGroup.CheckWheatherLedgerUnderCash();
             //-------- Checking whether the selected legder is under bank----------//
             foreach (DataRow dr in ListObj[0].Rows)
             {
                 string str = dr.ItemArray[0].ToString();
                 if (decLedger == Convert.ToDecimal(dr.ItemArray[0].ToString()))
                 {
                     isBankAcocunt = true;
                 }
             }
             if (isBankAcocunt)
             {
                 txtCheckNo.Enabled = false;
                 txtChequeDate.Enabled = false;
                 dtpCheckDate.Enabled = false;
                 txtCheckNo.Clear();
             }
             else
             {
                 txtCheckNo.Enabled = true;
                 txtChequeDate.Enabled = true;
                 dtpCheckDate.Enabled = true;
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("AP17:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }