Пример #1
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,FechaCreacion,FechaPedido,Tipo,Cliente,Usuario")] Pedido pedido)
        {
            if (id != pedido.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(pedido);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!PedidoExists(pedido.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["Cliente"] = new SelectList(_context.Cliente, "Id", "Nombre", pedido.Cliente);
            ViewData["Tipo"]    = new SelectList(_context.TipoPedido, "Id", "Descripcion", pedido.Tipo);
            ViewData["Usuario"] = new SelectList(_context.Usuario, "Id", "Nombre", pedido.Usuario);
            return(View(pedido));
        }
Пример #2
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,Nombre,Tipo")] Plato plato)
        {
            if (id != plato.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(plato);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!PlatoExists(plato.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["Tipo"] = new SelectList(_context.TipoPlato, "Id", "Descripcion", plato.Tipo);
            return(View(plato));
        }
        public async Task <IActionResult> Edit(int id, [Bind("Id,Descripcion")] TipoPedido tipoPedido)
        {
            if (id != tipoPedido.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(tipoPedido);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!TipoPedidoExists(tipoPedido.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(tipoPedido));
        }
Пример #4
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,Nombre")] Mesero mesero)
        {
            if (id != mesero.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(mesero);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!MeseroExists(mesero.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(mesero));
        }
Пример #5
0
        public async Task <IActionResult> Edit(int id, [Bind("Pedido,Mesero,Cantidad")] Horario horario)
        {
            if (id != horario.Pedido)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(horario);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!HorarioExists(horario.Pedido))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["Mesero"] = new SelectList(_context.Mesero, "Id", "Id", horario.Mesero);
            ViewData["Pedido"] = new SelectList(_context.Pedido, "Id", "Id", horario.Pedido);
            return(View(horario));
        }
        public async Task <IActionResult> Edit(int id, [Bind("Plato,Servicio,Menu,Dia")] PlatoServicio platoServicio)
        {
            if (id != platoServicio.Plato)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(platoServicio);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!PlatoServicioExists(platoServicio.Plato))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["Menu"]     = new SelectList(_context.Menu, "Id", "Id", platoServicio.Menu);
            ViewData["Plato"]    = new SelectList(_context.Plato, "Id", "Id", platoServicio.Plato);
            ViewData["Servicio"] = new SelectList(_context.Servicio, "Id", "Id", platoServicio.Servicio);
            return(View(platoServicio));
        }
        public async Task <IActionResult> Edit(int id, [Bind("Pedido,Menu")] PedidoMenus pedidoMenus)
        {
            if (id != pedidoMenus.Pedido)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(pedidoMenus);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!PedidoMenusExists(pedidoMenus.Pedido))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["Menu"]   = new SelectList(_context.Menu, "Id", "Id", pedidoMenus.Menu);
            ViewData["Pedido"] = new SelectList(_context.Pedido, "Id", "Id", pedidoMenus.Pedido);
            return(View(pedidoMenus));
        }
Пример #8
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,Identificacion,Nombre,Encargado,Telefono,Email,Direccion,Tipo")] Cliente cliente)
        {
            if (id != cliente.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(cliente);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ClienteExists(cliente.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["Tipo"] = new SelectList(_context.TipoCliente, "Id", "Descripcion", cliente.Tipo);
            return(View(cliente));
        }