protected void HotelSearchButton_Click(object sender, EventArgs e) { try { HRSHotelsBLL hotelsBLLObject = new HRSHotelsBLL(); string hotelID = HotelIDDropDownList.SelectedItem.Value; Hotel hotel = hotelsBLLObject.GetHotelDetailsByID(hotelID); HotelIDLabel.Text = hotelID; if (hotel != null) { CountryLabel.Text = hotel.Country; HotelNameLabel.Text = hotel.HotelName; CityLabel.Text = hotel.City; HotelDescriptionLabel.Text = hotel.HotelDescription; NoOfACRoomsLabel.Text = hotel.NoOfACRooms.ToString(); NoOfNACRoomsLabel.Text = hotel.NoOfNACRooms.ToString(); RateAdultTextBox.Text = hotel.RateAdultACRoom.ToString(); RateChildTextBox.Text = hotel.RateChildACRoom.ToString(); RateNACChildTextBox.Text = hotel.RateChildNACRoom.ToString(); RateNACAdultTextBox.Text = hotel.RateAdultNACRoom.ToString(); TotalRoomLabel.Text = (hotel.NoOfACRooms + hotel.NoOfNACRooms).ToString(); } hidden.Visible = true; } catch (Exception ex) { Utility.ExceptionUtility.ExceptionLog(ex); throw; } }
protected void BookingIDButton_Click(object sender, EventArgs e) { try { int noOfAdults = 0, noOfChildren = 0, noOfnights = 0, rateAdult = 0, rateChild = 0; double bill = 0; string hotelID = string.Empty; string roomType = string.Empty; HRSBookingsBLL bookingBLLObject = new HRSBookingsBLL(); string bookingID = BookingIDDropDownList.SelectedItem.Text; var booking = bookingBLLObject.GetBookingDetails(bookingID); if (booking != null) { hotelID = booking.HotelID; noOfAdults = booking.NoOfAdults; noOfChildren = booking.NoOfChildren; noOfnights = booking.NoOfNights; roomType = booking.RoomType; } HRSHotelsBLL hotelBLLObject = new HRSHotelsBLL(); var hotel = hotelBLLObject.GetHotelDetailsByID(hotelID); if (roomType == HRSConstants.AC) { rateAdult = hotel.RateAdultACRoom; rateChild = hotel.RateChildACRoom; } else { rateAdult = hotel.RateAdultNACRoom; rateChild = hotel.RateChildNACRoom; } bill = (noOfAdults * rateAdult + noOfChildren * rateChild) * noOfnights; if (noOfnights > 5) { bill = bill - bill * 0.025; } AmountTextBox.Text = bill.ToString(); hidden.Visible = true; } catch (Exception ex) { ExceptionUtility.ExceptionLog(ex); throw; } }