public async Task <IActionResult> Edit(int id, [Bind("IdEvento,nombre,musica,decoracion,catering,tipo")] Evento evento)
        {
            if (id != evento.IdEvento)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(evento);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!EventoExists(evento.IdEvento))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(evento));
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> Edit(int id, [Bind("IdPresupuesto,nombreCliente,cantInvitados,fecha,comentario,mail,telefono")] Presupuesto presupuesto)
        {
            if (id != presupuesto.IdPresupuesto)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(presupuesto);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!PresupuestoExists(presupuesto.IdPresupuesto))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(presupuesto));
        }
        public async Task <IActionResult> Edit(int id, [Bind("IdCliente,nombre,mail,telefono,cuit,direccion,pass,user")] Cliente cliente)
        {
            if (id != cliente.IdCliente)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(cliente);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ClienteExists(cliente.IdCliente))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(cliente));
        }
        public async Task <IActionResult> Edit(int id, [Bind("IdReserva,cantInvitados,fecha,CurrentIdEvento,CurrentIdCliente")] Reserva reserva)
        {
            if (id != reserva.IdReserva)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(reserva);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ReservaExists(reserva.IdReserva))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["CurrentIdCliente"] = new SelectList(_context.Clientes, "IdCliente", "nombre", reserva.CurrentIdCliente);
            ViewData["CurrentIdEvento"]  = new SelectList(_context.Eventos, "IdEvento", "nombre", reserva.CurrentIdEvento);
            return(View(reserva));
        }