Example #1
0
 public virtual void Delete(TEntity entityToDelete)
 {
     if (context.Entry(entityToDelete).State == EntityState.Detached)
     {
         dbSet.Attach(entityToDelete);
     }
     dbSet.Remove(entityToDelete);
 }
 public ActionResult EditRestaurante([Bind(Include = "IdRestaurante,Nombre,Telefono,Logo,Tipo")] Restaurante restaurante)
 {
     if (ModelState.IsValid)
     {
         db.Entry(restaurante).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(restaurante));
 }
 public ActionResult Edit([Bind(Include = "IdComboRestaurante,IdRestaurante,Nombre,Descripcion,Precio,Imagen")] ComboRestaurante comboRestaurante)
 {
     if (ModelState.IsValid)
     {
         db.Entry(comboRestaurante).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.IdRestaurante = new SelectList(db.Restaurantes, "IdRestaurante", "Nombre", comboRestaurante.IdRestaurante);
     return(View(comboRestaurante));
 }
Example #4
0
 public ActionResult Edit([Bind(Include = "IdUsuario,Nombre,Password,IdRestaurante,IsAdmin")] Usuario usuario)
 {
     if (ModelState.IsValid)
     {
         db.Entry(usuario).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.IdRestaurante = new SelectList(db.Restaurantes, "IdRestaurante", "Nombre", usuario.IdRestaurante);
     return(View(usuario));
 }
Example #5
0
 public void UpdateRestaurante(Restaurante restaurante)
 {
     context.Entry(restaurante).State = EntityState.Modified;
 }
Example #6
0
 public void UpdateDetallePedido(DetallePedido detallePedido)
 {
     context.Entry(detallePedido).State = EntityState.Modified;
 }
Example #7
0
 public void UpdateComboRestaurante(ComboRestaurante comboRestaurante)
 {
     context.Entry(comboRestaurante).State = EntityState.Modified;
 }
Example #8
0
 public void UpdatePedido(Pedido pedido)
 {
     context.Entry(pedido).State = EntityState.Modified;
 }
Example #9
0
 public void UpdateUsuario(Usuario usuario)
 {
     context.Entry(usuario).State = EntityState.Modified;
 }