Пример #1
0
        public async Task <IActionResult> Create([Bind("Id,Nombre,RazonSocial,Direccion,RFC,Telefono,Correo,RequiereFactura")] Cliente cliente)
        {
            if (ModelState.IsValid)
            {
                _context.Add(cliente);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(cliente));
        }
Пример #2
0
        public async Task <IActionResult> Create([Bind("Id,Descripcion,Precio,UnidadDeMedida")] Producto producto)
        {
            if (ModelState.IsValid)
            {
                _context.Add(producto);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(producto));
        }
Пример #3
0
        public async Task <IActionResult> Create([Bind("Id,ClineteId,FechaPedido")] Pedido pedido)
        {
            if (ModelState.IsValid)
            {
                _context.Add(pedido);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Details), new { Id = pedido.Id }));
            }
            return(View(pedido));
        }
Пример #4
0
        public async Task <IActionResult> Create([Bind("Id,Nombre,Precio,Desperdicio")] Moldura moldura)
        {
            if (ModelState.IsValid)
            {
                _context.Add(moldura);
                await _context.SaveChangesAsync();

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