//Display Best Rated Hotel public void DisplayBestRatedHotel(HotelDetails bestRatedHotel) { Console.WriteLine("Hotel :" + bestRatedHotel.hotelname + "Total Bill" + cheapestrate); }
/// <summary> /// UC 1: /// Adds hotel and price /// </summary> /// <param name="hotel"></param> /// <param name="regularRate"></param> public void AddHotel(string hotel, int regularWeekdayRate, int regularWeekendRate) { HotelDetails hotelDetails = new HotelDetails(hotel, regularWeekdayRate, regularWeekendRate); miamiHotels.Add(hotel, hotelDetails); }
public void AddHotel(HotelDetails newHotelAdd) { this.hotelDetails.Add(newHotelAdd); }
//private method or calling AddHotel Method private static void CallAddHotel() { Console.Write("Enter the Hotel Name : "); string hotelName = Console.ReadLine(); label2: Console.Write("Enter the Hotel Rating : "); int hotelRating; try { hotelRating = Convert.ToInt32(Console.ReadLine()); } catch { ColouredPrint.PrintInMagenta("Wrong value"); goto label2; } label3: Console.Write("Enter the Weekday Rate For Regular Customer : "); int weekdayRateForRegularCust; int weekendRateForRegularCust; int weekdayRateForRewardCust; int weekendRateForRewardCust; try { weekdayRateForRegularCust = Convert.ToInt32(Console.ReadLine()); } catch { ColouredPrint.PrintInMagenta("Wrong value"); goto label3; } label4: Console.Write("Enter the Weekend Rate For Regular Customer : "); try { weekendRateForRegularCust = Convert.ToInt32(Console.ReadLine()); } catch { ColouredPrint.PrintInMagenta("Wrong value"); goto label4; } label5: Console.Write("Enter the Weekday Rate For Reward Customer : "); try { weekdayRateForRewardCust = Convert.ToInt32(Console.ReadLine()); } catch { ColouredPrint.PrintInMagenta("Wrong value"); goto label5; } label6: Console.Write("Enter the Weekend Rate For Reward Customer : "); try { weekendRateForRewardCust = Convert.ToInt32(Console.ReadLine()); } catch { ColouredPrint.PrintInMagenta("Wrong value"); goto label6; } HotelDetails hotelDetailsObj = new HotelDetails(); hotelDetailsObj.AddHotel(hotelName, hotelRating, weekdayRateForRegularCust, weekendRateForRegularCust, weekdayRateForRewardCust, weekendRateForRewardCust); }