Exemple #1
0
 public ActionResult EditEventType(EventTypeViewModel scvm)
 {
     if (ModelState.IsValid)
     {
         var eventtype = _uow.Eventtype.Find(sc => scvm.Id == scvm.Id).FirstOrDefault();
         if (eventtype != null)
         {
             eventtype.Name        = scvm.Type;
             eventtype.Description = scvm.Description;
             _uow.Commit();
             TempData["message"] = $"{eventtype.Name} was successfully edited.";
         }
         return(RedirectToAction("EventTypeList"));
     }
     else
     {
         return(View(scvm));
     }
 }