public OtherInformationPage(CustomerReview customer, CustomerImages images) { InitializeComponent(); this.customer = customer; licenceIssueDate.MaximumDate = DateTime.Now; licenceExpiryDate.MinimumDate = DateTime.Now; _token = App.Current.Properties["currentToken"].ToString(); GetAllStateForMobileRequest stateRequest = new GetAllStateForMobileRequest(); List <string> stateList = new List <string>(); stateRequest.CountryID = (int)customer.CountryId; stateResponse = getStates(stateRequest, _token); if (stateResponse.stateList.Count > 0) { foreach (State s in stateResponse.stateList) { stateList.Add(s.StateCode); } ; } licenceStatePicker.ItemsSource = stateList; imageMobileRequest = new UploadCustomerImageMobileRequest(); imageMobileResponse = null; this.images = images; licExpireDateSelected = false; licIssueDateSelected = false; licfrontIamgeStat = new CustomerImages(); licBackIamgeStat = new CustomerImages(); LicenceImagesRequest = new AddLicenceImagesRequest(); licenceImageResponse = null; }
public editPrrofilePhotoPage() { InitializeComponent(); images = new CustomerImages(); customerID = (int)App.Current.Properties["CustomerId"]; _token = App.Current.Properties["currentToken"].ToString(); imageMobileRequest = new UploadCustomerImageMobileRequest(); imageMobileResponse = null; }
public UploadCustomerImageMobileResponse addCustomerImage(UploadCustomerImageMobileRequest imageMobileRequest, string _token) { UploadCustomerImageMobileResponse response = null; try { response = registerservice.addCustomerImage(imageMobileRequest, _token); } catch (Exception ex) { throw ex; } return(response); }
public editPrrofilePhotoPage(CustomerImages images) { InitializeComponent(); customerID = (int)App.Current.Properties["CustomerId"]; _token = App.Current.Properties["currentToken"].ToString(); imageMobileRequest = new UploadCustomerImageMobileRequest(); imageMobileResponse = null; this.images = images; selectedImage.Source = ImageSource.FromStream(() => new MemoryStream(Convert.FromBase64String(images.Base64))); _base64Image = images.Base64; UploadedDate = DateTime.Now; PhysicalPath = images.PhysicalPath; if (images.Base64 != null) { PhotoFrame.IsVisible = true; SaveBtn.IsVisible = true; cancelBtn.IsVisible = true; } }
public UploadCustomerImageMobileResponse addCustomerImage(UploadCustomerImageMobileRequest imageMobileRequest, string token) { UploadCustomerImageMobileResponse resp = null; try { using (HttpClient client = new HttpClient()) { client.BaseAddress = new Uri(ConstantData.ApiURL.ToString() + "CustomerMobile/UploadImage"); client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); var myContent = JsonConvert.SerializeObject(imageMobileRequest); var buffer = System.Text.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; resp = JsonConvert.DeserializeObject <UploadCustomerImageMobileResponse>(responseStream); } else { ApiMessage mes = new ApiMessage(); mes.ErrorCode = response.StatusCode.ToString(); mes.ErrorMessage = response.ReasonPhrase.ToString(); mes.Status = response.IsSuccessStatusCode.ToString(); resp.message = mes; } } } catch (Exception ex) { throw ex; } return(resp); }