public ActionResult _About() { var abouts = db.Abouts.ToList(); if (abouts.Count == 0) { About about = new About(); about.nombre = "Tania González Cabello"; about.descripcion = "Oriunda de Licantén, Piloto Oficial TM Racing - Imoto"; abouts.Add(about); } return View(abouts); }
public ActionResult Editar(About about) { try { if (ModelState.IsValid) { db.Entry(about).State = EntityState.Modified; db.SaveChanges(); } return RedirectToAction("Index"); } catch (Exception ex) { TempData["Error"] = ex.Message; return View("Error"); } }
public ActionResult Agregar(About about) { try { if (ModelState.IsValid) { db.Abouts.Add(about); db.SaveChanges(); } return RedirectToAction("Index"); } catch (Exception ex) { TempData["Error"] = ex.Message; return View("Error"); } }
public ActionResult Agregar() { About about = new About(); return View(about); }