예제 #1
0
 public ActionResult Create(RoleViewModel rol)
 {
     if (ModelState.IsValid)
     {
         service.Create(rol.ToDTORole());
         return RedirectToAction("Index");
     }
     else
     {
         return View("Create", rol);
     }
 }
예제 #2
0
          public ActionResult Edit(RoleViewModel collection)
          {
              if (ModelState.IsValid)
              {
                  try
                  {
                      service.Update(collection.ToDTORole());

                      return RedirectToAction("Index");
                  }
                  catch
                  {
                      return View();
                  }
              }
              else
              {
                  return View("Edit", collection);
              }
          }