Esempio n. 1
0
 public virtual void Delete(T entityToDelete)
 {
     if (context.Entry(entityToDelete).State == EntityState.Detached)
     {
         dbSet.Attach(entityToDelete);
     }
     dbSet.Remove(entityToDelete);
 }
Esempio n. 2
0
 public ActionResult Edit([Bind(Include = "Id,TipoEspecialidad,Fecha,IdPaciente,IdAtencion,Hora,Abonado")] Turno turno)
 {
     if (ModelState.IsValid)
     {
         db.Entry(turno).State = EntityState.Modified;
         db.SaveChanges();
         log.Info("Edicion de turno");
         return(RedirectToAction("Index"));
     }
     ViewBag.IdAtencion = new SelectList(db.Atenciones, "Id", "Id", turno.IdAtencion);
     ViewBag.IdPaciente = new SelectList(db.Pacientes, "Id", "Nombre", turno.IdPaciente);
     return(View(turno));
 }
Esempio n. 3
0
        public void Update(Patient entity)
        {
            var db = new VetDbContext();

            db.Entry(entity).State = EntityState.Modified;
            db.SaveChanges();
        }
Esempio n. 4
0
 public ActionResult Edit([Bind(Include = "Id,Nombre,Precio")] Producto producto)
 {
     if (ModelState.IsValid)
     {
         db.Entry(producto).State = EntityState.Modified;
         db.SaveChanges();
         log.Info("Edicion de producto");
         return(RedirectToAction("Index"));
     }
     return(View(producto));
 }
Esempio n. 5
0
 public ActionResult Edit([Bind(Include = "Id,Nombre,Email,TipoEspecialidad,Telefono,Direccion")] Doctor doctor)
 {
     if (ModelState.IsValid)
     {
         db.Entry(doctor).State = EntityState.Modified;
         db.SaveChanges();
         log.Info("Edicion de doctor");
         return(RedirectToAction("Index"));
     }
     return(View(doctor));
 }
Esempio n. 6
0
 public ActionResult Edit([Bind(Include = "Id,NombreCompleto,Email,Direccion,Dni,Telefono")] Cliente cliente)
 {
     if (ModelState.IsValid)
     {
         db.Entry(cliente).State = EntityState.Modified;
         db.SaveChanges();
         log.Info("Edicion de cliente");
         return(RedirectToAction("Index"));
     }
     return(View(cliente));
 }
Esempio n. 7
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));
 }
 public ActionResult Edit([Bind(Include = "Id,IdTurno,Fecha,Monto")] FacturaServicio facturaServicio)
 {
     if (ModelState.IsValid)
     {
         db.Entry(facturaServicio).State = EntityState.Modified;
         db.SaveChanges();
         log.Info("Edicion de Factura servicio");
         return(RedirectToAction("Index"));
     }
     ViewBag.IdTurno = new SelectList(db.Turnos, "Id", "Id", facturaServicio.IdTurno);
     return(View(facturaServicio));
 }
Esempio n. 9
0
 public ActionResult Edit([Bind(Include = "Id,Nombre,Localizacion")] Sala sala)
 {
     if (ModelState.IsValid)
     {
         db.Entry(sala).State = EntityState.Modified;
         db.SaveChanges();
         string dato;
         log.Info(string.Format("Edicion de una sala / {0} / {1} / {2}", sala.Id, sala.Localizacion, sala.Nombre));
         return(RedirectToAction("Index"));
     }
     return(View(sala));
 }
Esempio n. 10
0
 public ActionResult Edit([Bind(Include = "Id,IdDoctor,IdSala,TipoEspecialidad,HorarioTurno,Dia")] Atencion atencion)
 {
     if (ModelState.IsValid)
     {
         db.Entry(atencion).State = EntityState.Modified;
         db.SaveChanges();
         log.Info("Edicion de atencion");
         return(RedirectToAction("Index"));
     }
     ViewBag.IdDoctor = new SelectList(db.Doctores, "Id", "Nombre", atencion.IdDoctor);
     ViewBag.IdSala   = new SelectList(db.Salas, "Id", "Nombre", atencion.IdSala);
     return(View(atencion));
 }
Esempio n. 11
0
 public ActionResult Edit([Bind(Include = "Id,IdCliente,IdProducto,Cantidad,Fecha,Monto")] FacturaProducto facturaProducto)
 {
     if (ModelState.IsValid)
     {
         db.Entry(facturaProducto).State = EntityState.Modified;
         db.SaveChanges();
         log.Info("Edicion de factura producto");
         return(RedirectToAction("Index"));
     }
     ViewBag.IdCliente  = new SelectList(db.Clientes, "Id", "NombreCompleto", facturaProducto.IdCliente);
     ViewBag.IdProducto = new SelectList(db.Productos, "Id", "Nombre", facturaProducto.IdProducto);
     return(View(facturaProducto));
 }
Esempio n. 12
0
 public ActionResult Edit([Bind(Include = "Id,ClientId,Genero,Nombre,Raza,TipodeSangre")] Paciente paciente, HttpPostedFileBase ImagenMascota)
 {
     if (ImagenMascota != null && ImagenMascota.ContentLength > 0)
     {
         byte[] imagendata = null;
         using (var binarypaciente = new BinaryReader(ImagenMascota.InputStream))
         {
             imagendata = binarypaciente.ReadBytes(ImagenMascota.ContentLength);
         }
         paciente.ImagenMascota = imagendata;
     }
     if (ModelState.IsValid)
     {
         db.Entry(paciente).State = EntityState.Modified;
         db.SaveChanges();
         log.Info("Edicion de paciente");
         return(RedirectToAction("Index"));
     }
     ViewBag.ClientId = new SelectList(db.Clientes, "Id", "NombreCompleto", paciente.ClientId);
     return(View(paciente));
 }