Beispiel #1
0
 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);
 }
Beispiel #2
0
 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");
     }
 }
Beispiel #3
0
        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");
            }
        }
Beispiel #4
0
 public ActionResult Agregar()
 {
     About about = new About();
     return View(about);
 }