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 GetAllStateForMobileResponse GetAllStateByCountryID(GetAllStateForMobileRequest stateRequest, string token) { GetAllStateForMobileResponse resp = null; try { using (var client = new HttpClient()) { client.BaseAddress = new Uri(ConstantData.ApiURL.ToString() + "CommonMobile/GetAllStateByCountryIDForMobile"); client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); var myContent = JsonConvert.SerializeObject(stateRequest); 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 <GetAllStateForMobileResponse>(responseStream); } } } catch (Exception ex) { throw ex; } return(resp); }
private void countryPicker_Unfocused(object sender, FocusEventArgs e) { if (countryPicker.SelectedIndex != -1) { string countryName = countryPicker.SelectedItem.ToString(); List <string> stateList = new List <string>(); int? counid = null; foreach (Country c in countryResponse.countryList) { if (c.CountryName == countryName) { counid = c.CountryId; } } ; if (counid != null) { GetAllStateForMobileRequest stateRequest = new GetAllStateForMobileRequest(); stateRequest.CountryID = counid.Value; stateResponse = getStates(stateRequest, _token); if (stateResponse.stateList.Count > 0) { foreach (State s in stateResponse.stateList) { stateList.Add(s.StateName); } ; } statePicker.ItemsSource = stateList; } } }
public AddNewDriver(ReservationView reservationView, CustomerSerach filter) { InitializeComponent(); //want to edit selectedVehicle = null; customer = new CustomerReview(); this.filter = filter; customerID = 0; this.reservationView = reservationView; _token = App.Current.Properties["currentToken"].ToString(); DateOfBithEntry.MaximumDate = DateTime.Now.AddYears(-18); countryResponse = getAllCountry(_token); List <string> countryList = new List <string>(); if (countryResponse.countryList.Count > 0) { foreach (Country k in countryResponse.countryList) { countryList.Add(k.CountryName); } ; } countryPicker.ItemsSource = countryList; countryPicker.SelectedItem = "USA"; List <string> stateList = new List <string>(); int? counid = null; foreach (Country c in countryResponse.countryList) { if (c.CountryName == countryPicker.SelectedItem.ToString()) { counid = c.CountryId; } } ; if (counid != null) { GetAllStateForMobileRequest stateRequest = new GetAllStateForMobileRequest(); stateRequest.CountryID = counid.Value; stateResponse = getStates(stateRequest, _token); if (stateResponse.stateList.Count > 0) { foreach (State s in stateResponse.stateList) { stateList.Add(s.StateName); } ; } statePicker.ItemsSource = stateList; } }
private GetAllStateForMobileResponse getStates(GetAllStateForMobileRequest stateRequest, string token) { CommonController stateController = new CommonController(); GetAllStateForMobileResponse sResponse; sResponse = stateController.GetAllStateByCountryID(stateRequest, token); return(sResponse); }
private void CountryPicker_Unfocused(object sender, FocusEventArgs e) { if (countryPicker.SelectedIndex != -1) { string countryName = countryPicker.SelectedItem.ToString(); List <string> stateList = new List <string>(); int? counid = null; foreach (Country c in countryResponse.countryList) { if (c.CountryName == countryName) { counid = c.CountryId; } } ; if (counid != null) { GetAllStateForMobileRequest stateRequest = new GetAllStateForMobileRequest(); stateRequest.CountryID = counid.Value; stateResponse = getStates(stateRequest, _token); if (stateResponse.stateList.Count > 0) { foreach (State s in stateResponse.stateList) { stateList.Add(s.StateName); } ; } statePicker.ItemsSource = stateList; if (Constants.countriesHasState.Contains((int)counid)) { statePicker.Title = "State"; PostalCodeEntry.Placeholder = "Zip code"; } ; } } }
public AddPersonalInformationPage(CustomerReview customer) { InitializeComponent(); //var assembly = typeof(LoginPage); //NxtBtn.ImageSource = ImageSource.FromResource("NativeCamperVans.Assets.nextIcon.png", assembly); //BacKBtn.ImageSource = ImageSource.FromResource("NativeCamperVans.Assets.backicon.png", assembly); //PhotoBtn.ImageSource = ImageSource.FromResource("NativeCamperVans.Assets.cameraIcon.png", assembly); FirstNameEntry.Keyboard = Keyboard.Create(KeyboardFlags.CapitalizeSentence); this.customer = customer; images = new CustomerImages(); customerSerach = new CustomerSerach(); customerSeachResults = null; _token = App.Current.Properties["currentToken"].ToString(); countryResponse = getAllCountry(_token); List <string> countryList = new List <string>(); if (countryResponse.countryList.Count > 0) { foreach (Country k in countryResponse.countryList) { countryList.Add(k.CountryName); } ; } countryPicker.ItemsSource = countryList; DateOfBithEntry.MaximumDate = DateTime.Now.AddYears(-21); if (Constants.admin != null) { if (Constants.admin.CountryId > 0) { if (Constants.countriesHasState.Contains(Constants.admin.CountryId)) { statePicker.Title = "State"; PostalCodeEntry.Placeholder = "Zip code"; } ; string cliCountry = returnCountryNameByID(Constants.admin.CountryId); if (cliCountry != null) { countryPicker.SelectedItem = cliCountry; } } } else { countryPicker.SelectedItem = "USA"; } List <string> stateList = new List <string>(); int? counid = null; foreach (Country c in countryResponse.countryList) { if (c.CountryName == countryPicker.SelectedItem.ToString()) { counid = c.CountryId; } } ; if (counid != null) { GetAllStateForMobileRequest stateRequest = new GetAllStateForMobileRequest(); stateRequest.CountryID = counid.Value; stateResponse = getStates(stateRequest, _token); if (stateResponse.stateList.Count > 0) { foreach (State s in stateResponse.stateList) { stateList.Add(s.StateName); } ; } statePicker.ItemsSource = stateList; if (countryPicker.SelectedItem.ToString() == "USA") { statePicker.SelectedItem = "GEORGIA"; } } }
protected override async void OnAppearing() { base.OnAppearing(); if (PopupNavigation.Instance.PopupStack.Count > 0) { if (PopupNavigation.Instance.PopupStack[PopupNavigation.Instance.PopupStack.Count - 1].GetType() == typeof(ErrorWithClosePagePopup)) { await PopupNavigation.Instance.PopAllAsync(); } } //MessagingCenter.Subscribe<AddCustomerPhotoPopup>(this, "LicenceFrontImageAdded", sender => //{ // if (licfrontIamgeStat != null) // { // licFrontImage.Source = ImageSource.FromFile(licfrontIamgeStat.PhysicalPath); // } //}); //MessagingCenter.Subscribe<AddCustomerPhotoPopup>(this, "LicenceBackImageAdded", sender => //{ // if (licBackIamgeStat != null) // { // licBackImage.Source = ImageSource.FromFile(licBackIamgeStat.PhysicalPath); // } //}); bool busy = false; if (!busy) { try { busy = true; await PopupNavigation.Instance.PushAsync(new LoadingPopup("Loading details...")); await Task.Run(() => { try { countryResponse = getAllCountry(_token); PortalDetailsMobileResponse = getCustomerDetailsWithProfilePic(portalDetailsMobileRequest, _token); } catch (Exception ex) { PopupNavigation.Instance.PushAsync(new ErrorWithClosePagePopup(ex.Message)); } }); } finally { busy = false; if (PopupNavigation.Instance.PopupStack.Count == 1) { await PopupNavigation.Instance.PopAllAsync(); } else if (PopupNavigation.Instance.PopupStack.Count > 1) { if (PopupNavigation.Instance.PopupStack[PopupNavigation.Instance.PopupStack.Count - 2].GetType() == typeof(editPrrofilePhotoPage)) { await PopupNavigation.Instance.PopAsync(); } else if (PopupNavigation.Instance.PopupStack[PopupNavigation.Instance.PopupStack.Count - 2].GetType() == typeof(AddCustomerPhotoPopup)) { await PopupNavigation.Instance.PopAsync(); } else if (PopupNavigation.Instance.PopupStack[PopupNavigation.Instance.PopupStack.Count - 1].GetType() != typeof(ErrorWithClosePagePopup)) { await PopupNavigation.Instance.PopAllAsync(); } } } List <string> countryList = new List <string>(); if (countryResponse.countryList.Count > 0) { foreach (Country k in countryResponse.countryList) { countryList.Add(k.CountryName); } ; } //countryPicker.ItemsSource = countryList; FirstNameEntry.Text = customerReview.FirstName; oldEmail = customerReview.Email; emailEntry.Text = customerReview.Email; LastNameEntry.Text = customerReview.LastName; AddressEntry.Text = customerReview.Address1 + " " + customerReview.Address2; CityEntry.Text = customerReview.City; licenceNumber.Text = customerReview.LicenseNumber; DateOfBithEntry.Date = (DateTime)customerReview.DateOfbirth; if (customerReview.LicenseIssueDate == null) { licIssueDate.Placeholder = "Licence Issue Date"; } else if (((DateTime)customerReview.LicenseIssueDate).Date == DateTime.Now.Date) { licIssueDate.Placeholder = DateTime.Now.ToString("MM/dd/yyyy"); licIssueDate.Date = (DateTime)customerReview.LicenseIssueDate; } else { licIssueDate.Date = (DateTime)customerReview.LicenseIssueDate; } if (((DateTime)customerReview.LicenseExpiryDate).Date == DateTime.Now.Date) { licenceexpiDate.Placeholder = DateTime.Now.ToString("dd/MM/yyyy"); licenceexpiDate.Date = (DateTime)customerReview.LicenseExpiryDate; } else { licenceexpiDate.Date = (DateTime)customerReview.LicenseExpiryDate; } //if (customerReview.LicenseIssueDate != null) //{ // licenceIssueDate.Date = (DateTime)customerReview.LicenseIssueDate; //} //licenceExpiryDate.Date = (DateTime)customerReview.LicenseExpiryDate; //countryPicker.SelectedItem = customerReview.CountryName; if (PortalDetailsMobileResponse.customerReview != null) { if (PortalDetailsMobileResponse.customerReview.CustomerImages.Count > 0) { if (PortalDetailsMobileResponse.customerReview.CustomerImages[PortalDetailsMobileResponse.customerReview.CustomerImages.Count - 1].Base64 != null) { Images = PortalDetailsMobileResponse.customerReview.CustomerImages[PortalDetailsMobileResponse.customerReview.CustomerImages.Count - 1]; byte[] Base64Stream = Convert.FromBase64String(PortalDetailsMobileResponse.customerReview.CustomerImages[PortalDetailsMobileResponse.customerReview.CustomerImages.Count - 1].Base64); profileImage.Source = ImageSource.FromStream(() => new MemoryStream(Base64Stream)); } } } string countryName = customerReview.CountryName; List <string> stateList = new List <string>(); List <string> stateListForLicence = new List <string>(); int? counid = null; foreach (Country c in countryResponse.countryList) { if (c.CountryName == countryName) { counid = c.CountryId; } } ; if (counid != null) { GetAllStateForMobileRequest stateRequest = new GetAllStateForMobileRequest(); stateRequest.CountryID = counid.Value; stateResponse = getStates(stateRequest, _token); if (stateResponse.stateList.Count > 0) { foreach (State s in stateResponse.stateList) { stateList.Add(s.StateName); stateListForLicence.Add(s.StateCode); } ; } statePicker.ItemsSource = stateList; LicStatePicker.ItemsSource = stateListForLicence; } statePicker.SelectedItem = customerReview.StateName; if (stateListForLicence.Contains(customerReview.LicenseIssueState)) { LicStatePicker.SelectedItem = customerReview.LicenseIssueState; } PostalCodeEntry.Text = customerReview.ZipCode; ContactNoEntry.Text = customerReview.hPhone; } }
public GetAllStateForMobileResponse GetAllStateByCountryID(GetAllStateForMobileRequest stateRequest, string token) { return(commonService.GetAllStateByCountryID(stateRequest, token)); }