Пример #1
0
        public ActionResult Create(HistorialAgenda historial)
        {
            if (ModelState.IsValid)
            {
                db.HistorialAgenda.Add(historial);
                db.SaveChanges();
                return Content(Boolean.TrueString);
            }

            return PartialView(historial);
        }
Пример #2
0
        //
        // GET: /HistorialAgenda/Create
        public ActionResult Create(int idBebe)
        {
            Bebe bebe = db.Bebes.Find(idBebe);
            HistorialAgenda historial = new HistorialAgenda()
            {
                bebeID = bebe.bebeID,
                bebe = bebe,
                fecha = DateTime.Today
            };

            //ViewBag.bebeID = new SelectList(db.Bebes, "bebeID", "lugarNacimiento");
            return PartialView(historial);
        }
Пример #3
0
 public ActionResult Edit(HistorialAgenda historialagenda)
 {
     if (ModelState.IsValid)
     {
         db.Entry(historialagenda).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     ViewBag.bebeID = new SelectList(db.Bebes, "bebeID", "dni", historialagenda.bebeID);
     return View(historialagenda);
 }