Ejemplo n.º 1
0
        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));
            }
        }
Ejemplo n.º 2
0
        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));
        }
Ejemplo n.º 3
0
 protected override Award GetResource(string id)
 {
     return(Awards.Get(id));
 }