public HttpResponseMessage GetServiceCategories(CountryListRequest cr) { try { SqlParameter[] parameters = { new SqlParameter("@CountryId", cr.CountryId) }; var CategoryDrop = _categoryManagementService.GetServiceCategory(StoredProceduresList.GetServiceCategory, System.Data.CommandType.StoredProcedure, parameters); return (Request.CreateResponse <ApiResponse <List <ServiceCategory> > >(HttpStatusCode.OK, CategoryDrop)); } catch (Exception ex) { return (Request.CreateResponse <System.Exception>(HttpStatusCode.InternalServerError, ex)); } }
public List <ServiceCategoriesResponse> GetServiceCategories() { List <ServiceCategoriesResponse> myList = new List <ServiceCategoriesResponse>(); try { int CountryId = 101; CountryListRequest clr = new CountryListRequest(); clr.CountryId = CountryId; var apiResponse = _categoryManagementService.GetServicesDrop(clr); if (apiResponse.Succeded) { myList = apiResponse.Response; } } catch (Exception ex) { } return(myList); }
public dynamic GetCountryList() { //List<DropDownCL> drpList = new List<DropDownCL>(); List <Country> countryList = new List <Country>(); try { CountryListRequest Country = new CountryListRequest(); Country.ClientId = apiClientId; Country.EndUserIp = IPAddress; Country.TokenId = BLFunction.GetTokenID(); var jsonObject = JsonConvert.SerializeObject(Country); String QualifiedUrl = Baseurl + "SharedServices/SharedData.svc/rest/CountryList"; var result = APIHotel.Instance().GetResponse(QualifiedUrl, Verbs.POST, jsonObject); if (result != null) { CountryListResponse response = new CountryListResponse(); response = JsonConvert.DeserializeObject <CountryListResponse>(result); countryList = (List <Country>)GetObjectFromXMlString(typeof(List <Country>), "Countries", response.CountryList); //foreach (var item in CountryList) //{ // DropDownCL ddcl = new DropDownCL(); // ddcl.DataText = item.Name; // ddcl.DataValue = item.Code; // drpList.Add(ddcl); //} } return(countryList); } catch (Exception ex) { string msg = ex.Message; return(null); } }
public ApiResponse <List <ServiceCategoriesResponse> > GetServiceCategories(CountryListRequest cl, string Uri) { return(_ecommerceProxy.PostApi <CountryListRequest, List <ServiceCategoriesResponse> >(cl, Uri, "Post")); }
public ApiResponse <List <ServiceCategoriesResponse> > GetServicesDrop(CountryListRequest clr) { return(_categoryManagmentRepository.GetServiceCategories(clr, APIUri.ServiceCategories)); }