예제 #1
0
        public async Task <IActionResult> Create([Bind("IdOrder,IdCustomer,Date,Time,Price")] Orders orders)
        {
            if (ModelState.IsValid)
            {
                _context.Add(orders);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(orders));
        }
예제 #2
0
        public async Task <IActionResult> Create([Bind("IdItem,Catagory,Name,Url,Price")] Items items)
        {
            if (ModelState.IsValid)
            {
                _context.Add(items);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(items));
        }
예제 #3
0
        public async Task <IActionResult> Create([Bind("IdOrder,IdItem,Quantity")] ItemsOrdered itemsOrdered)
        {
            if (ModelState.IsValid)
            {
                _context.Add(itemsOrdered);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(itemsOrdered));
        }
예제 #4
0
        public async Task <IActionResult> Create([Bind("IdCustomer,CookieID")] Customer customer)
        {
            if (ModelState.IsValid)
            {
                _context.Add(customer);
                await _context.SaveChangesAsync();

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

            return(View(customer));
        }