示例#1
0
        public ResponseModel UpdateMailSettings(MailSettings updObj)
        {
            ResponseModel result = new ResponseModel();

            result = ValidateUpdateMailSettings(updObj);

            if (!result.IsSuccess)
            {
                return(result);
            }

            bool value = _mailRepo.Update(updObj);

            result.IsSuccess = value;

            if (updObj.ApproveSendMailNewUser)
            {
                var sms_ = _smsRepo.GetAll().FirstOrDefault();
                sms_.RequiredIsRegister = false;
                _smsRepo.Update(sms_);
            }

            if (result.IsSuccess)
            {
                result.Message = "Bilgiler başarı ile güncellendi!";
            }
            StaticSettings.ReloadSettings();
            return(result);
        }
示例#2
0
        public bool IsRequiredRegisterSmsSendClient()
        {
            var smsSettings = smsRepo.GetAll().FirstOrDefault();

            return(smsSettings.RequiredIsRegister);
        }
        public static void ReloadSettings()
        {
            SiteSettings = _siteRepo.GetAll().FirstOrDefault();
            MailSettings = _mailRepo.GetAll().FirstOrDefault();
            SmsSettings  = _smsRepo.GetAll().FirstOrDefault();
            LastComments = _commentRepo.GetByCustomQuery("select * from Comments where IsPublish = 1 order by ID desc", null).ToList();
            ContentViews = _contentRepo.GetPublishedViewList();
            Writers      = _userRepo.GetByCustomQuery("select * from Users where (select COUNT(*) from UserRoleRels ur where ur.RoleID = 2) > 0 and IsActive = 1 and IsApproved = 1", null).ToList();

            Categories = _catRepo.GetByCustomQuery("select * from Categories where IsActive = 1", null).ToList();

            StaticPages = _staticRepo.GetAll();

            MainPageSetting = _mainRepo.GetAll().FirstOrDefault();

            MainPageSliders = _sliderRepo.GetAll();

            if (LastComments == null)
            {
                LastComments = new List <Comments>();
            }

            if (SiteSettings == null)
            {
                SiteSettings = new SiteSettings();
            }
            if (MailSettings == null)
            {
                MailSettings = new MailSettings();
            }
            if (SmsSettings == null)
            {
                SmsSettings = new SmsSettings();
            }

            if (ContentViews == null)
            {
                ContentViews = new List <ContentViewListModel>();
            }

            if (Writers == null)
            {
                Writers = new List <Users>();
            }

            if (Categories == null)
            {
                Categories = new List <Categories>();
            }

            if (StaticPages == null)
            {
                StaticPages = new List <StaticPages>();
            }

            if (MainPageSetting == null)
            {
                MainPageSetting = new MainPageSettings();
            }

            if (MainPageSliders == null)
            {
                MainPageSliders = new List <MainSliderSettings>();
            }
        }