public virtual void Delete(T entityToDelete) { if (context.Entry(entityToDelete).State == EntityState.Detached) { dbSet.Attach(entityToDelete); } dbSet.Remove(entityToDelete); }
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)); }
public void Update(Patient entity) { var db = new VetDbContext(); db.Entry(entity).State = EntityState.Modified; db.SaveChanges(); }
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)); }
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)); }
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)); }
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)); }
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)); }
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)); }
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)); }
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)); }