Exemple #1
0
        public bool CheckWhetherBankOrCash(decimal cashOrBankId, string cashOrBankName)
        {
            bool isBankAcocunt = false;

            try
            {
                //----- To make readonly txtChequeNo and txtChequeDate if selected ledger group is cash-----//
                if (cashOrBankName != null && cashOrBankName != string.Empty && cashOrBankId > 0)
                {
                    decimal decLedger = Convert.ToDecimal(cashOrBankId);

                    AccountGroupSP SpGroup = new AccountGroupSP();
                    DataTable      dtbl    = new DataTable();
                    dtbl = SpGroup.CheckWheatherLedgerUnderCash();
                    //-------- Checking whether the selected legder is under bank----------//
                    foreach (DataRow dr in dtbl.Rows)
                    {
                        string str = dr.ItemArray[0].ToString();
                        if (decLedger == Convert.ToDecimal(dr.ItemArray[0].ToString()))
                        {
                            isBankAcocunt = true;
                        }
                    }
                }
            }
            catch (Exception ex)
            {
            }
            return(isBankAcocunt);
        }
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        public List <DataTable> CheckWheatherLedgerUnderCash()
        {
            List <DataTable> ListObj = new List <DataTable>();

            try
            {
                ListObj = spAccountGroup.CheckWheatherLedgerUnderCash();
            }
            catch (Exception ex)
            {
                MessageBox.Show("AG19:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            return(ListObj);
        }