Exemple #1
0
        private static void AdminViewUserOrders(User user)
        {
            Console.WriteLine("Enter a user name: ");
            var name    = Console.ReadLine().Trim();
            var db_user = _sql.ReadOneUser(name);

            if (db_user == null)
            {
                Console.WriteLine("Sorry, user not found.");
            }
            else
            {
                var orders = _sql.ReadStoreOrdersByUser(user.SelectedStore, db_user);
                if (orders == null || orders.Count() == 0)
                {
                    Console.WriteLine("Sorry, user does not have orders with this store.");
                }
                else
                {
                    ViewUserHistory(orders);
                }
            }
        }