public ProdCatDefGetRes GetProdCatDef() { var response = new ProdCatDefGetRes(); try { var result = _productRepository.GetProdCatDef(); if (result != null && result.Count > 0) { response.ResponseStatus.Status = "Success"; response.ProdCatDefProperties = result; } else { response.ResponseStatus.Status = "Success"; response.ResponseStatus.ErrorMessage = "No Records Found."; } } catch (Exception ex) { response.ResponseStatus.Status = "Failure"; response.ResponseStatus.ErrorMessage = "An error occurs " + ex.Message; } return(response); }
public async Task <ProdCatDefGetRes> GetProdCatDef(string ticket) { ProdCatDefGetRes prodCatDefGetRes = new ProdCatDefGetRes(); prodCatDefGetRes = await serviceProxy.PostData(_configuration.GetValue <string>("ServiceMaster:ServiceGetProdCatDef"), null, typeof(ProdCatDefGetRes), ticket); return(prodCatDefGetRes); }
public JsonResult GetHotelCategory(string term) { //List<AgentName> agentList = objAgentResponse.AgentProperties.Select(data => new AgentName { value = data.VoyagerCompany_Id, label = data.Name }).ToList(); if (term.Length >= 3 && term.Substring(0, 3) == "###") { term = ""; } ProdCatDefGetReq objProdCatDefGetReq = new ProdCatDefGetReq { Name = term }; MasterProviders objMasterProviders = new MasterProviders(_configuration); ProdCatDefGetRes objMasterTypeResponse = objMasterProviders.GetProdCatDefByName(objProdCatDefGetReq, token).Result; List <AutoCompleteTextBox> CatList = objMasterTypeResponse.ProdCatDefProperties.Select(data => new AutoCompleteTextBox { value = data.VoyagerDefProductCategoryId, label = data.Name }).ToList(); return(Json(CatList)); }
/// <summary> /// Bind Master data for filters of product search /// </summary> /// <param name="productsSRPViewModel"></param> /// <param name="token"></param> /// <returns></returns> public bool BindProdSearchFilterData(ref ProductsSRPViewModel productsSRPViewModel, string token) { //ProductProviders productProviders = new ProductProviders(_configuration); //ProductSRPSearchRes objProposalRes = productProviders.GetProductSRPDetails(new ProductSRPSearchReq(), token).Result; MasterProviders objMasterProviders = new MasterProviders(_configuration); //Get Product Type list for filters dropdown ProdTypeGetRes objProdTypeGetRes = objMasterProviders.GetProdTypeByProdType(new ProdTypeGetReq(), token).Result; if (objProdTypeGetRes.ResponseStatus.Status == "Success" && objProdTypeGetRes.ProductTypeList.Count > 0) { productsSRPViewModel.ProductSRPFilters.ProductTypeList = objProdTypeGetRes.ProductTypeList.Select(a => new AttributeValues { AttributeValue_Id = a.VoyagerProductType_Id, Value = a.Prodtype }).ToList(); } //Get Product Budget Category list for filters dropdown ProdCatDefGetRes objProdCatDefGetRes = objMasterProviders.GetProdCatDef(token).Result; if (objProdCatDefGetRes.ResponseStatus.Status == "Success" && objProdCatDefGetRes.ProdCatDefProperties.Count > 0) { productsSRPViewModel.ProductSRPFilters.BudgetCategoryList = objProdCatDefGetRes.ProdCatDefProperties.Select(a => new AttributeValues { AttributeValue_Id = a.VoyagerDefProductCategoryId, Value = a.Name }).ToList(); } //Get Product Location list for filters dropdown ProductAttributeRes objProductAttributeRes = objMasterProviders.GetProdAttributeDetailsByNameOrVal(new ProductAttributeReq() { AttributeName = "Location" }, token).Result; if (objProductAttributeRes.ResponseStatus.Status == "Success" && objProductAttributeRes.ProductAttributeDetails.Count > 0) { productsSRPViewModel.ProductSRPFilters.LocationList = objProductAttributeRes.ProductAttributeDetails.Select(a => new AttributeValues { AttributeValue_Id = a.AttributeId, Value = a.Value }).ToList(); } //Populate Star Rating list for filters dropdown List <AttributeValues> starRating = new List <AttributeValues> { new AttributeValues { Value = "1" }, new AttributeValues { Value = "2" }, new AttributeValues { Value = "3" }, new AttributeValues { Value = "4" }, new AttributeValues { Value = "5" } }; productsSRPViewModel.ProductSRPFilters.StarRatingList = starRating; //Populate Product Status list for filters dropdown List <AttributeValues> statusList = new List <AttributeValues> { new AttributeValues { Value = "Active" }, new AttributeValues { Value = "Inactive" } }; productsSRPViewModel.ProductSRPFilters.StatusList = statusList; return(true); }