Ejemplo n.º 1
0
 public ActionResult Create(Role model)
 {
     if (ModelState.IsValid)
     {
         Adapter.RoleRepository.Insert(model);
         model.CreatedDate = DateTime.UtcNow;
         Adapter.Save();
         return RedirectToAction("Index");
     }
     return View(model);
 }
Ejemplo n.º 2
0
 public ActionResult Edit(Role model)
 {
     if (ModelState.IsValid)
     {
         //GET ORGINAL MODEL
         var modelOrginal = Adapter.RoleRepository.Single(a => a.ID.Equals(model.ID), null);
         //ADD NEW VALUES
         modelOrginal.ModifiedDate = DateTime.UtcNow;
         modelOrginal.Title = model.Title;
         modelOrginal.Description = model.Description;
         Adapter.RoleRepository.Update(modelOrginal);
         Adapter.Save();
         return RedirectToAction("Index");
     }
     return View(model);
 }