예제 #1
0
        public IActionResult NewOrder(int id)
        {
            // Check the last time customer make an order
            // if time is less than 2hr
            // Show a message
            // If time is more than 2hr
            // Allo user to complete order
            Customer customer = Repo.GetCustomerByID(id);

            OrderByLocation newOrder = new OrderByLocation
            {
                InventoryLocation =
                    Repo.GetInventoryByLocationID(customer.LocationId),

                Item = Repo.GetAllItem(),

                Types = Repo.GetAllItemType(),

                CustomerID = customer.Id,

                LocationID = customer.LocationId
            };

            return(View(newOrder));
        }
예제 #2
0
        public void GetAllItemShouldReturnAListOfRegisteredItem()
        {
            // Note:
            // At this moment the DB count with 5 initial Customer for demo

            // Arrange
            List <Item> Items;

            // Action
            Items = (List <Item>)repo.GetAllItem();

            // Assert
            Assert.NotNull(Items);
        }
예제 #3
0
        public IActionResult LocationInventory(int id)
        {
            var inventory    = Repo.GetInventoryByLocationID(id);
            var items        = Repo.GetAllItem();
            var locInventory = new LocationInventory
            {
                InventoryList = (List <Inventory>)inventory,
                ItemInventory = (List <Item>)items
            };

            return(View(locInventory));
        }