Example #1
0
        public async Task <IActionResult> Create([Bind("Product_Id,Product_Name,Description,Price,Quantity")] Products products)
        {
            if (ModelState.IsValid)
            {
                _context.Add(products);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(products));
        }
Example #2
0
        public async Task <IActionResult> Create([Bind("Order_Id,Customer_id,Product_id,Product_Name,Quantity,Price")] order order)
        {
            if (ModelState.IsValid)
            {
                _context.Add(order);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(order));
        }
        public async Task <IActionResult> Create([Bind("Customer_Id,FullName,Address,City,Phone_Number")] Customer_Details customer_Details)
        {
            if (ModelState.IsValid)
            {
                _context.Add(customer_Details);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(customer_Details));
        }
Example #4
0
        public async Task <IActionResult> Create([Bind("Driver_Id,FullName,License_Number,Phone_Number")] Driver_Details driver_Details)
        {
            if (ModelState.IsValid)
            {
                _context.Add(driver_Details);
                await _context.SaveChangesAsync();

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