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; }
private void navigateNextPage() { customer.FirstName = FirstNameEntry.Text; customer.LastName = LastNameEntry.Text; customer.DateOfbirth = DateOfBithEntry.Date; customer.Address1 = AddressEntry.Text; customer.City = CityEntry.Text; customer.CountryId = returnCountryIdByCountryName(countryPicker.SelectedItem.ToString()); customer.CountryName = countryPicker.SelectedItem.ToString(); customer.StateId = returnStateIdByStateName(statePicker.SelectedItem.ToString()); customer.StateName = statePicker.SelectedItem.ToString(); customer.ZipCode = PostalCodeEntry.Text; customer.hPhone = ContactNoEntry.Text; if (images != null) { if (images.Base64 != null) { //List<CustomerImages> customerIm = new List<CustomerImages>(); //customerIm.Add(images); //customer.CustomerImages = customerIm; Navigation.PushAsync(new OtherInformationPage(customer, images)); } else { images = null; Navigation.PushAsync(new OtherInformationPage(customer, images)); } } }
public editPrrofilePhotoPage() { InitializeComponent(); images = new CustomerImages(); customerID = (int)App.Current.Properties["CustomerId"]; _token = App.Current.Properties["currentToken"].ToString(); imageMobileRequest = new UploadCustomerImageMobileRequest(); imageMobileResponse = null; }
public UpdateProfile(CustomerReview customerReview) { InitializeComponent(); DateOfBithEntry.MaximumDate = DateTime.Now.AddYears(-18); //licIssueDate.MaximumDate = DateTime.Now; licenceexpiDate.MinimumDate = DateTime.Now; this.customerReview = customerReview; _token = App.Current.Properties["currentToken"].ToString(); customerId = (int)Application.Current.Properties["CustomerId"]; countryResponse = null; stateResponse = null; ProfileDetailsMobileRequest = new UpdateCustomerProfileDetailsMobileRequest(); profileDetailsMobileResponse = null; portalDetailsMobileRequest = new GetCustomerPortalDetailsMobileRequest(); portalDetailsMobileRequest.customerId = customerId; PortalDetailsMobileResponse = null; customoerController = new CustomerController(); Images = null; //licenceIssueDate.MaximumDate = DateTime.Now; //licenceExpiryDate.MinimumDate = DateTime.Now; licExpireDateSelected = false; licIssueDateSelected = false; licfrontIamgeStat = new CustomerImages(); licBackIamgeStat = new CustomerImages(); LicenceImagesRequest = new AddLicenceImagesRequest(); licenceImageResponse = null; var editPhoto = new TapGestureRecognizer(); editPhoto.Tapped += (s, e) => { if (Images != null) { if (Images.Base64 == null) { PopupNavigation.PushAsync(new editPrrofilePhotoPage()); } else { PopupNavigation.PushAsync(new editPrrofilePhotoPage(Images)); } } else { PopupNavigation.PushAsync(new editPrrofilePhotoPage()); } }; profileImage.GestureRecognizers.Add(editPhoto); }
public AddCustomerPhotoPopup(CustomerImages images) { InitializeComponent(); 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 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; } }
private void SaveBtn_Clicked(object sender, EventArgs e) { CustomerImages customerImages = new CustomerImages(); RegisterController registerController = new RegisterController(); images.UploadedDate = UploadedDate; images.Base64 = _base64Image; images.PhysicalPath = PhysicalPath; if (images != null && customerID > 0) { imageMobileRequest.custImag = images; imageMobileRequest.custImag.CustomerID = customerID; imageMobileRequest.custImag.ImageID = customerID; imageMobileRequest.custImag.Title = "My Image"; imageMobileRequest.custImag.FileName = "My Image"; imageMobileRequest.custImag.Description = "My ImageMy ImageMy Image"; imageMobileResponse = registerController.addCustomerImage(imageMobileRequest, _token); } Navigation.PushAsync(new MyProfile()); }
public AddCustomerPhotoPopup(CustomerImages images, int v) { InitializeComponent(); this.v = v; 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; } if (v == 1) { title.Text = "Licence Front Image"; } else if (v == 2) { title.Text = "Licence Back Image"; } }
private void SaveBtn_Clicked(object sender, EventArgs e) { if (images == null) { images = new CustomerImages(); } images.UploadedDate = DateTime.Now; images.Base64 = _base64Image; images.PhysicalPath = PhysicalPath; if (v == 1) { MessagingCenter.Send(this, "LicenceFrontImageAdded"); } else if (v == 2) { MessagingCenter.Send(this, "LicenceBackImageAdded"); } else { MessagingCenter.Send(this, "profilePhotoAdded"); } PopupNavigation.Instance.PopAllAsync(); }
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; } }
private void navigateNextPage() { customer.FirstName = FirstNameEntry.Text; customer.LastName = LastNameEntry.Text; customer.DateOfbirth = DateOfBithEntry.Date; if (!string.IsNullOrEmpty(Address2Entry.Text)) { customer.Address1 = AddressEntry.Text + " " + Address2Entry.Text; } else { customer.Address1 = AddressEntry.Text; } customer.City = CityEntry.Text; customer.CountryId = returnCountryIdByCountryName(countryPicker.SelectedItem.ToString()); customer.CountryName = countryPicker.SelectedItem.ToString(); customer.StateId = returnStateIdByStateName(statePicker.SelectedItem.ToString()); customer.StateName = statePicker.SelectedItem.ToString(); customer.ZipCode = PostalCodeEntry.Text; customer.hPhone = ContactNoEntry.Text.Replace(" ", "").Replace("(", "").Replace(")", "").Replace("-", ""); if (images != null) { if (images.Base64 != null) { //List<CustomerImages> customerIm = new List<CustomerImages>(); //customerIm.Add(images); //customer.CustomerImages = customerIm; if (fromVal == 1) { Navigation.PushModalAsync(new OtherInformationPage(customer, images, fromVal)); } else { Navigation.PushModalAsync(new OtherInformationPage(customer, images)); } } else { images = null; if (fromVal == 1) { Navigation.PushModalAsync(new OtherInformationPage(customer, images, fromVal)); } else { Navigation.PushModalAsync(new OtherInformationPage(customer, images)); } } } else { if (fromVal == 1) { Navigation.PushModalAsync(new OtherInformationPage(customer, images, fromVal)); } else { Navigation.PushModalAsync(new OtherInformationPage(customer, images)); } } }
private async void SaveBtn_Clicked(object sender, EventArgs e) { CustomerImages customerImages = new CustomerImages(); RegisterController registerController = new RegisterController(); images.UploadedDate = UploadedDate; images.Base64 = _base64Image; images.PhysicalPath = PhysicalPath; if (images != null && customerID > 0) { imageMobileRequest.custImag = images; imageMobileRequest.custImag.CustomerID = customerID; imageMobileRequest.custImag.ImageID = customerID; imageMobileRequest.custImag.Title = "My Image"; imageMobileRequest.custImag.FileName = "My Image"; imageMobileRequest.custImag.Description = "My ImageMy ImageMy Image"; bool busy = false; if (!busy) { try { busy = true; await PopupNavigation.Instance.PushAsync(new LoadingPopup("Loading details...")); await Task.Run(() => { try { imageMobileResponse = registerController.addCustomerImage(imageMobileRequest, _token); } catch (Exception ex) { PopupNavigation.Instance.PushAsync(new ErrorWithClosePagePopup(ex.Message)); } finally { if (imageMobileResponse != null) { if (imageMobileResponse.message != null) { if (imageMobileResponse.message.ErrorCode == "200") { if (Constants.customerDetails.CustomerImages == null) { Constants.customerDetails.CustomerImages = new List <CustomerImages>(); } Constants.customerDetails.CustomerImages.Add(new CustomerImages() { Base64 = _base64Image }); } } } } }); } finally { await PopupNavigation.Instance.PopAsync(); busy = false; } } } await Navigation.PopModalAsync(); }
public OtherInformationPage(CustomerReview customer, CustomerImages images, int fromVal) : this(customer, images) { this.fromVal = fromVal; }