public GetAllDocumentByCustomerIdResponse getDocuments(GetMobileCustomerByIDRequest request, string token) { GetAllDocumentByCustomerIdResponse res = new GetAllDocumentByCustomerIdResponse(); try { using (var client = new HttpClient()) { client.BaseAddress = new Uri(ConstantData.ApiURL.ToString() + "CustomerMobile/GetAllDocumentByCustomerId"); client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); var myContent = JsonConvert.SerializeObject(request); var buffer = Encoding.UTF8.GetBytes(myContent); var byteContent = new ByteArrayContent(buffer); byteContent.Headers.ContentType = new MediaTypeHeaderValue("application/json"); var response = client.PostAsync(client.BaseAddress, byteContent).Result; if (response.IsSuccessStatusCode) { var responseStream = response.Content.ReadAsStringAsync().Result; res = JsonConvert.DeserializeObject <GetAllDocumentByCustomerIdResponse>(responseStream); } } } catch (Exception ex) { throw ex; } return(res); }
private GetAllDocumentByCustomerIdResponse getDocuments(GetMobileCustomerByIDRequest request) { GetAllDocumentByCustomerIdResponse response = null; LoginController controller = new LoginController(); response = controller.getDocuments(request, token); return(response); }
public MyDouments() { InitializeComponent(); request = new GetMobileCustomerByIDRequest(); response = null; token = App.Current.Properties["currentToken"].ToString(); request.CustomerId = (int)App.Current.Properties["CustomerId"]; RegDocs = new List <Document>(); InsDocs = new List <Document>(); otherDocs = new List <Document>(); }
public GetMobileCustomerByIDResponse getMobileCustomerById(GetMobileCustomerByIDRequest getMobileCustomerByIDRequest, string token) { GetMobileCustomerByIDResponse response = new GetMobileCustomerByIDResponse(); try { response = customerService.getMobileCustomerById(getMobileCustomerByIDRequest, token); } catch (Exception ex) { throw ex; } return(response); }
private GetMobileCustomerByIDResponse getMobileCustomerById(GetMobileCustomerByIDRequest getMobileCustomerByIDRequest, string token) { GetMobileCustomerByIDResponse response = new GetMobileCustomerByIDResponse(); try { response = customoerController.getMobileCustomerById(getMobileCustomerByIDRequest, token); } catch (Exception ex) { throw ex; } return(response); }
public GetAllDocumentByCustomerIdResponse getDocuments(GetMobileCustomerByIDRequest request, string token) { GetAllDocumentByCustomerIdResponse response = new GetAllDocumentByCustomerIdResponse(); try { response = loginservice.getDocuments(request, token); } catch (Exception ex) { throw ex; } return(response); }
public MyProfile() { InitializeComponent(); customoerController = new CustomerController(); token = Application.Current.Properties["currentToken"].ToString(); customerId = (int)Application.Current.Properties["CustomerId"]; getMobileCustomerByIDRequest = new GetMobileCustomerByIDRequest(); getMobileCustomerByIDRequest.CustomerId = customerId; getMobileCustomerResponse = null; portalDetailsMobileRequest = new GetCustomerPortalDetailsMobileRequest(); portalDetailsMobileRequest.customerId = customerId; PortalDetailsMobileResponse = null; GetCustomerAgreementReservationCountRequest = new GetCustomerAgreementReservationCountRequest(); GetCustomerAgreementReservationCountRequest.customerID = customerId; GetCustomerAgreementReservationCountRequest.clientId = Constants.ClientId; }