コード例 #1
0
ファイル: AdminController.cs プロジェクト: reloar/PA
 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));
     }
 }