Example #1
0
        public ActionResult Edit(ROL rol)
        {
            if (ModelState.IsValid) {
                rolRepository.InsertOrUpdate(rol);
                rolRepository.Save();
                return RedirectToAction("Index");
            } else {
				return View();
			}
        }
Example #2
0
 public void InsertOrUpdate(ROL rol)
 {
     if (rol.ID == default(int)) {
         // New entity
         context.ROL.Add(rol);
     } else {
         // Existing entity
         context.Entry(rol).State = System.Data.Entity.EntityState.Modified;
     }
 }