コード例 #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            HistorialPaciente historialPaciente = db.HistorialPacientes.Find(id);

            db.HistorialPacientes.Remove(historialPaciente);
            db.SaveChanges();
            log.Info("Eliminacion de historial de paciente");
            return(RedirectToAction("Index"));
        }
コード例 #2
0
 public ActionResult Edit([Bind(Include = "Id,IdPaciente,Descripcion,Fecha")] HistorialPaciente historialPaciente)
 {
     if (ModelState.IsValid)
     {
         db.Entry(historialPaciente).State = EntityState.Modified;
         db.SaveChanges();
         log.Info("Edicion de historial de paciente");
         return(RedirectToAction("Index"));
     }
     ViewBag.IdPaciente = new SelectList(db.Pacientes, "Id", "Nombre", historialPaciente.IdPaciente);
     return(View(historialPaciente));
 }
コード例 #3
0
        public ActionResult Create([Bind(Include = "Id,IdPaciente,Descripcion,Fecha")] HistorialPaciente historialPaciente)
        {
            if (ModelState.IsValid)
            {
                historialPaciente.Fecha = DateTime.Now;
                db.HistorialPacientes.Add(historialPaciente);
                db.SaveChanges();
                log.Info("Creacion de historial de paciente");
                return(RedirectToAction("Index"));
            }

            ViewBag.IdPaciente = new SelectList(db.Pacientes, "Id", "Nombre", historialPaciente.IdPaciente);
            return(View(historialPaciente));
        }
コード例 #4
0
        // GET: HistorialPaciente/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            HistorialPaciente historialPaciente = db.HistorialPacientes.Find(id);

            if (historialPaciente == null)
            {
                return(HttpNotFound());
            }
            return(View(historialPaciente));
        }
コード例 #5
0
        // GET: HistorialPaciente/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            HistorialPaciente historialPaciente = db.HistorialPacientes.Find(id);

            if (historialPaciente == null)
            {
                return(HttpNotFound());
            }
            ViewBag.IdPaciente = new SelectList(db.Pacientes, "Id", "Nombre", historialPaciente.IdPaciente);
            return(View(historialPaciente));
        }