/// <summary> /// Gets the specified access model. /// </summary> /// <param name="id">The access id</param> /// <returns>The model</returns> public static ParamEditModel GetById(Guid id) { ParamEditModel m = new ParamEditModel() ; m.Param = SysParam.GetSingle(id) ; return m ; }
/// <summary> /// Gets the specified access model. /// </summary> /// <param name="id">The access id</param> /// <returns>The model</returns> public static ParamEditModel GetById(Guid id) { ParamEditModel m = new ParamEditModel(); m.Param = SysParam.GetSingle(id); return(m); }
public ActionResult Param(ParamEditModel pm) { if (pm.Param.IsNew) ViewBag.Title = Piranha.Resources.Settings.EditTitleNewParam ; else ViewBag.Title = Piranha.Resources.Settings.EditTitleExistingParam ; if (ModelState.IsValid) { try { if (pm.SaveAll()) { ModelState.Clear() ; ViewBag.Title = Piranha.Resources.Settings.EditTitleExistingParam ; SuccessMessage(Piranha.Resources.Settings.MessageParamSaved) ; } else ErrorMessage(Piranha.Resources.Settings.MessageParamNotSaved) ; } catch (Exception e) { ErrorMessage(e.ToString()) ; } } return View(@"~/Areas/Manager/Views/Settings/Param.cshtml", pm) ; }