Пример #1
0
        public List <string> GetAccomodationNames(MDMSVC.DC_Accomodation_Search_RQ RQParams)
        {
            object result = null;

            ServiceConnection.MDMSvcProxy.PostData(ConfigurationManager.AppSettings["Accomodation_SearchNamesURI"], RQParams, typeof(MDMSVC.DC_Accomodation_Search_RQ), typeof(List <string>), out result);
            return(result as List <string>);
        }
Пример #2
0
        public List <DC_Accomodation> GetAccomodationMissingAttributeDetails(MDMSVC.DC_Accomodation_Search_RQ RQParams)
        {
            object result = null;

            ServiceConnection.MDMSvcProxy.PostData(ConfigurationManager.AppSettings["Get_AccomodationDetails"], RQParams, typeof(MDMSVC.DC_Accomodation_Search_RQ), typeof(List <DC_Accomodation>), out result);
            return(result as List <DC_Accomodation>);
        }
Пример #3
0
        public void ProcessRequest(HttpContext context)
        {
            //Get ForWhich Dropdown List
            var EntityType = context.Request.QueryString["EntityType"];

            if (EntityType.ToLower().Trim() == "activity")
            {
                var CountryName = context.Request.QueryString["countryname"];
                var CityName    = context.Request.QueryString["cityname"];
                var res         = msterdata.GetActivityByCountryCity(CountryName, CityName);
                if (res != null)
                {
                    context.Response.Write(new JavaScriptSerializer().Serialize(res));
                }
            }
            if (EntityType.ToLower().Trim() == "country")
            {
                var res = msterdata.GetMasterCountryDataList();
                if (res != null)
                {
                    context.Response.Write(new JavaScriptSerializer().Serialize(res));
                }
            }
            if (EntityType.ToLower().Trim() == "acco")
            {
                Controller.AccomodationSVC accoSVc = new Controller.AccomodationSVC();
                var CountryName = context.Request.QueryString["countryname"];
                var CityName    = context.Request.QueryString["cityname"];
                MDMSVC.DC_Accomodation_Search_RQ RQParams = new MDMSVC.DC_Accomodation_Search_RQ();
                RQParams.ProductCategory = "Accommodation";

                if (!string.IsNullOrWhiteSpace(CountryName))
                {
                    RQParams.Country = CountryName.ToString();
                }
                if (!string.IsNullOrWhiteSpace(CityName))
                {
                    if (CityName != "&NBSP;")
                    {
                        RQParams.City = CityName.ToString();
                    }
                }

                RQParams.PageNo   = 0;
                RQParams.PageSize = int.MaxValue;
                var res = accoSVc.SearchHotels(RQParams);
                if (res != null)
                {
                    context.Response.Write(new JavaScriptSerializer().Serialize(res));
                }
            }
        }
        public void ProcessRequest(HttpContext context)
        {
            var PrefixText = context.Request.QueryString["term"];
            var Country    = context.Request.QueryString["country"];
            var City       = context.Request.QueryString["city"];
            var Chain      = context.Request.QueryString["chain"];
            var Brand      = context.Request.QueryString["brand"];

            // var prefixText = context.Items["key"];

            RQParams = new MDMSVC.DC_Accomodation_Search_RQ();
            RQParams.ProductCategory        = "Accommodation";
            RQParams.ProductCategorySubType = "Hotel"; //txtProdCategoryt.Text;
            //RQParams.Status = ddlProductMappingStatus.SelectedItem.Text == "ACTIVE" ? true : false;
            //RQParams.Status = true;
            RQParams.Status = "ACTIVE";
            if (PrefixText != "")
            {
                RQParams.HotelName = PrefixText;
            }
            if (!string.IsNullOrWhiteSpace(Country))
            {
                if (Country.IndexOf("-") == -1)
                {
                    RQParams.Country = Country;
                }
            }
            if (!string.IsNullOrWhiteSpace(City))
            {
                if (City.IndexOf("-") == -1)
                {
                    RQParams.City = City;
                }
            }
            if (!string.IsNullOrWhiteSpace(Chain))
            {
                if (Chain.IndexOf("-") == -1)
                {
                    RQParams.Chain = Chain;
                }
            }
            if (!string.IsNullOrWhiteSpace(Brand))
            {
                if (Brand.IndexOf("-") == -1)
                {
                    RQParams.Brand = Brand;
                }
            }

            RQParams.PageNo   = PageIndex;
            RQParams.PageSize = 500;
            var res = AccSvc.GetAccomodationNames(RQParams);

            if (res != null)
            {
                if (res.Count == 0)
                {
                    string msg = "No Hotel Found";
                    res.Add(msg);
                    var a = res.Count();
                    context.Response.Write(new JavaScriptSerializer().Serialize(res));
                }
                else
                {
                    context.Response.Write(new JavaScriptSerializer().Serialize(res));
                }
            }
        }
Пример #5
0
        private string CheckForDuplicate()
        {
            string ret = "";

            //DropDownList ddlCountry = (DropDownList)frmHotelOverview.FindControl("ddlCountry");
            //DropDownList ddlCity = (DropDownList)frmHotelOverview.FindControl("ddlCity");
            //DropDownList ddlProductCategorySubType = (DropDownList)frmHotelOverview.FindControl("ddlProductCategorySubType");
            //TextBox txtHotelName = (TextBox)frmHotelOverview.FindControl("txtHotelName");
            //TextBox txtCommonHotelId = (TextBox)frmHotelOverview.FindControl("txtCommonHotelId");
            //TextBox txtPostalCode = (TextBox)frmHotelOverview.FindControl("txtPostalCode");
            //TextBox txtHotelID = (TextBox)frmHotelOverview.FindControl("txtHotelID");
            RQParams.ProductCategory        = "Accommodation";
            RQParams.ProductCategorySubType = ddlAddProductCategorySubType.SelectedItem.Text;
            RQParams.Status   = "ACTIVE";
            RQParams.PageNo   = 0;
            RQParams.PageSize = int.MaxValue;
            if (txtAddCityPlaceId.Text.Length != 0)
            {
                RQParams.Google_Place_Id = txtAddCityPlaceId.Text;
                res = AccSvc.SearchHotels(RQParams);

                if ((res == null) || ((res != null) && (res.Count == 0)))
                {
                    RQParams = new MDMSVC.DC_Accomodation_Search_RQ();
                    RQParams.ProductCategory        = "Accommodation";
                    RQParams.ProductCategorySubType = ddlAddProductCategorySubType.SelectedItem.Text;
                    RQParams.Status   = "ACTIVE";
                    RQParams.PageNo   = 0;
                    RQParams.PageSize = int.MaxValue;
                    if (txtHotelName.Text.Length != 0)
                    {
                        RQParams.HotelName = txtHotelName.Text;
                    }
                    if (ddlAddCountry.SelectedItem.Text != "---ALL---")
                    {
                        RQParams.Country = ddlAddCountry.SelectedItem.Text;
                    }
                    if (ddlAddCity.SelectedItem.Text != "---ALL---")
                    {
                        RQParams.City = ddlAddCity.SelectedItem.Text;
                    }
                    res = AccSvc.SearchHotels(RQParams);
                }
                else
                {
                    ret = "placeid";
                }
            }
            else
            {
                RQParams = new MDMSVC.DC_Accomodation_Search_RQ();
                RQParams.ProductCategory        = "Accommodation";
                RQParams.ProductCategorySubType = ddlAddProductCategorySubType.SelectedItem.Text;
                RQParams.Status   = "ACTIVE";
                RQParams.PageNo   = 0;
                RQParams.PageSize = int.MaxValue;
                if (txtHotelName.Text.Length != 0)
                {
                    RQParams.HotelName = txtHotelName.Text;
                }
                if (ddlAddCountry.SelectedItem.Text != "---ALL---")
                {
                    RQParams.Country = ddlAddCountry.SelectedItem.Text;
                }
                if (ddlAddCity.SelectedItem.Text != "---ALL---")
                {
                    RQParams.City = ddlAddCity.SelectedItem.Text;
                }
                res = AccSvc.SearchHotels(RQParams);
            }

            if (ret == "")
            {
                if (res != null)
                {
                    //if (txtAddCityPlaceId.Text.Length != 0)
                    //{
                    //    if (res.Count > 0)
                    //    {
                    //        ret = "placeid";
                    //    }
                    //}
                    //else
                    //{
                    foreach (MDMSVC.DC_Accomodation_Search_RS rs in res)
                    {
                        if (rs.Country.ToUpper() == ddlAddCountry.SelectedItem.Text.ToUpper())
                        {
                            if (rs.City.ToUpper() == ddlAddCity.SelectedItem.Text.ToUpper())
                            {
                                if (!string.IsNullOrWhiteSpace(rs.PostalCode))
                                {
                                    if (rs.PostalCode.ToUpper() == txtPostalCode.Text.ToUpper())
                                    {
                                        if (rs.HotelName.TrimStart().TrimEnd().ToUpper().Replace("HOTEL", "").Replace("'", "").Replace("-", "").Replace(" ", "") == txtHotelName.Text.TrimStart().TrimEnd().ToUpper().Replace("HOTEL", "").Replace("'", "").Replace("-", "").Replace(" ", ""))
                                        {
                                            ret = "names";
                                            break;
                                        }
                                    }
                                }
                                else
                                {
                                    if (rs.HotelName.TrimStart().TrimEnd().ToUpper().Replace("HOTEL", "").Replace("'", "").Replace("-", "").Replace(" ", "") == txtHotelName.Text.TrimStart().TrimEnd().ToUpper().Replace("HOTEL", "").Replace("'", "").Replace("-", "").Replace(" ", ""))
                                    {
                                        ret = "names";
                                        break;
                                    }
                                }
                            }
                        }
                    }
                    //}
                }
            }
            return(ret);
        }