Example #1
0
 public ActionResult Agregar(Logro logro)
 {
     try
     {
         if (ModelState.IsValid)
         {
             db.Logros.Add(logro);
             db.SaveChanges();
         }
         return RedirectToAction("Index");
     }
     catch (Exception ex)
     {
         TempData["Error"] = ex.Message;
         return View("Error");
     }
 }
Example #2
0
 public ActionResult Editar(Logro logro)
 {
     try
     {
         if (ModelState.IsValid)
         {
             db.Entry(logro).State = EntityState.Modified;
             db.SaveChanges();
         }
         return RedirectToAction("Index");
     }
     catch (Exception ex)
     {
         TempData["Error"] = ex.Message;
         return View("Error");
     }
 }
Example #3
0
 public ActionResult Agregar()
 {
     Logro logro = new Logro();
     return View(logro);
 }