public List <AutoCompleteTextBox> GetHotelList(ProductSearchReq objProductSearchReq, string token) { //the below condition commented coz its handled in WAPI level- Manisha // if (objProductSearchReq.ProdName.Length >= 3 && objProductSearchReq.ProdName.Substring(0, 3) == "###") objProductSearchReq.ProdName = ""; MasterProviders objMasterProviders = new MasterProviders(_configuration); ProductSearchRes objProductSearchRes = objMasterProviders.GetProductDetailsBySearchCriteria(objProductSearchReq, token).Result; List <AutoCompleteTextBox> hotelNameList = new List <AutoCompleteTextBox>(); if (objProductSearchRes.ResponseStatus.Status == "Success" && objProductSearchRes.ProductSearchDetails.Count > 0) { hotelNameList = objProductSearchRes.ProductSearchDetails.Select(data => new AutoCompleteTextBox { value = data.VoyagerProduct_Id, label = data.ProdName, type = data.ProdType, typeId = data.ProdTypeId, categoryid = data.CategoryId, location = data.Location, starrating = data.StarRating, category = data.CategoryName, chain = data.Chain, chainid = data.ChainId }).ToList(); return(hotelNameList); } else { return(hotelNameList); } }
public async Task <ProductSearchRes> GetProductDetailsBySearchCriteria([FromBody] ProductSearchReq request) { var response = new ProductSearchRes(); try { if (request != null) { //var result1 = await _productRepository.GetProductDetailsBySearchCriteriaOldNotInUse(request); var result = await _productRepository.GetProductDetailsBySearchCriteria(request); if (result != null && result.Count > 0) { response.ResponseStatus.Status = "Success"; response.ProductSearchDetails = result.ToList(); } else { response.ResponseStatus.Status = "Success"; response.ResponseStatus.ErrorMessage = "No Records Found."; } } else { response.ResponseStatus.Status = "Failure"; response.ResponseStatus.ErrorMessage = "Product details can not be blank."; } } catch (Exception ex) { response.ResponseStatus.Status = "Failure"; response.ResponseStatus.ErrorMessage = "An error occurs " + ex.Message; } return(response); }
public JsonResult GetProductName(string prodName, string city, string prodType) { string[] City = { "", "" }; if (!string.IsNullOrEmpty(city) && city.Contains(',')) { City = city.Split(','); } ProductSearchReq objProductSearchReq = new ProductSearchReq { ProdName = prodName, CityName = City[0].Trim(), CountryName = City[1].Trim(), ProdType = string.IsNullOrEmpty(prodType) ? "".Split(',').ToList() : prodType.Split(",").ToList() }; // if (objProductSearchReq.ProdName.Length >= 3 && objProductSearchReq.ProdName.Substring(0, 3) == "###") objProductSearchReq.ProdName = ""; MasterProviders objMasterProviders = new MasterProviders(_configuration); ProductSearchRes objProductSearchRes = objMasterProviders.GetProductDetailsBySearchCriteria(objProductSearchReq, token).Result; if (objProductSearchRes.ResponseStatus.Status == "Success" && objProductSearchRes.ProductSearchDetails.Count > 0) { List <AutoCompleteTextBox> ProductList = new List <AutoCompleteTextBox>(); ProductList = objProductSearchRes.ProductSearchDetails.Select(data => new AutoCompleteTextBox { value = data.VoyagerProduct_Id, label = data.ProdName, type = data.ProdType, typeId = data.ProdTypeId }).ToList(); return(Json(ProductList)); } else { return(Json("")); } }
public async Task <ProductSearchRes> GetProductDetailsBySearchCriteria(ProductSearchReq productSearchReq, string ticket) { ProductSearchRes productSearchRes = new ProductSearchRes(); productSearchRes = await serviceProxy.PostData(_configuration.GetValue <string>("ServiceMaster:ServiceGetProductDetailsBySearchCriteria"), productSearchReq, typeof(ProductSearchRes), ticket); return(productSearchRes); }
public JsonResult GetProductNameList(ProductSearchReq objProductSearchReq) { string strProdType = objProductSearchReq.ProdType[0]; objProductSearchReq.ProdType = new List <string>(); objProductSearchReq.ProdType.AddRange(strProdType.Replace("\"", "").Split("|")); // if (objProductSearchReq.ProdName.Length >= 3 && objProductSearchReq.ProdName == "###") objProductSearchReq.ProdName = ""; MasterProviders objMasterProviders = new MasterProviders(_configuration); ProductSearchRes objProductSearchRes = objMasterProviders.GetProductDetailsBySearchCriteria(objProductSearchReq, token).Result; if (objProductSearchRes.ResponseStatus.Status == "Success" && objProductSearchRes.ProductSearchDetails.Count > 0) { List <AutoCompleteTextBox> nameList = new List <AutoCompleteTextBox>(); nameList = objProductSearchRes.ProductSearchDetails.Select(data => new AutoCompleteTextBox { value = data.VoyagerProduct_Id, label = data.ProdName, type = data.ProdType, typeId = data.ProdTypeId, placeholder = data.PlaceHolder }).ToList(); return(Json(nameList)); } else { return(Json("")); } }