Esempio n. 1
0
        public async Task <IActionResult> Create([Bind("Id,Nombre")] Cliente cliente)
        {
            if (ModelState.IsValid)
            {
                _context.Add(cliente);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(cliente));
        }
Esempio n. 2
0
        public async Task <IActionResult> Create([Bind("Id,Precio,FechaAdquisicion,ModeloId")] Auto auto)
        {
            if (ModelState.IsValid)
            {
                _context.Add(auto);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(auto));
        }
Esempio n. 3
0
        public async Task <IActionResult> Create([Bind("Id,Nombre,Sueldo,PorcentajeComision")] Vendedor vendedor)
        {
            if (ModelState.IsValid)
            {
                _context.Add(vendedor);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(vendedor));
        }
Esempio n. 4
0
        public async Task <IActionResult> Create([Bind("Id,Nombre,Descripcion,MarcaId")] Modelo modelo)
        {
            if (ModelState.IsValid)
            {
                _context.Add(modelo);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(modelo));
        }
Esempio n. 5
0
        public async Task <IActionResult> Create([Bind("Id,Fecha,AutoId,ClienteId,VendedorId")] Venta venta)
        {
            if (ModelState.IsValid)
            {
                _context.Add(venta);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(venta));
        }