protected ActionResult EditSettingsBase(UserSettingsEditViewModel model) { if (ModelState.IsValid) { if ((model.NewRunOrderNo != null) && (model.NewRunPrdnTypeID != null)) { ProductionRun newRun = MakeProductionNewRun(model.NewRunOrderNo, (decimal)model.NewRunPrdnTypeID, model.NewRunNote); model.DefaultRunID = newRun.ID; } decimal? oldDefRnID = null; UpdateUserSettings(model.UserID, settings => { oldDefRnID = settings.DefaultRunID; Mapper.Map(model, settings); }); if (model.DefaultRunID != oldDefRnID) { return RedirectIfNewRunID(model.urlReturn, model.DefaultRunID); } return RedirectIfLocal(model.urlReturn, () => RedirectToAction("Index", "Home")); } return View(model); }
public virtual ActionResult EditSettings(UserSettingsEditViewModel model) { return EditSettingsBase(model); }