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

                return(RedirectToAction(nameof(Index)));
            }
            return(View(categoria));
        }
        public async Task <IActionResult> Create([Bind("SalesPersonID,FirstName,LastName,Phone,HireDate,Active")] SalesPerson salesPerson)
        {
            if (ModelState.IsValid)
            {
                _context.Add(salesPerson);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(salesPerson));
        }
        public async Task <IActionResult> Create([Bind("SaskiaId")] Saskia saskia)
        {
            if (ModelState.IsValid)
            {
                _context.Add(saskia);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(saskia));
        }
Esempio n. 4
0
        public async Task <IActionResult> Create([Bind("ProductID,Name,Description,StandardPrice,UnityType,OnHand,Ordered,BackOrdered")] Product product)
        {
            if (ModelState.IsValid)
            {
                _context.Add(product);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(product));
        }
Esempio n. 5
0
        public async Task <IActionResult> Create([Bind("idLinea,idPedido,idProducto,numlineas,unidades,precio")] Linea linea)
        {
            if (ModelState.IsValid)
            {
                _context.Add(linea);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(linea));
        }
Esempio n. 6
0
        public async Task <IActionResult> Create([Bind("idProductos,Marcaid,Categoriaid,descripcion,precio,precioTotal,imagen,Eskaintza,Deskontua")] Producto producto)
        {
            if (ModelState.IsValid)
            {
                _context.Add(producto);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["Categoriaid"] = new SelectList(_context.Categoria, "id", "id", producto.Categoriaid);
            ViewData["Marcaid"]     = new SelectList(_context.Marcas, "id", "id", producto.Marcaid);
            return(View(producto));
        }