public bool CheckDuplicateKey(string pinserial)
        {
            StakeInfoDAL stakeInfo = new StakeInfoDAL();
            bool status = false;
            LumexDBPlayer db = LumexDBPlayer.Start(true);
            try
            {
                status = stakeInfo.CheckDuplicateKey(pinserial, db);

            }
            catch (Exception)
            {

                throw;
            }
            finally
            {
                stakeInfo = null;
                db.Stop();
            }
            return status;
        }
        public bool UpdateStakePinActivation(string serial, string IsActive)
        {
            StakeInfoDAL stakeInfo = new StakeInfoDAL();
            bool status = false;
            LumexDBPlayer db = LumexDBPlayer.Start(true);
            try
            {
                stakeInfo.UpdateStakePinActivation(serial, IsActive, db);
                status = true;
            }
            catch (Exception)
            {

                throw;
            }
            finally
            {
                stakeInfo = null;
                db.Stop();
            }
            return status;
        }
        public bool updateKeyWhenReject(string Serial, string UserId)
        {
            bool status = false;
            try
            {
                StakeInfoDAL stakeInfo = new StakeInfoDAL();
                LumexDBPlayer db = LumexDBPlayer.Start(true);
                stakeInfo.updateKeyWhenReject(Serial, UserId, db);
                db.Stop();
                status = true;
            }
            catch (Exception)
            {

                throw;
            }
            return status;
        }
        public bool UpdateStakeInfo()
        {
            StakeInfoDAL stakeInfo = new StakeInfoDAL();
            bool status = false;
            LumexDBPlayer db = LumexDBPlayer.Start(true);
            try
            {
                stakeInfo.UpdateStakeInfo(this, db);
                status = true;
            }
            catch (Exception)
            {

                throw;
            }
            finally
            {
                stakeInfo = null;
                db.Stop();
            }
            return status;
        }
        public bool updateKeyonTransfer(DataTable dt)
        {
            bool status = false;
            try
            {
                StakeInfoDAL stakeInfo = new StakeInfoDAL();
                LumexDBPlayer db = LumexDBPlayer.Start(true);
                stakeInfo.updateKeyonTransfer(this,dt, db);
                db.Stop();
                status = true;
            }
            catch (Exception)
            {

                throw;
            }
            return status;
        }
        public DataTable updateKeyWhenPurchase(string NoofPin, string UnitPrice, string StakeId, string payby)
        {
            DataTable dt = new DataTable();
            StakeInfoDAL stakeInfo = new StakeInfoDAL();
            try
            {
                LumexDBPlayer db = LumexDBPlayer.Start(true);
                dt = stakeInfo.updateKeyWhenPurchase(NoofPin,UnitPrice,StakeId,payby, db);
                db.Stop();
                return dt;
            }
            catch (Exception)
            {

                throw;
            }
            finally
            {
                stakeInfo = null;
            }
        }
        public bool SaveGeneratedPin(DataTable dt)
        {
            StakeInfoDAL stakeInfo = new StakeInfoDAL();
            bool status = false;
            LumexDBPlayer db = LumexDBPlayer.Start(true);
            try
            {
                stakeInfo.SaveGeneratedPin(dt, db);
                status = true;
            }
            catch (Exception)
            {

                throw;
            }
            finally
            {
                stakeInfo = null;
                db.Stop();
            }
            return status;
        }
        public bool SaveStakeInfo()
        {
            StakeInfoDAL saveStakeInfo = new StakeInfoDAL();
            bool status = false;
            DataTable dt = new DataTable();

            try
            {
                LumexDBPlayer db = LumexDBPlayer.Start(true);
                dt = saveStakeInfo.SaveStaKeInfo(this, db);
                if (dt.Rows.Count > 0)
                {
                    status = true;
                    StakeId = dt.Rows[0][0].ToString();
                }
                db.Stop();
            }
            catch (Exception)
            {

                throw;
            }
            finally
            {
                dt.Clear();
            }
            return status;
        }
        public DataTable getStakePinListBySentto(string UserId)
        {
            DataTable dt = new DataTable();
            StakeInfoDAL stakeInfo = new StakeInfoDAL();
            try
            {
                LumexDBPlayer db = LumexDBPlayer.Start(true);
                dt = stakeInfo.getStakePinListBySentto(UserId, db);
                db.Stop();
                return dt;
            }
            catch (Exception)
            {

                throw;
            }
            finally
            {
                stakeInfo = null;
            }
        }
        public DataTable getStakeKeyLogdataAll()
        {
            DataTable dt = new DataTable();
            StakeInfoDAL stakeInfo = new StakeInfoDAL();
            try
            {
                LumexDBPlayer db = LumexDBPlayer.Start(true);
                dt = stakeInfo.getStakeKeyLogdataAll(db);
                db.Stop();
                return dt;
            }
            catch (Exception)
            {

                throw;
            }
            finally
            {
                stakeInfo = null;
            }
        }
        public DataTable GetStakeInfoById(string stakeId)
        {
            DataTable dt = new DataTable();
            StakeInfoDAL stakeInfo = new StakeInfoDAL();
            try
            {
                LumexDBPlayer db = LumexDBPlayer.Start(true);
                dt = stakeInfo.GetStakeInfoById(stakeId, db);
                db.Stop();
                return dt;
            }
            catch (Exception)
            {

                throw;
            }
            finally
            {
                stakeInfo = null;
            }
        }
        public decimal getstakeAmountByStakeId(string stakeId)
        {
            DataTable dt = new DataTable();
            StakeInfoDAL stakeInfo = new StakeInfoDAL();
            decimal amount = 0;
            try
            {
                LumexDBPlayer db = LumexDBPlayer.Start(true);
                dt = stakeInfo.getstakeAmountByStakeId(stakeId, db);
                db.Stop();
                if (dt.Rows.Count > 0)
                {
                    amount = Convert.ToDecimal(dt.Rows[0][0].ToString());
                }
                return amount;
            }
            catch (Exception)
            {

                throw;
            }
            finally
            {
                stakeInfo = null;
            }
        }
        public bool CheckStakeKeyAvailability(string StakeKey, string UserId, string StakeId)
        {
            bool status = false;
            try
            {
                StakeInfoDAL stakeInfo = new StakeInfoDAL();
                LumexDBPlayer db = LumexDBPlayer.Start(true);
                DataTable dt = stakeInfo.CheckStakeKeyAvailability(StakeKey, UserId, StakeId, db);
                db.Stop();

                if (dt.Rows.Count > 0)
                {
                    status = true;
                }
            }
            catch (Exception)
            {

                throw;
            }
            return status;
        }