public JsonResult SaveSystem(SystemSettingsModel data) { if (ModelState.IsValid) { _configFileProvider.Port = data.Port; _configFileProvider.LaunchBrowser = data.LaunchBrowser; _configFileProvider.AuthenticationType = data.AuthenticationType; _configProvider.RecycleBin = data.RecycleBin; return GetSuccessResult(); } return GetInvalidModelResult(); }
public ActionResult System() { var selectedAuthenticationType = _configFileProvider.AuthenticationType; var authenticationTypes = new List<AuthenticationType>(); foreach (AuthenticationType authenticationType in Enum.GetValues(typeof(AuthenticationType))) { authenticationTypes.Add(authenticationType); } var authTypeSelectList = new SelectList(authenticationTypes, selectedAuthenticationType); var model = new SystemSettingsModel(); model.Port = _configFileProvider.Port; model.LaunchBrowser = _configFileProvider.LaunchBrowser; model.AuthenticationType = selectedAuthenticationType; model.AuthTypeSelectList = authTypeSelectList; model.RecycleBin = _configProvider.RecycleBin; return View(model); }