public virtual ActionResult Edit(string id, AwardEditModel a) { var x = Awards.Get(id); if (!ModelState.IsValid) { return(View(a)); } try { a.Apply(x, Accounting); Awards.Save(x); return(this.RedirectToAction(c => c.Index())); } catch (Exception ex) { ViewData["groups"] = GroupSummaries; ViewData["users"] = UserSummaries[ (a.Availability.Users ?? new string[0]).Union( a.NomineeUsers ?? new string[0]) ]; Notifier.Notify(ex); return(View(x)); } }
public virtual ActionResult Edit(string id) { var model = AwardEditModel.FromDomain(Awards.Get(id), Accounting); ViewData["groups"] = GroupSummaries; ViewData["users"] = UserSummaries[ (model.Availability.Users ?? new string[0]).Union( model.NomineeUsers ?? new string[0]) ]; return(View(model)); }
protected override Award GetResource(string id) { return(Awards.Get(id)); }