Example #1
0
        public async Task <IActionResult> Post(Programador programador)
        {
            _context.Add(programador);
            await _context.SaveChangesAsync();

            return(Ok(programador.Id));
        }
        public async Task <IActionResult> Create([Bind("id,patente,km,anioFab,modelo,precio,ClienteId")] Auto auto)
        {
            if (ModelState.IsValid)
            {
                _context.Add(auto);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(auto));
        }
Example #3
0
        public async Task <IActionResult> Create([Bind("id,nombre,apellido,dni")] Cliente cliente)
        {
            if (ModelState.IsValid)
            {
                _context.Add(cliente);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(cliente));
        }
Example #4
0
        public async Task <IActionResult> Create([Bind("idFactura,tipoFactura,importe,ClienteId")] Factura factura)
        {
            if (factura.importe < 0)
            {
                return(ViewBag.ShowAlert);
            }
            if (ModelState.IsValid)
            {
                _context.Add(factura);
                await _context.SaveChangesAsync();

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