コード例 #1
0
        public GetCustomerAgreementReservationCountResponse GetCustomerAgreementReservationCount(GetCustomerAgreementReservationCountRequest getCustomerAgreementReservationCountRequest, string token)
        {
            GetCustomerAgreementReservationCountResponse result = null;

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

                    var myContent   = JsonConvert.SerializeObject(getCustomerAgreementReservationCountRequest);
                    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;
                        result = JsonConvert.DeserializeObject <GetCustomerAgreementReservationCountResponse>(responseStream);
                    }
                }
            }

            catch (Exception ex)
            {
                throw ex;
            }
            return(result);
        }
コード例 #2
0
        public GetCustomerAgreementReservationCountResponse GetCustomerAgreementReservationCount(GetCustomerAgreementReservationCountRequest getCustomerAgreementReservationCountRequest, string token)
        {
            GetCustomerAgreementReservationCountResponse response = new GetCustomerAgreementReservationCountResponse();

            try
            {
                response = customerService.GetCustomerAgreementReservationCount(getCustomerAgreementReservationCountRequest, token);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(response);
        }
コード例 #3
0
        private GetCustomerAgreementReservationCountResponse GetCustomerAgreementReservationCount(GetCustomerAgreementReservationCountRequest getCustomerAgreementReservationCountRequest, string token)
        {
            GetCustomerAgreementReservationCountResponse response = new GetCustomerAgreementReservationCountResponse();

            try
            {
                response = customoerController.GetCustomerAgreementReservationCount(getCustomerAgreementReservationCountRequest, token);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(response);
        }
コード例 #4
0
        protected override async void OnAppearing()
        {
            base.OnAppearing();

            if (PopupNavigation.Instance.PopupStack.Count > 0)
            {
                await PopupNavigation.Instance.PopAllAsync();
            }


            bool busy = false;

            if (!busy)
            {
                try
                {
                    busy = true;
                    await PopupNavigation.Instance.PushAsync(new LoadingPopup("Loading profile..."));

                    await Task.Run(async() =>
                    {
                        try
                        {
                            //customerReview = getCustomerById(customerId, token);
                            getMobileCustomerResponse   = getMobileCustomerById(getMobileCustomerByIDRequest, token);
                            PortalDetailsMobileResponse = getCustomerDetailsWithProfilePic(portalDetailsMobileRequest, token);
                            reservationCountResponse    = GetCustomerAgreementReservationCount(GetCustomerAgreementReservationCountRequest, token);
                        }
                        catch (Exception ex)
                        {
                            await PopupNavigation.Instance.PushAsync(new ErrorWithClosePagePopup(ex.Message));
                        }
                    });
                }
                finally
                {
                    busy           = false;
                    customerReview = getMobileCustomerResponse.customerDetails;
                    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 - 1].GetType() != typeof(ErrorWithClosePagePopup))
                        {
                            await PopupNavigation.Instance.PopAllAsync();
                        }
                    }
                }
                if (getMobileCustomerResponse.message.ErrorCode == "200")
                {
                    if (customerReview != null)
                    {
                        firstNameLabel.Text = customerReview.FirstName;
                        LastNameLabel.Text  = customerReview.LastName;
                        dobLabel.Text       = string.Format("{0:MMMM d, yyyy}", customerReview.DateOfbirth);
                        addressLabel.Text   = customerReview.Address1 + customerReview.Address2 + ", " + customerReview.City + ", " + customerReview.ZipCode + ", " + customerReview.CountryName;
                        MobileNoLabel.Text  = String.Format("{0:(###) ###-####}", long.Parse(customerReview.hPhone));
                        EmailLabel.Text     = customerReview.Email;

                        if (PortalDetailsMobileResponse != null)
                        {
                            if (PortalDetailsMobileResponse.customerReview != null)
                            {
                                if (PortalDetailsMobileResponse.customerReview.CustomerImages.Count > 0)
                                {
                                    if (PortalDetailsMobileResponse.customerReview.CustomerImages[PortalDetailsMobileResponse.customerReview.CustomerImages.Count - 1].Base64 != null)
                                    {
                                        byte[] Base64Stream = Convert.FromBase64String(PortalDetailsMobileResponse.customerReview.CustomerImages[PortalDetailsMobileResponse.customerReview.CustomerImages.Count - 1].Base64);
                                        profileImage.Source = ImageSource.FromStream(() => new MemoryStream(Base64Stream));
                                    }
                                }
                            }
                        }
                    }
                    if (reservationCountResponse != null)
                    {
                        //totalReservationNoLabel.Text = reservationCountResponse.custTotcount.totalReservationCount.ToString();
                        totalagreementNoLabel.Text = reservationCountResponse.custTotcount.totalAgreementCount.ToString();
                    }
                    else
                    {
                        await PopupNavigation.Instance.PushAsync(new ErrorWithClosePagePopup(reservationCountResponse.message.ErrorMessage + " Error in getting Toatal reservation and agreement count"));
                    }
                }

                else
                {
                    await PopupNavigation.Instance.PushAsync(new ErrorWithClosePagePopup(getMobileCustomerResponse.message.ErrorMessage));
                }
            }
        }