コード例 #1
0
        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);
        }
コード例 #2
0
 public virtual ActionResult EditSettings(UserSettingsEditViewModel model)
 {
     return EditSettingsBase(model);
 }