Ejemplo n.º 1
0
        public async Task<ActionResult> SettingsUpdate(Setting setting)
        {
            var settingExisting = _settingService.Queryable().FirstOrDefault();

            settingExisting.Name = setting.Name;
            settingExisting.Description = setting.Description;
            settingExisting.Slogan = setting.Slogan;
            settingExisting.SearchPlaceHolder = setting.SearchPlaceHolder;

            settingExisting.EmailContact = setting.EmailContact;
            settingExisting.EmailConfirmedRequired = setting.EmailConfirmedRequired;

            settingExisting.Currency = setting.Currency;

            settingExisting.AgreementRequired = setting.AgreementRequired;
            settingExisting.AgreementLabel = setting.AgreementLabel;
            settingExisting.AgreementText = setting.AgreementText;
            settingExisting.SignupText = setting.SignupText;

            settingExisting.Theme = setting.Theme;

            settingExisting.DateFormat = setting.DateFormat;
            settingExisting.TimeFormat = setting.TimeFormat;

            settingExisting.ListingReviewEnabled = setting.ListingReviewEnabled;
            settingExisting.ListingReviewMaxPerDay = setting.ListingReviewMaxPerDay;

            settingExisting.LastUpdated = setting.LastUpdated;
            settingExisting.ObjectState = Repository.Pattern.Infrastructure.ObjectState.Modified;

            _settingService.Update(settingExisting);

            await _unitOfWorkAsync.SaveChangesAsync();

            _dataCacheService.UpdateCache(CacheKeys.Settings, settingExisting);

            return RedirectToAction("Settings");
        }
Ejemplo n.º 2
0
        public async Task<ActionResult> SettingsEmailUpdate(Setting setting)
        {
            var settingExisting = _settingService.Queryable().FirstOrDefault();

            settingExisting.SmtpHost = setting.SmtpHost;
            settingExisting.SmtpPassword = setting.SmtpPassword;
            settingExisting.SmtpPort = setting.SmtpPort;
            settingExisting.SmtpUserName = setting.SmtpUserName;
            settingExisting.SmtpPassword = setting.SmtpPassword;
            settingExisting.SmtpSSL = setting.SmtpSSL;
            settingExisting.EmailDisplayName = setting.EmailDisplayName;
            settingExisting.EmailAddress = setting.EmailAddress;

            settingExisting.ObjectState = Repository.Pattern.Infrastructure.ObjectState.Modified;

            _settingService.Update(settingExisting);

            await _unitOfWorkAsync.SaveChangesAsync();

            _dataCacheService.UpdateCache(CacheKeys.Settings, settingExisting);

            return RedirectToAction("SettingsEmail");
        }