static void ViewBookingMenu() { Console.Clear(); int response; BookingUI bookingUI = new BookingUI(); BookingMenu bookingMenu; Console.WriteLine("1.View Bookings For My Rides\n2.View My Bookings\n"); string Response = (Console.ReadLine()); Int32.TryParse(Response, out response); if (response > Enum.GetValues(typeof(UserMenu)).Length) { response = 0; } bookingMenu = (BookingMenu)(response); switch (bookingMenu) { case BookingMenu.ViewBookingForMyRides: bookingUI.ViewBookingsForMyRides(); break; case BookingMenu.ViewMyBookings: bookingUI.ViewMyBookings(); break; case BookingMenu.None: Console.WriteLine("Invalid Choice"); Console.ReadKey(); ViewBookingMenu(); break; } }
public void UserOptions(string userId) { this.userId = userId; UserCredentials user = userService.GetUserById(userId).MapV2D <ViewModels.UserCredentials>(); RideOfferUI rideOffer = Program.container.GetInstance <RideOfferUI>(); BookingUI bookingUI = Program.container.GetInstance <BookingUI>(); Console.Clear(); Console.WriteLine($"Welcome MR.{user.Username} !!!"); bool key = true; while (key) { Console.WriteLine(""); Console.WriteLine("1. Edit Profile 2. Show Profile 0. log Out"); Console.WriteLine("3. Search For a Ride 4. Post a Ride offer"); Console.WriteLine("5. My Offer postings 6. My Bookings"); switch (Console.ReadLine()) { case "1": UpdateProfile(userId); break; case "2": ShowProfile(userId); break; case "3": rideOffer.Search(userId); break; case "4": rideOffer.Post(userId); break; case "5": rideOffer.MyPostings(userId); break; case "6": bookingUI.ShowBookingsOfUser(userId); break; case "0": key = false; break; default: Console.WriteLine("Invalid Input"); break; } } }
public static void UserChoices() { Console.Clear(); int response; RideUI rideUI = new RideUI(); BookingUI bookingUI = new BookingUI(); UserUI userUI = new UserUI(); UserMenu userMenuChoice; Console.WriteLine("Hi There, Select any option from menu\n\n"); Console.WriteLine("1.Create a Ride\n2.Book a Car\n3.View Bookings\n4.View Rides\n5.View Profile\n6.Log Out"); string Response = (Console.ReadLine()); Int32.TryParse(Response, out response); if (response > Enum.GetValues(typeof(UserMenu)).Length) { response = 0; } userMenuChoice = (UserMenu)(response); switch (userMenuChoice) { case UserMenu.CreateRide: rideUI.CreateRide(); break; case UserMenu.BookRide: bookingUI.BookRide(); break; case UserMenu.ViewBookingsMenu: ViewBookingMenu(); break; case UserMenu.ViewMyRides: rideUI.ViewMyRides(); break; case UserMenu.ViewMyProfile: userUI.ViewProfile(); break; case UserMenu.LogOut: userUI.HomePage(); break; case UserMenu.None: Console.WriteLine("Invalid Choice"); Console.ReadKey(); UserChoices(); break; } }