/// <summary>
        /// Creating master entries for GL Updating
        /// </summary>
        /// <param name="type"> 0- Cash, 1- Cheque, 2- Transfer</param>
        public object CreateMasterEntry(int type, object nextNoObj)
        {
            object retObj;

            retObj = new object();
            switch (type)
            {
            case 0:
                cashnn = new CashNN();
                cashnn = (CashNN)nextNoObj;
                cashnn = InsertCashMaster(cashnn);
                retObj = cashnn;
                break;

            case 1:
                chqnn  = new ChequeNN();
                chqnn  = (ChequeNN)nextNoObj;
                chqnn  = InsertChequeMaster(chqnn);
                retObj = chqnn;
                break;

            case 2:
                trnn   = new TransferNN();
                trnn   = (TransferNN)nextNoObj;
                trnn   = InsertTransferMaster(trnn);
                retObj = trnn;
                break;
            }
            //strsql = " ";
            return(retObj);
        }
        public CashNN GetCashLastNo()
        {
            CashNN lastCashNo = new CashNN();

            strsql = "Select top 1 * from indCA Order by Ind Desc";
            table  = db.GetDataTable(strsql, DBAccess.GL);
            if (table.Rows.Count == 1)
            {
                lastCashNo.ind = int.Parse(table.Rows[0]["ind"].ToString());
                lastCashNo.ws  = table.Rows[0]["ws"].ToString();
                lastCashNo.st  = DateTime.Parse(table.Rows[0]["st"].ToString());
            }
            return(lastCashNo);
        }
        /// <summary>
        /// Cash master entry
        /// </summary>
        /// <param name="cashnn"></param>
        /// <returns>Cash master object</returns>
        private CashNN InsertCashMaster(CashNN cashnn)
        {
            cashnn.ws = Environment.MachineName + DateTime.Now.ToShortTimeString().Trim();
            strsql    = "Insert into indCA Values ('" + cashnn.ws + "',GETDATE())";
            db        = new DBAccess();
            db.ExecuteQuery(strsql, DBAccess.GL);

            //strsql = "Select top 1 * from indCA Order by Ind Desc";
            //table = db.GetDataTable(strsql, DBAccess.GL);
            //if (table.Rows.Count == 1)
            //{
            //    cashnn.ind = int.Parse(table.Rows[0]["ind"].ToString());
            //    cashnn.ws = table.Rows[0]["ws"].ToString();
            //    cashnn.st = DateTime.Parse(table.Rows[0]["st"].ToString());
            //}
            cashnn = GetCashLastNo();
            return(cashnn);
            //throw new NotImplementedException();
        }