public void SaveUserSalesCentersByUserId(string userId, List<string> salesCenters)
        {
            SalesCenterDAL salesCenter = new SalesCenterDAL();

            try
            {
                LumexDBPlayer db = LumexDBPlayer.Start(true);
                salesCenter.SaveUserSalesCentersByUserId(userId, salesCenters, db);
                db.Stop();
            }
            catch (Exception)
            {
                throw;
            }
            finally
            {
                salesCenter = null;
            }
        }
        public DataTable GetSalesCenterList()
        {
            SalesCenterDAL salesCenter = new SalesCenterDAL();

            try
            {
                LumexDBPlayer db = LumexDBPlayer.Start();
                DataTable dt = salesCenter.GetSalesCenterList(db);
                db.Stop();

                return dt;
            }
            catch (Exception)
            {
                throw;
            }
            finally
            {
                salesCenter = null;
            }
        }
        public DataTable SaveSalesCenter()
        {
            SalesCenterDAL salesCenter = new SalesCenterDAL();

            try
            {
                LumexDBPlayer db = LumexDBPlayer.Start(true);
                DataTable dt = salesCenter.SaveSalesCenter(this, db);
                db.Stop();

                return dt;
            }
            catch (Exception)
            {
                throw;
            }
            finally
            {
                salesCenter = null;
            }
        }
        public DataTable GetSalesCenterListByActivationStatus(string isActive)
        {
            SalesCenterDAL salesCenter = new SalesCenterDAL();

            try
            {
                LumexDBPlayer db = LumexDBPlayer.Start();
                DataTable dt = salesCenter.GetSalesCenterListByActivationStatus(isActive, db);
                db.Stop();

                return dt;
            }
            catch (Exception)
            {
                throw;
            }
            finally
            {
                salesCenter = null;
            }
        }
        public DataTable getTotalCashCreditSalesByDateRange(string startdate, string EndDate, string UserId)
        {
            SalesCenterDAL salesCenter = new SalesCenterDAL();

            try
            {
                LumexDBPlayer db = LumexDBPlayer.Start();
                DataTable dt = salesCenter.getTotalCashCreditSalesByDateRange(startdate, EndDate, UserId, db);
                db.Stop();

                return dt;
            }
            catch (Exception)
            {
                throw;
            }
            finally
            {
                salesCenter = null;
            }
        }
        public bool UpdateSalesCenterNotificationLimit()
        {
            SalesCenterDAL salesCenter = new SalesCenterDAL();
            bool status = false;
            try
            {
                LumexDBPlayer db = LumexDBPlayer.Start();
               salesCenter.UpdateSalesCenterNotificationLimit(this, db);
                db.Stop();

               status=true;
            }
            catch (Exception)
            {
                throw;
            }
            finally
            {
                salesCenter = null;
            }
            return status;
        }
        public DataTable getAvailableProductListBySalesCenter(string SalesCenter)
        {
            SalesCenterDAL salesCenter = new SalesCenterDAL();

            try
            {
                LumexDBPlayer db = LumexDBPlayer.Start();
                DataTable dt = salesCenter.getAvailableProductListBySalesCenter(SalesCenter, db);
                db.Stop();

                return dt;
            }
            catch (Exception)
            {
                throw;
            }
            finally
            {
                salesCenter = null;
            }
        }
        public void UpdateSalesCenter()
        {
            SalesCenterDAL salesCenter = new SalesCenterDAL();

            try
            {
                LumexDBPlayer db = LumexDBPlayer.Start(true);
                salesCenter.UpdateSalesCenter(this, db);
                db.Stop();
            }
            catch (Exception)
            {
                throw;
            }
            finally
            {
                salesCenter = null;
            }
        }
        public void DeleteSalesCenter(string salesCenterId)
        {
            SalesCenterDAL salesCenter = new SalesCenterDAL();

            try
            {
                LumexDBPlayer db = LumexDBPlayer.Start(true);
                salesCenter.DeleteSalesCenter(salesCenterId, db);
                db.Stop();
            }
            catch (Exception)
            {
                throw;
            }
            finally
            {
                salesCenter = null;
            }
        }
        public void UpdateSalesCenterActivation(string salesCenterId, string activationStatus)
        {
            SalesCenterDAL salesCenter = new SalesCenterDAL();

            try
            {
                LumexDBPlayer db = LumexDBPlayer.Start(true);
                salesCenter.UpdateSalesCenterActivation(salesCenterId, activationStatus, db);
                db.Stop();
            }
            catch (Exception)
            {
                throw;
            }
            finally
            {
                salesCenter = null;
            }
        }
        public bool CheckDuplicateSalesCenter(string salesCenterName)
        {
            SalesCenterDAL salesCenter = new SalesCenterDAL();

            try
            {
                LumexDBPlayer db = LumexDBPlayer.Start();
                bool status = salesCenter.CheckDuplicateSalesCenter(salesCenterName, db);
                db.Stop();
                return status;
            }
            catch (Exception)
            {
                throw;
            }
            finally
            {
                salesCenter = null;
            }
        }
        public DataTable GetUserSalesCentersByUserId(string userId)
        {
            SalesCenterDAL salesCenter = new SalesCenterDAL();

            try
            {
                LumexDBPlayer db = LumexDBPlayer.Start();
                DataTable dt = salesCenter.GetUserSalesCentersByUserId(userId, db);
                db.Stop();

                return dt;
            }
            catch (Exception)
            {
                throw;
            }
            finally
            {
                salesCenter = null;
            }
        }
        public DataTable GetDeletedSalesCenterListByDateRangeAll(string fromDate, string toDate, string search)
        {
            SalesCenterDAL salesCenter = new SalesCenterDAL();

            try
            {
                LumexDBPlayer db = LumexDBPlayer.Start();
                DataTable dt = salesCenter.GetDeletedSalesCenterListByDateRangeAll(fromDate, toDate, search, db);
                db.Stop();

                return dt;
            }
            catch (Exception)
            {
                throw;
            }
            finally
            {
                salesCenter = null;
            }
        }