Beispiel #1
0
        public void LocationHistory()
        {
            foreach (var item in _locationBL.GetLocations())
            {
                Console.WriteLine(item.ToString());
            }
            Location loc      = null;
            bool     foundLoc = false;
            int      option;

            do
            {
                Console.WriteLine("Enter store code to view inventory history:");
                option = int.Parse(Console.ReadLine());
                loc    = _locationBL.GetSpecificLocation(option);
                if (loc == null)
                {
                    Console.WriteLine("Invalid location id, please search again");
                }
                else
                {
                    foundLoc = true;
                }
            }while(!foundLoc);
            Console.WriteLine("Select order history format:");
            Console.WriteLine("\t[1] - Date(Ascending)\n\t[2] - Date(Descending)\n\t[3] - Total(Highest)\n\t[4] - Total(Lowest)");
            option = int.Parse(Console.ReadLine());
            switch (option)
            {
            case 1:
                foreach (var item in _orderBL.GetLocationOrderASC(loc.LocationID))
                {
                    Console.WriteLine(item.ToString());
                    _productBL.ProductsByOrder(item.OrderID);
                }
                break;

            case 2:
                foreach (var item in _orderBL.GetLocationOrderDESC(loc.LocationID))
                {
                    Console.WriteLine(item.ToString());
                    _productBL.ProductsByOrder(item.OrderID);
                }
                break;

            case 3:
                foreach (var item in _orderBL.GetLocationOrderASCTotal(loc.LocationID))
                {
                    Console.WriteLine(item.ToString());
                    _productBL.ProductsByOrder(item.OrderID);
                }
                break;

            case 4:
                foreach (var item in _orderBL.GetLocationOrderDESCTotal(loc.LocationID))
                {
                    Console.WriteLine(item.ToString());
                    _productBL.ProductsByOrder(item.OrderID);
                }
                break;

            default:
                Console.WriteLine("Incorrect option, please try again");
                break;
            }
        }