public void InitRoomRateSelections() { StayCriteriaSelection objStayCriteriaSelection = (StayCriteriaSelection)Session[Constants.Sessions.StayCriteriaSelection]; RoomRateSelection[] objRoomRateSelections = new RoomRateSelection[objStayCriteriaSelection.RoomOccupantSelections.Length]; for (int i = 0; i < objRoomRateSelections.Length; i++) { objRoomRateSelections[i] = new RoomRateSelection(); objRoomRateSelections[i].RoomRefID = ((int)(i + 1)).ToString(); objRoomRateSelections[i].RoomTypeCode = ""; objRoomRateSelections[i].RatePlanCode = ""; objRoomRateSelections[i].PromotionCode = ""; } Session["RoomRateSelections"] = objRoomRateSelections; Session["ShowMoreRatesIndicators"] = new ShowMoreRatesIndicator[0]; return; }
public void ShowMoreLessRatesRequested(object sender, EventArgs e) { ShowMoreRatesIndicator[] objShowMoreRatesIndicators = (ShowMoreRatesIndicator[])Session["ShowMoreRatesIndicators"]; List<ShowMoreRatesIndicator> lNewShowMoreRatesIndicators = new List<ShowMoreRatesIndicator>(); if (ConfigurationManager.AppSettings["EnableRoomRateGridModel"] != "1") { RoomRateSelectorControl objRoomRateSelectorControl = (RoomRateSelectorControl)sender; for (int i = 0; i < objShowMoreRatesIndicators.Length; i++) { if (objShowMoreRatesIndicators[i].RoomRefID != objRoomRateSelectorControl.RoomRefID) lNewShowMoreRatesIndicators.Add(objShowMoreRatesIndicators[i]); } for (int i = 0; i < objRoomRateSelectorControl.RoomTypeSelectorItems.Length; i++) { if (objRoomRateSelectorControl.RoomTypeSelectorItems[i].ShowMoreRates) { ShowMoreRatesIndicator objShowMoreRatesIndicator = new ShowMoreRatesIndicator(); lNewShowMoreRatesIndicators.Add(objShowMoreRatesIndicator); objShowMoreRatesIndicator.RoomRefID = objRoomRateSelectorControl.RoomRefID; objShowMoreRatesIndicator.RoomTypeCode = objRoomRateSelectorControl.RoomTypeSelectorItems[i].RoomType.Code; } } } else { RoomRateSelectorGridControl objRoomRateSelectorGridControl = (RoomRateSelectorGridControl)sender; for (int i = 0; i < objShowMoreRatesIndicators.Length; i++) { if (objShowMoreRatesIndicators[i].RoomRefID != objRoomRateSelectorGridControl.RoomRefID) lNewShowMoreRatesIndicators.Add(objShowMoreRatesIndicators[i]); } for (int i = 0; i < objRoomRateSelectorGridControl.RoomTypeSelectorGridItems.Length; i++) { if (objRoomRateSelectorGridControl.RoomTypeSelectorGridItems[i].ShowMoreRates) { ShowMoreRatesIndicator objShowMoreRatesIndicator = new ShowMoreRatesIndicator(); lNewShowMoreRatesIndicators.Add(objShowMoreRatesIndicator); objShowMoreRatesIndicator.RoomRefID = objRoomRateSelectorGridControl.RoomRefID; objShowMoreRatesIndicator.RoomTypeCode = objRoomRateSelectorGridControl.RoomTypeSelectorGridItems[i].RoomType.Code; } } } Session["ShowMoreRatesIndicators"] = lNewShowMoreRatesIndicators.ToArray(); return; }