Ejemplo n.º 1
0
        public async Task <IActionResult> Create([Bind("InvoiceId,VendorName,Quantity,PurchasePrice,InvoiceDate")] Invoice invoice)
        {
            if (ModelState.IsValid)
            {
                _context.Add(invoice);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(invoice));
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> Create([Bind("ProductId,ProductName,Quantity,DateAdded,VendorName,PurchasePrice,SalePrice,Unit,ExpirationDate")] Product product)
        {
            if (ModelState.IsValid)
            {
                _context.Add(product);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(product));
        }
        public async Task <IActionResult> Create([Bind("CustomerId,FirstName,LastName,CustomerPhone,CustomerEmail")] Customer customer)
        {
            if (ModelState.IsValid)
            {
                _context.Add(customer);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(customer));
        }
Ejemplo n.º 4
0
        public async Task <IActionResult> Create([Bind("VendorId,VendorName,VendorAddress,VendorEmail,VendorPhone")] Vendor vendor)
        {
            if (ModelState.IsValid)
            {
                _context.Add(vendor);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(vendor));
        }
        public async Task <IActionResult> Create([Bind("SaleReceiptId,ReceiptDate,Quantity,SalePrice")] SaleReceipt saleReceipt)
        {
            if (ModelState.IsValid)
            {
                _context.Add(saleReceipt);
                await _context.SaveChangesAsync();

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