//private void InitBinderPrice() //{ // TourProfile tourProfile = (TourProfile)((TourMaterial)tourMerchandise.DefaultTourMaterial).Profile; // DateTime date = ((TourSearchCondition)this.Transaction.CurrentSearchConditions).FlightDeptDate; // decimal adultPrice = 0M; // decimal childPrice = 0M; // decimal childWithOutPrice = 0M; // string RoomType = string.Empty; // for (int i = 0; i < tourProfile.RoomTypes.Count; i++) // { // RoomType = tourProfile.RoomTypes[i]; // adultPrice = (Decimal)tourProfile.GetPrice(date, RoomType, isLandOnly, false).GetAmount(TERMS.Common.PassengerType.Adult) // + (Decimal)tourProfile.GetPrice(date, RoomType, isLandOnly, false).GetMarkup(TERMS.Common.PassengerType.Adult); // childPrice = (Decimal)tourProfile.GetPrice(date, RoomType, isLandOnly, false).GetAmount(TERMS.Common.PassengerType.Child) // + (Decimal)tourProfile.GetPrice(date, RoomType, isLandOnly, false).GetMarkup(TERMS.Common.PassengerType.Child); // childWithOutPrice = (Decimal)tourProfile.GetPrice(date, RoomType, isLandOnly, false).GetAmount(TERMS.Common.PassengerType.Infant) // + (Decimal)tourProfile.GetPrice(date, RoomType, isLandOnly, false).GetMarkup(TERMS.Common.PassengerType.Infant); // if (RoomType.ToUpper() == "SINGLE") // { // this.lblSingleAdultPrice.Text = adultPrice.ToString("#,###"); // } // else if (RoomType.ToUpper() == "TWIN") // { // this.lblTwinAdultPrice.Text = adultPrice.ToString("#,###"); // if(childPrice > 0M) // this.lblTwinChildPrice.Text = childPrice.ToString("#,###"); // else // this.lblTwinChildPrice.Text = adultPrice.ToString("#,###"); // if(childWithOutPrice > 0M) // this.lblTwinChildWithOutPrice.Text = childWithOutPrice.ToString("#,###"); // else // this.lblTwinChildWithOutPrice.Text = adultPrice.ToString("#,###"); // } // else if (RoomType.ToUpper() == "TRIPLE") // { // this.lblTripleAdultPrice.Text = adultPrice.ToString("#,###"); // if(childPrice > 0M) // this.lblTripleChildPrice.Text = childPrice.ToString("#,###"); // else // this.lblTripleChildPrice.Text = adultPrice.ToString("#,###"); // if(childWithOutPrice > 0M) // this.lblTripleChildWithOutPrice.Text = childWithOutPrice.ToString("#,###"); // else // this.lblTripleChildWithOutPrice.Text = adultPrice.ToString("#,###"); // } // else // { // this.lblQuatAdultPrice.Text = adultPrice.ToString("#,###"); // if(childPrice > 0M) // this.lblQuatChildPrice.Text = childPrice.ToString("#,###"); // else // this.lblQuatChildPrice.Text = adultPrice.ToString("#,###"); // if(childWithOutPrice > 0M) // this.lblQuatChildWithOutPrice.Text = childWithOutPrice.ToString("#,###"); // else // this.lblQuatChildWithOutPrice.Text = adultPrice.ToString("#,###"); // } // } //} //public void SetRoomTypes() //{ // TourProfile tourProfile = (TourProfile)((TourMaterial)tourMerchandise.DefaultTourMaterial).Profile; // for (int i = 0; i < tourProfile.RoomTypes.Count; i++) // { // if (tourProfile.RoomTypes[i].ToUpper() == "SINGLE") // { // this.tbSingle.Visible = true; // } // else if (tourProfile.RoomTypes[i].ToUpper() == "TWIN") // { // this.tbTwin.Visible = true; // } // else if (tourProfile.RoomTypes[i].ToUpper() == "TRIPLE") // { // this.tbTriple.Visible = true; // } // else // { // this.tbQuat.Visible = true; // } // if (((Terms.Product.Business.MVTourProfile)tourProfile).DefaultFareKey.Equals(tourProfile.RoomTypes[i])) // { // switch (((Terms.Product.Business.MVTourProfile)tourProfile).DefaultFareKey.ToUpper()) // { // case "SINGLE": // dllSingleRooms.SelectedIndex = dllSingleRooms.Items.IndexOf(dllSingleRooms.Items.FindByValue("1")); // ddlSingleAdult.SelectedIndex = ddlSingleAdult.Items.IndexOf(ddlSingleAdult.Items.FindByValue("1")); // break; // case "TWIN": // dllTwinRooms.SelectedIndex = dllTwinRooms.Items.IndexOf(dllTwinRooms.Items.FindByValue("1")); // ddlTwinAdult.SelectedIndex = ddlTwinAdult.Items.IndexOf(ddlTwinAdult.Items.FindByValue("2")); // break; // case "TRIPLE": // dllTripleRooms.SelectedIndex = dllTripleRooms.Items.IndexOf(dllTripleRooms.Items.FindByValue("1")); // ddlTripleAdult.SelectedIndex = ddlTripleAdult.Items.IndexOf(ddlTripleAdult.Items.FindByValue("3")); // break; // case "QUARTER": // dllQuatRooms.SelectedIndex = dllQuatRooms.Items.IndexOf(dllQuatRooms.Items.FindByValue("1")); // ddlQuatAdult.SelectedIndex = ddlQuatAdult.Items.IndexOf(ddlQuatAdult.Items.FindByValue("4")); // break; // default: // dllTwinRooms.SelectedIndex = dllTwinRooms.Items.IndexOf(dllTwinRooms.Items.FindByValue("1")); // ddlTwinAdult.SelectedIndex = ddlTwinAdult.Items.IndexOf(ddlTwinAdult.Items.FindByValue("2")); // break; // } // } // } //} public List<TourRoom> GetTourRooms(TourProfile tourProfile, DateTime date) { List<TourRoom> tourRooms = new List<TourRoom>(); for (int i = 0; i < Rooms; i++) { if (Adults[i] > 0) { TourRoom tourRoom = new TourRoom(); tourRoom.RoomIndex = i + 1; tourRoom.PassengerType = TERMS.Common.PassengerType.Adult; tourRoom.Quantity = Adults[i]; tourRoom.RoomType = RoomTypes[i]; if (tourProfile.GetPrice(date, RoomTypes[i], SelectPriceType, false) != null) { tourRoom.UnitPrice = (Decimal)tourProfile.GetPrice(date, RoomTypes[i], SelectPriceType, false).GetAmount(TERMS.Common.PassengerType.Adult) + (Decimal)tourProfile.GetPrice(date, RoomTypes[i], SelectPriceType, false).GetMarkup(TERMS.Common.PassengerType.Adult); tourRoom.NetPrice = (Decimal)tourProfile.GetPrice(date, RoomTypes[i], SelectPriceType, true).GetAmount(TERMS.Common.PassengerType.Adult); // + (Decimal)tourProfile.GetPrice(date, RoomTypes[i], SelectPriceType, true).GetMarkup(TERMS.Common.PassengerType.Adult); tourRooms.Add(tourRoom); } else { Response.Redirect("~/ErrorPages/GenericErrorPage.aspx", true); } } if (Childs[i] > 0) { TourRoom tourRoom = new TourRoom(); tourRoom.RoomIndex = i + 1; tourRoom.PassengerType = TERMS.Common.PassengerType.Child; tourRoom.Quantity = Childs[i]; tourRoom.RoomType = RoomTypes[i]; if (tourProfile.GetPrice(date, RoomTypes[i], SelectPriceType, false) != null) { tourRoom.UnitPrice = (Decimal)tourProfile.GetPrice(date, RoomTypes[i], SelectPriceType, false).GetAmount(TERMS.Common.PassengerType.Child) + (Decimal)tourProfile.GetPrice(date, RoomTypes[i], SelectPriceType, false).GetMarkup(TERMS.Common.PassengerType.Child); tourRoom.NetPrice = (Decimal)tourProfile.GetPrice(date, RoomTypes[i], SelectPriceType, true).GetAmount(TERMS.Common.PassengerType.Child); // + (Decimal)tourProfile.GetPrice(date, RoomTypes[i], SelectPriceType, true).GetMarkup(TERMS.Common.PassengerType.Child); if (tourRoom.UnitPrice == null || tourRoom.UnitPrice == 0M) { tourRoom.UnitPrice = (Decimal)tourProfile.GetPrice(date, RoomTypes[i], SelectPriceType, false).GetAmount(TERMS.Common.PassengerType.Child) + (Decimal)tourProfile.GetPrice(date, RoomTypes[i], SelectPriceType, false).GetMarkup(TERMS.Common.PassengerType.Child); tourRoom.NetPrice = (Decimal)tourProfile.GetPrice(date, RoomTypes[i], SelectPriceType, true).GetAmount(TERMS.Common.PassengerType.Child); // + (Decimal)tourProfile.GetPrice(date, RoomTypes[i], SelectPriceType, true).GetMarkup(TERMS.Common.PassengerType.Child); } tourRooms.Add(tourRoom); } else { Response.Redirect("~/ErrorPages/GenericErrorPage.aspx", true); } } if (ChildsWithOut[i] > 0) { TourRoom tourRoom = new TourRoom(); tourRoom.RoomIndex = i + 1; tourRoom.PassengerType = TERMS.Common.PassengerType.Infant; tourRoom.Quantity = ChildsWithOut[i]; tourRoom.RoomType = RoomTypes[i]; if (tourProfile.GetPrice(date, RoomTypes[i], SelectPriceType, false) != null) { tourRoom.UnitPrice = (Decimal)tourProfile.GetPrice(date, RoomTypes[i], SelectPriceType, false).GetAmount(TERMS.Common.PassengerType.Infant) + (Decimal)tourProfile.GetPrice(date, RoomTypes[i], SelectPriceType, false).GetMarkup(TERMS.Common.PassengerType.Infant); tourRoom.NetPrice = (Decimal)tourProfile.GetPrice(date, RoomTypes[i], SelectPriceType, true).GetAmount(TERMS.Common.PassengerType.Infant); // + (Decimal)tourProfile.GetPrice(date, RoomTypes[i], SelectPriceType, true).GetMarkup(TERMS.Common.PassengerType.Infant); if (tourRoom.UnitPrice == null || tourRoom.UnitPrice == 0M) { tourRoom.UnitPrice = (Decimal)tourProfile.GetPrice(date, RoomTypes[i], SelectPriceType, false).GetAmount(TERMS.Common.PassengerType.Infant) + (Decimal)tourProfile.GetPrice(date, RoomTypes[i], SelectPriceType, false).GetMarkup(TERMS.Common.PassengerType.Infant); tourRoom.NetPrice = (Decimal)tourProfile.GetPrice(date, RoomTypes[i], SelectPriceType, true).GetAmount(TERMS.Common.PassengerType.Infant); // + (Decimal)tourProfile.GetPrice(date, RoomTypes[i], SelectPriceType, true).GetMarkup(TERMS.Common.PassengerType.Infant); } tourRooms.Add(tourRoom); } else { Response.Redirect("~/ErrorPages/GenericErrorPage.aspx", true); } } } return tourRooms; }
public List<TourRoom> GetTourRooms(TourProfile tourProfile ,DateTime date) { List<TourRoom> tourRooms = new List<TourRoom>(); for (int i = 0; i < Rooms; i++) { if (Adults[i] > 0) { TourRoom tourRoom = new TourRoom(); tourRoom.RoomIndex = i + 1; tourRoom.PassengerType = TERMS.Common.PassengerType.Adult; tourRoom.Quantity = Adults[i]; tourRoom.RoomType = RoomTypes[i]; tourRoom.UnitPrice = (Decimal)tourProfile.GetPrice(date, RoomTypes[i], ((TourSearchCondition)Transaction.CurrentSearchConditions).IsLandOnly, false).GetAmount(TERMS.Common.PassengerType.Adult) + (Decimal)tourProfile.GetPrice(date, RoomTypes[i], ((TourSearchCondition)Transaction.CurrentSearchConditions).IsLandOnly, false).GetMarkup(TERMS.Common.PassengerType.Adult); tourRooms.Add(tourRoom); } if (Childs[i] > 0) { TourRoom tourRoom = new TourRoom(); tourRoom.RoomIndex = i + 1; tourRoom.PassengerType = TERMS.Common.PassengerType.Child; tourRoom.Quantity = Childs[i]; tourRoom.RoomType = RoomTypes[i]; tourRoom.UnitPrice = (Decimal)tourProfile.GetPrice(date, RoomTypes[i], ((TourSearchCondition)Transaction.CurrentSearchConditions).IsLandOnly, false).GetAmount(TERMS.Common.PassengerType.Child) + (Decimal)tourProfile.GetPrice(date, RoomTypes[i], ((TourSearchCondition)Transaction.CurrentSearchConditions).IsLandOnly, false).GetMarkup(TERMS.Common.PassengerType.Child); if (tourRoom.UnitPrice == null || tourRoom.UnitPrice == 0M) tourRoom.UnitPrice = (Decimal)tourProfile.GetPrice(date, RoomTypes[i], ((TourSearchCondition)Transaction.CurrentSearchConditions).IsLandOnly, false).GetAmount(TERMS.Common.PassengerType.Adult) + (Decimal)tourProfile.GetPrice(date, RoomTypes[i], ((TourSearchCondition)Transaction.CurrentSearchConditions).IsLandOnly, false).GetMarkup(TERMS.Common.PassengerType.Adult); tourRooms.Add(tourRoom); } if (ChildsWithOut[i] > 0) { TourRoom tourRoom = new TourRoom(); tourRoom.RoomIndex = i + 1; tourRoom.PassengerType = TERMS.Common.PassengerType.Infant; tourRoom.Quantity = ChildsWithOut[i]; tourRoom.RoomType = RoomTypes[i]; tourRoom.UnitPrice = (Decimal)tourProfile.GetPrice(date, RoomTypes[i], ((TourSearchCondition)Transaction.CurrentSearchConditions).IsLandOnly, false).GetAmount(TERMS.Common.PassengerType.Infant) + (Decimal)tourProfile.GetPrice(date, RoomTypes[i], ((TourSearchCondition)Transaction.CurrentSearchConditions).IsLandOnly, false).GetMarkup(TERMS.Common.PassengerType.Infant); if(tourRoom.UnitPrice == null || tourRoom.UnitPrice == 0M) tourRoom.UnitPrice = (Decimal)tourProfile.GetPrice(date, RoomTypes[i], ((TourSearchCondition)Transaction.CurrentSearchConditions).IsLandOnly, false).GetAmount(TERMS.Common.PassengerType.Adult) + (Decimal)tourProfile.GetPrice(date, RoomTypes[i], ((TourSearchCondition)Transaction.CurrentSearchConditions).IsLandOnly, false).GetMarkup(TERMS.Common.PassengerType.Adult); tourRooms.Add(tourRoom); } } return tourRooms; }