Beispiel #1
0
        // GET: Orders/Create
        public IActionResult Create()
        {
            var inventoryRepo = new InventoryRepository();
            var orderlineRepo = new OrderlineRepository();

/*            var inventorysAndProducts = storeRepo.GetProductsInStock();
 */
            ViewData["CustomerId"]  = new SelectList(custRepo.GetAll(), "CustomerId", "FullName");
            ViewData["StoreId"]     = new SelectList(storeRepo.GetAll(), "StoreId", "StoreName");
            ViewData["ProductID"]   = new SelectList(inventoryRepo.GetAll(), "ProductId", "ProductName");
            ViewData["InventoryID"] = new SelectList(orderlineRepo.GetAll(), "InventoryId", "Quantity");

            /*var order = orderRepo.GetOrderWithDetails(25);
             * if (order == null)
             * {
             *  return NotFound();
             * }
             *
             * return View(order);*/

            return(View());
        }
 public OrderlineController(IRepository <OrderLine> repository, OrderlineRepository orderlineRepository)
 {
     _irepo = repository;
     _repo  = orderlineRepository;
 }