Example #1
0
        public async Task <IActionResult> Create([Bind("ProductId,Name,Description,Weight,Barcode,Price")] Product product)
        {
            if (ModelState.IsValid)
            {
                _context.Add(product);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(product));
        }
Example #2
0
        public async Task <IActionResult> CreateConfirmation([Bind("ClientId,Name,Address,Bulstat,RegisteredVat,Mol")] Client client)
        {
            if (ModelState.IsValid)
            {
                _context.Add(client);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View());
        }
Example #3
0
        public async Task <IActionResult> Create([Bind("SaleId,SaleDate,Invoice")] Sale sale)
        {
            if (ModelState.IsValid)
            {
                _context.Add(sale);
                await _context.SaveChangesAsync();

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