Esempio n. 1
0
        public virtual ActionResult Edit(string id, TemplateEditModel t)
        {
            var x = Templates.Get(id);

            if (!ModelState.IsValid)
            {
                return(View(t));
            }
            try
            {
                t.Apply(x);
                Templates.Save(x);
                return(this.RedirectToAction(c => c.Index()));
            }
            catch (Exception ex)
            {
                Notifier.Notify(ex);
                return(View(t));
            }
        }
Esempio n. 2
0
 public virtual ActionResult Edit(string id)
 {
     return(View(TemplateEditModel.FromDomain(Templates.Get(id))));
 }
 public virtual ActionResult Edit(string id, TemplateEditModel t)
 {
     var x = Templates.Get(id);
     if (!ModelState.IsValid)
     {
         return View(t);
     }
     try
     {
         t.Apply(x);
         Templates.Save(x);
         return this.RedirectToAction(c => c.Index());
     }
     catch (Exception ex)
     {
         Notifier.Notify(ex);
         return View(t);
     }
 }