예제 #1
0
        public UpdateCustomerProfileDetailsMobileResponse updateUser(UpdateCustomerProfileDetailsMobileRequest profileDetailsMobileRequest, string token)
        {
            UpdateCustomerProfileDetailsMobileResponse response = null;

            try
            {
                response = registerservice.updateUser(profileDetailsMobileRequest, token);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(response);
        }
예제 #2
0
        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);
        }
예제 #3
0
        public UpdateCustomerProfileDetailsMobileResponse updateUser(UpdateCustomerProfileDetailsMobileRequest profileDetailsMobileRequest, string token)
        {
            UpdateCustomerProfileDetailsMobileResponse resp = null;

            try
            {
                using (HttpClient client = new HttpClient())
                {
                    client.BaseAddress = new Uri(ConstantData.ApiURL.ToString() + "CustomerMobile/Update");
                    client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
                    client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);

                    var myContent   = JsonConvert.SerializeObject(profileDetailsMobileRequest);
                    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 <UpdateCustomerProfileDetailsMobileResponse>(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);
        }