public async Task <IActionResult> Create([Bind("IdEvento,nombre,musica,decoracion,catering,tipo")] Evento evento)
        {
            if (ModelState.IsValid)
            {
                _context.Add(evento);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(evento));
        }
Exemplo n.º 2
0
        public async Task <IActionResult> Create([Bind("IdPresupuesto,nombreCliente,cantInvitados,fecha,comentario,mail,telefono")] Presupuesto presupuesto)
        {
            if (ModelState.IsValid)
            {
                _context.Add(presupuesto);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(presupuesto));
        }
        public async Task <IActionResult> Create([Bind("IdCliente,nombre,mail,telefono,cuit,direccion,pass,user")] Cliente cliente)
        {
            if (ModelState.IsValid)
            {
                _context.Add(cliente);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(cliente));
        }
        public async Task <IActionResult> Create([Bind("IdReserva,cantInvitados,fecha,CurrentIdEvento,CurrentIdCliente")] Reserva reserva)
        {
            if (ModelState.IsValid)
            {
                _context.Add(reserva);
                await _context.SaveChangesAsync();

                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));
        }