Ejemplo n.º 1
0
        public IHttpActionResult PutPatient(Guid id, Patient patient)
        {
            if (id != patient.Id)
            {
                return(BadRequest());
            }

            db.Entry(patient).State = EntityState.Modified;

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException ex)
            {
                if (!PatientExists(id))
                {
                    return(StatusCode(HttpStatusCode.InternalServerError));
                }
                else
                {
                    throw ex;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }
 public ActionResult Edit([Bind(Include = "id,nombre")] tb_tipo_documento tb_tipo_documento)
 {
     if (ModelState.IsValid)
     {
         db.Entry(tb_tipo_documento).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(tb_tipo_documento));
 }
 public ActionResult Edit([Bind(Include = "id,cedula,nombre,apellido,telefono,correo,tipoDocumento")] tb_paciente tb_paciente)
 {
     if (ModelState.IsValid)
     {
         db.Entry(tb_paciente).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.tipoDocumento = new SelectList(db.tb_tipo_documento, "id", "nombre", tb_paciente.tipoDocumento);
     return(View(tb_paciente));
 }
 public ActionResult Edit([Bind(Include = "id,descripcion,doctorId,pacienteId,tipoCita,fecha,hora,duracion")] tb_cita tb_cita)
 {
     if (ModelState.IsValid)
     {
         db.Entry(tb_cita).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.doctorId   = new SelectList(db.tb_doctor, "id", "cedula", tb_cita.doctorId);
     ViewBag.pacienteId = new SelectList(db.tb_paciente, "id", "cedula", tb_cita.pacienteId);
     ViewBag.tipoCita   = new SelectList(db.tb_tipo_cita, "id", "nombre", tb_cita.tipoCita);
     return(View(tb_cita));
 }
Ejemplo n.º 5
0
 public ActionResult EditDoctor([Bind(Include = "Doctor_ID,Name_Title,FirstName,LastName,Department, Education, Phone_Number, Email, Address, Salary, JoiningDate")] Doctor DoctorRecord)
 {
     try
     {
         if (ModelState.IsValid)
         {
             db.Entry(DoctorRecord).State = System.Data.Entity.EntityState.Modified;
             db.SaveChanges();
             return(RedirectToAction("Index"));
         }
         return(View(DoctorRecord));
     }
     catch
     {
         return(RedirectToRoute("~/Shared/Error"));
     }
 }