Exemplo n.º 1
0
        public ActionResult Manage()
        {
            var model = new MainSettingsModel()
                {
                    ContactEmailAddress = _settingReads.GetStringValueForSettingType(LayersCmsSettingType.ContactEmailAddress),
                    ContactPhoneNumber = _settingReads.GetStringValueForSettingType(LayersCmsSettingType.ContactTelephoneNumber),
                    GoogleAnalyticsAccountId = _settingReads.GetStringValueForSettingType(LayersCmsSettingType.GoogleAnalyticsAccountId)
                };

            return View(model);
        }
Exemplo n.º 2
0
        public ActionResult Manage(MainSettingsModel model)
        {
            if (ModelState.IsValid)
            {
                // Save every setting
                _settingWrites.InsertOrUpdateByType(LayersCmsSettingType.ContactEmailAddress, model.ContactEmailAddress);
                _settingWrites.InsertOrUpdateByType(LayersCmsSettingType.ContactTelephoneNumber, model.ContactPhoneNumber);
                _settingWrites.InsertOrUpdateByType(LayersCmsSettingType.GoogleAnalyticsAccountId, model.GoogleAnalyticsAccountId);

                // Set the saved successfully flag to display a success message
                model.SavedSuccessfully = true;
            }

            // Show the view again
            return View(model);
        }