Beispiel #1
0
        public void GetuserLocation()
        {
            var locations = storeRepo.GetLocations();

            Console.WriteLine("Here are all of our locations.");
            Console.WriteLine($"Store Id\t Store Name \t\t\tAddress \t\t City\t\t State");
            Console.WriteLine();
            foreach (var location in locations)
            {
                Console.WriteLine($"{location.LocationId}\t\t{location.Name}\t{location.Address}\t\t{location.City}\t{location.State}");
            }
            ;
            Console.WriteLine();
            Console.WriteLine("Enter the Store Id you would like to order from: ");
            locationId = Int32.Parse(GetUserInput());
        }
Beispiel #2
0
        //CREATE

        public ActionResult Create()

        {
            var locations = _storeRepo.GetLocations();

            var customers = _storeRepo.GetCustomers();

            var newOrder = new OrderViewModel();

            foreach (var customer in customers)
            {
                newOrder.Customers.Add(customer);
            }
            foreach (var location in locations)
            {
                newOrder.Locations.Add(location);
            }
            ;

            return(View(newOrder));
        }
        public void GetAllLocations()
        {
            var locations = storeRepo.GetLocations();

            Console.WriteLine("Here are all of our locations.");
            Console.WriteLine($"Store Id\t Store Name \t\t\tAddress \t\t City\t\t State");
            Console.WriteLine();
            foreach (var location in locations)
            {
                Console.WriteLine($"{location.LocationId}\t\t{location.Name}\t{location.Address}\t\t{location.City}\t{location.State}");
            }
            ;
            Console.WriteLine();
            Console.WriteLine();
            Console.WriteLine("Choose one :");
            Console.WriteLine("{A} Show All Orders of a Location");
            Console.WriteLine("{B} Show All Inventory of a Location");
            Console.WriteLine("{X} Exit");
            Console.WriteLine(":");
            string input = Console.ReadLine();

            while (input != "a" && input != "b" && input != "x")
            {
                Console.WriteLine("Choose one of the following options above:");
                input = Console.ReadLine();
            }
            switch (input.ToLower())
            {
            case "a":
                GetOrdersByLocation();
                break;

            case "b":
                GetInventory();
                break;

            case "x":
                return;
            }
        }
Beispiel #4
0
        //GET - Locations
        public IActionResult Index()
        {
            var locations = _storeRepo.GetLocations();

            return(View(locations));
        }