public bool CheckDates() { if (CheckInDate[3] == CheckOutDate[3] && CheckInDate[2] == CheckOutDate[2]) { if (CheckInDate[5] == CheckOutDate[5] && CheckInDate[6] == CheckOutDate[6]) { string start = CheckInDate.Substring(8, 2); string end = CheckOutDate.Substring(8, 2); int x = Int32.Parse(start); int y = Int32.Parse(end); int count = y - x; if (count > 0) { return(true); } } } return(false); }
public decimal CalculateReservationCost() { Total = 0M; string start = CheckInDate.Substring(8, 2); string end = CheckOutDate.Substring(8, 2); int x = Int32.Parse(start); int y = Int32.Parse(end); int count = y - x; if (count > 0) { foreach (var r in Rooms) { Total += r.DailyRate; } return(Total * count); } return(Total); }