public static bool Save(SettingsManagementVM model) { InsideWordSettingsDictionary.Instance.DefaultCategoryId = model.DefaultCategoryId; InsideWordSettingsDictionary.Instance.LogThresholdName = model.LogThresholdName; InsideWordSettingsDictionary.Instance.LogEmailThresholdName = model.LogEmailThresholdName; InsideWordWebLog.Instance.IWThreshold = InsideWordWebLog.Instance.Log.Logger.Repository.LevelMap[model.LogThresholdName]; InsideWordWebLog.Instance.IWSmtpThreshold = InsideWordWebLog.Instance.Log.Logger.Repository.LevelMap[model.LogEmailThresholdName]; return true; }
public virtual ActionResult SettingsManagement(SettingsManagementVM model) { ActionResult returnValue = null; ProviderCurrentMember currentMember = ProviderCurrentMember.Instance; // Validate that the model is fine first and foremost to make sure we're not trying to work with bad data if (ModelState.IsValid) { if (!currentMember.CanEdit(InsideWordSettingsDictionary.Instance)) { returnValue = RedirectToAction(MVC.Error.Index(401)); } else if (AdminBL.Save(model)) { returnValue = RedirectToAction(MVC.Admin.SettingsManagement()); } } if (returnValue == null) { model.Refresh(ProviderCategory.Root.Children(), InsideWordWebLog.Instance); returnValue = View(model); } return returnValue; }