public static string SetHotelMultiSingleAvailabilityBody(CLayer.SearchCriteria sch) { int BedRoomsQuantity = Convert.ToInt32(HttpContext.Current.Session["Bedrooms"]); int GuestCount = Convert.ToInt32(HttpContext.Current.Session["Adults"]) + Convert.ToInt32(HttpContext.Current.Session["Children"]);; BedRoomsQuantity = BedRoomsQuantity <= 0 ? 1 : BedRoomsQuantity; // GuestCount = GuestCount <= 0 ? 2 : GuestCount; GuestCount = GuestCount <= 0 ? 1 : GuestCount; GDSCountryCode = Convert.ToString(HttpContext.Current.Session["GDSCountryCode"]); GDSCurrencyCode = Convert.ToString(HttpContext.Current.Session["GDSCurrencyCode"]); string Body = string.Empty; Body = Body + "<soapenv:Body>"; Body = Body + "<ibas:GetHotelList>"; Body = Body + "<ibas:param>"; Body = Body + "<tam:CityID>BOM</tam:CityID>"; Body = Body + "<tam:StarRating></tam:StarRating>"; Body = Body + "</ibas:param>"; Body = Body + "</ibas:GetHotelList>"; Body = Body + "</soapenv:Body>"; return(Body); }
private async Task <SearchResults> SearchFilter(StayBazar.Areas.Admin.Models.StaticHtmlPageModel data) { SearchResults searchr = new SearchResults(); CLayer.SearchCriteria cr = new CLayer.SearchCriteria(); //int temp; cr.Adults = 0; cr.Children = 0; cr.StayType = 0; cr.Bedrooms = 0; int totalCount = 0; cr.Destination = data.Destination; if (cr.Destination != null && cr.Destination != "") { cr.Destination = cr.Destination.Replace("'", "").Replace(";", "").Replace("\"", ""); } cr.CheckOut = DateTime.Today.AddDays(2); cr.CheckIn = DateTime.Today.AddDays(1); cr.Lattitude = 0; cr.Longitude = 0; cr.Bedrooms = 0; cr.RangeBudgetMax = 0; cr.RangeBudgetMin = 0; cr.DistanceInKm = 0; cr.Features = ""; cr.StarRatingRange = 0; string loc = ""; if (data.Location != null && data.Location != "") { loc = data.Location; if (cr.Destination != null && cr.Destination != "") { loc = BLayer.City.GetLocation(loc); if (loc == "") { loc = BLayer.City.GetLocation(data.Destination); //if (loc == "") ... //loc = data.Location + ", " + loc; } } } else { loc = BLayer.City.GetLocation(data.Destination); } if (loc == "") { cr.Lattitude = 0; cr.Longitude = 0; } else { Common.Utils.Location pos; pos = await Common.Utils.GetLocation(loc); cr.Lattitude = pos.Lattitude; cr.Longitude = pos.Longitude; } int rip = 0; int.TryParse(System.Configuration.ConfigurationManager.AppSettings.Get(Common.Utils.SERARCH_MAX_ROWS), out rip); cr.NoOfRows = rip; cr.Features = ""; int sr = data.CurrentPage - 1; if (sr < 0) { sr = 0; } sr = sr * cr.NoOfRows; cr.StaringRow = sr; cr.SortOrder = (CLayer.SearchCriteria.SortBy.PriceAsc); cr.Location = data.Location; if (cr.Location != null && cr.Location != "") { cr.Location = cr.Location.Replace("'", "").Replace(";", "").Replace("\"", ""); } cr.UserType = CLayer.Role.Roles.Customer; cr.LoggedInUser = 0; //data.PropertyList = await FillLocations(BLayer.Property.SearchWithFilter(out totalCount, cr)); //data.TotalRows = totalCount; searchr.Results = await FillLocations(BLayer.Property.SearchWithFilter(out totalCount, cr)); searchr.TotalRows = totalCount; return(searchr); }
public bool GDSBookingConfirm(long bookingId) { long propertyId = 0; bool returnvalue = false; int InventoryAPIType = 0; try { StayBazar.Controllers.BookingController objBookingController = new StayBazar.Controllers.BookingController(); long userId = objBookingController.GetUserId(); if (bookingId <= 0) { bookingId = BLayer.Bookings.GetCartId(userId); } string IpAdds = GetIPAddress(); propertyId = BLayer.BookingExternalInventory.GetPropertyIdByBookingId(bookingId); InventoryAPIType = BLayer.Property.GetInventoryAPITypeId(BLayer.Bookings.GetPropertyId(bookingId)); Session["InventoryAPIType"] = InventoryAPIType; ViewBag.AmadeusRates = TempData["AmadeusRates"]; TempData.Keep("AmadeusRates"); List <CLayer.BookingItem> bookitems = new List <CLayer.BookingItem>(); if (InventoryAPIType == (int)CLayer.ObjectStatus.InventoryAPIType.Amadeus) { bookitems = BLayer.BookingItem.GetAllDetails(bookingId, true); } else { bookitems = BLayer.BookingItem.GetAllDetails(bookingId); } string HotelId = BLayer.Property.GetHotelId(BLayer.Bookings.GetPropertyId(bookingId)); if (InventoryAPIType == (int)CLayer.ObjectStatus.InventoryAPIType.Amadeus) { #region HOTEL SELL string Action = BLayer.Settings.GetValue(CLayer.Settings.STAYBAZARWBSHOTELSELLACTION);; CLayer.SearchCriteria srch = new CLayer.SearchCriteria(); srch.HotelCode = HotelId; List <CLayer.RoomStaysResult> RoomStaysResultList = APIUtility.AmedusHotelRoomStaysResultList; RoomStaysResultList = (List <CLayer.RoomStaysResult>)TempData["RoomStaysResult"]; TempData.Keep("RoomStaysResult"); string SoapHeaderStateful = string.Empty; foreach (var item in RoomStaysResultList) { string BookingCode = item.BookingCode; string HotelSellSoapBody = APIUtility.Hotel_Sell(HotelId, BookingCode); SoapHeaderStateful = APIUtility.SetStatefulSoapHeader(Action, Session["SessionId"].ToString(), Convert.ToInt32(Session["SequenceNumber"]), Session["SecurityToken"].ToString()); string result = APIUtility.GetAmedusResult(Action, SoapHeaderStateful, HotelSellSoapBody); if (!APIUtility.CheckHotelBookingErrorExists(result)) { Serializer HotelSell = new Serializer(); CLayer.HotelSell.Envelope HotelSellResult = HotelSell.Deserialize <CLayer.HotelSell.Envelope>(result); Session["HotelSellStatus"] = "success"; Session["SessionId"] = HotelSellResult.Header.Session.SessionId; Session["SequenceNumber"] = Convert.ToInt32(HotelSellResult.Header.Session.SequenceNumber); Session["SecurityToken"] = HotelSellResult.Header.Session.SecurityToken; returnvalue = true; } else { Serializer HotelSellError = new Serializer(); CLayer.HotelSell.Envelope HotelSellErrorResult = HotelSellError.Deserialize <CLayer.HotelSell.Envelope>(result); Session["HotelSellStatus"] = "error"; Session["SessionId"] = HotelSellErrorResult.Header.Session.SessionId; Session["SequenceNumber"] = Convert.ToInt32(HotelSellErrorResult.Header.Session.SequenceNumber); Session["SecurityToken"] = HotelSellErrorResult.Header.Session.SecurityToken; ViewBag.HotelSellResult = "error"; TempData["Errorcomes"] = "error"; #region PNR CANCEL string resultCancel = APIUtility.ExecutePNRCancel("", (int)CLayer.ObjectStatus.PNROptionCodes.OptionPNRGeneration); returnvalue = false; #endregion } } #endregion #region PNR MULTIELEMENTS-FINAL Action = BLayer.Settings.GetValue(CLayer.Settings.STAYBAZARWBSPNRADDACTION);; SoapHeaderStateful = APIUtility.SetStatefulSoapHeader(Action, Session["SessionId"].ToString(), Convert.ToInt32(Session["SequenceNumber"]), Session["SecurityToken"].ToString()); APIUtility.SoapHeaderStateful = SoapHeaderStateful; string BookingCodeFinal = RoomStaysResultList.OrderBy(x => x.AmountAfterTax).FirstOrDefault().BookingCode; string PNRADDSoapBody = APIUtility.PNR_AddMultielements(HotelId, BookingCodeFinal, "*****@*****.**", 11); TempData["RoomStaysResult"] = RoomStaysResultList; APIUtility.AmedusHotelRoomStaysResultList = RoomStaysResultList; string resultFinal = APIUtility.GetAmedusResult(Action, APIUtility.SoapHeaderStateful, PNRADDSoapBody); Serializer pnrser = new Serializer(); CLayer.PNRAddElementsConfirm.Envelope PNRAddResult = pnrser.Deserialize <CLayer.PNRAddElementsConfirm.Envelope>(resultFinal); Session["ControlNumber"] = PNRAddResult.Body.PNR_Reply.pnrHeader.reservationInfo.reservation.controlNumber; if (APIUtility.CheckHotelBookingErrorExists(resultFinal)) { Serializer HotelSellError = new Serializer(); CLayer.HotelSell.Envelope HotelSellErrorResult = HotelSellError.Deserialize <CLayer.HotelSell.Envelope>(resultFinal); Session["HotelSellStatus"] = "error"; Session["SessionId"] = HotelSellErrorResult.Header.Session.SessionId; Session["SequenceNumber"] = Convert.ToInt32(HotelSellErrorResult.Header.Session.SequenceNumber); Session["SecurityToken"] = HotelSellErrorResult.Header.Session.SecurityToken; #region PNR CANCEL string ControlNumber = Convert.ToString(Session["ControlNumber"]); string resultCancel = APIUtility.ExecutePNRCancel(ControlNumber, (int)CLayer.ObjectStatus.PNROptionCodes.OptionPNRFinalize); returnvalue = false; #endregion } else { returnvalue = true; } #endregion List <CLayer.BookingItem> objBookItems = BLayer.BookingItem.GetAccomodationFromBookingCode(BookingCodeFinal); foreach (var item in objBookItems) { BLayer.BookingItem.UpdateHotelConfirmNumber(item.BookingId, item.AccommodationId, Convert.ToString(Session["ControlNumber"])); } } } catch (Exception ex) { returnvalue = false; throw ex; } return(returnvalue); }
public static List <CLayer.Accommodation> GetDetailsForBooking(long propertyId, CLayer.SearchCriteria criteria) { DataLayer.Property pr = new DataLayer.Property(); return(pr.GetDetailsForBooking(propertyId, criteria)); }
public static List <CLayer.SearchResult> SearchWithFilter_Amadeus(out int totalCount, CLayer.SearchCriteria criteria) { DataLayer.Property property = new DataLayer.Property(); return(property.SearchWithFilter_Amadeus(out totalCount, criteria)); }