public HttpResponseMessage GetMyOrders(string id) { var memberId = Members.GetCurrentMemberId(); var currentMember = Members.GetById(memberId); var clientId = Utilities.GetString(currentMember.GetProperty("clientId").Value); var newObj = new Models.ClientView(); //var memberService = ApplicationContext.Current.Services.MemberService; // var currentMember = membershipHelper.GetCurrentMember(ApplicationContext.Current); //var currentMember = ApplicationContext.Current.Services.MemberService; //Models.MemberProfileView member = new Models.MemberProfileView(currentMember); HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.OK); return(response); }
public static Models.ClientView GetClientInfo(string clientId) { using (var client = new HttpClient()) { // New code: var path = ConfigurationManager.AppSettings["JobManagerServer"].ToString() + "/Umbraco"; client.BaseAddress = new Uri(path); client.DefaultRequestHeaders.Accept.Clear(); client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); // New code: HttpResponseMessage response = client.GetAsync("Umbraco/Api/ClientsApi/GetClient/" + clientId).Result; if (response.IsSuccessStatusCode) { Models.ClientView product = response.Content.ReadAsAsync <Models.ClientView>().Result; return(product); } } return(null); }