//public SummaryOfChargesPage() //{ // //if ((int)App.Current.Properties["CustomerId"] == 0) // //{ // // loginIcon.IconImageSource = ImageSource.FromResource("BespokeMobile.Assets.LogInTool.png", assembly); // //} // //else // //{ // // loginIcon.IconImageSource = ImageSource.FromResource("BespokeMobile.Assets.logOutTool.png", assembly); // //} //} public SummaryOfChargesPage(ReservationView reservationView, VehicleViewByTypeForMobile selectedVehicle) { InitializeComponent(); var assembly = typeof(SummaryOfChargesPage); this.reservationView = reservationView; summaryMobileRequest = new GetCalculateSummaryMobileRequest(); summaryMobileResponsecs = null; ReservationMobileResponse = null; ReservationMobileRequest = new CreateReservationMobileRequest(); summaryMobileRequest.reservation = reservationView; token = App.Current.Properties["currentToken"].ToString(); termsandConditionByTypeRequest = new GetTermsandConditionByTypeRequest(); termsandConditionByTypeRequest.clientId = Constants.ClientId; termsandConditionByTypeRequest.typeId = 3; termsandConditionByTypeResponse = null; this.selectedVehicle = selectedVehicle; startDateLabel.Text = ((DateTime)reservationView.StartDate).ToString("ddd MM/dd/yyyy"); endDateLabel.Text = ((DateTime)reservationView.EndDate).ToString("ddd MM/dd/yyyy"); startTimeLabel.Text = ((DateTime)reservationView.StartDate).ToString("hh:mm tt"); endTimeLabel.Text = ((DateTime)reservationView.EndDate).ToString("hh:mm tt"); if (selectedVehicle.VehicleTypeImageUrl != null) { vehilcleTypeImage.Source = ImageSource.FromUri(new Uri(selectedVehicle.VehicleTypeImageUrl)); } vehicleSampleLabel.Text = selectedVehicle.sample; vehilcleTypeLabel.Text = selectedVehicle.VehicleType; priceLabel.Text = "$ " + selectedVehicle.RateDetail.RateTotal.ToString(); emailInvoiceRequest = new EmailInvoiceRequest(); emailResponse = null; }
public InvoiceEmailResponse sendReservationEmail(EmailInvoiceRequest emailInvoiceRequest, string token) { InvoiceEmailResponse result = null; try { using (var client = new HttpClient()) { client.BaseAddress = new Uri(ConstantData.ApiURL.ToString() + "Email/SendEmail"); client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); var myContent = JsonConvert.SerializeObject(emailInvoiceRequest); 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 <InvoiceEmailResponse>(responseStream); } } } catch (Exception ex) { throw ex; } return(result); }
public InvoiceEmailResponse sendReservationEmail(EmailInvoiceRequest emailInvoiceRequest, string token) { InvoiceEmailResponse mobileResponse = null; try { mobileResponse = reservationservice.sendReservationEmail(emailInvoiceRequest, token); } catch (Exception ex) { throw ex; } return(mobileResponse); }
//public SummaryOfChargesPage() //{ // //if ((int)App.Current.Properties["CustomerId"] == 0) // //{ // // loginIcon.IconImageSource = ImageSource.FromResource("MaxVonGrafKftMobile.Assets.LogInTool.png", assembly); // //} // //else // //{ // // loginIcon.IconImageSource = ImageSource.FromResource("MaxVonGrafKftMobile.Assets.logOutTool.png", assembly); // //} //} public SummaryOfChargesPage(ReservationView reservationView, VehicleViewByTypeForMobile selectedVehicle) { InitializeComponent(); var assembly = typeof(SummaryOfChargesPage); this.reservationView = reservationView; summaryMobileRequest = new GetCalculateSummaryMobileRequest(); summaryMobileResponsecs = null; ReservationMobileResponse = null; ReservationMobileRequest = new CreateReservationMobileRequest(); summaryMobileRequest.reservation = reservationView; token = App.Current.Properties["currentToken"].ToString(); termsandConditionByTypeRequest = new GetTermsandConditionByTypeRequest(); termsandConditionByTypeRequest.clientId = Constants.ClientId; termsandConditionByTypeRequest.typeId = 3; termsandConditionByTypeResponse = null; this.selectedVehicle = selectedVehicle; startDateLabel.Text = ((DateTime)reservationView.StartDate).ToString("ddd MM/dd/yyyy"); endDateLabel.Text = ((DateTime)reservationView.EndDate).ToString("ddd MM/dd/yyyy"); startTimeLabel.Text = ((DateTime)reservationView.StartDate).ToString("hh:mm tt"); endTimeLabel.Text = ((DateTime)reservationView.EndDate).ToString("hh:mm tt"); if (selectedVehicle.VehicleImageUrl != null) { vehilcleTypeImage.Source = ImageSource.FromUri(new Uri(selectedVehicle.VehicleImageUrl)); } vehicleSampleLabel.Text = selectedVehicle.vehicleName; vehilcleTypeLabel.Text = selectedVehicle.VehicleType; priceLabel.Text = "Days: " + selectedVehicle.RateDetail.TotalDays.ToString(); emailInvoiceRequest = new EmailInvoiceRequest(); emailResponse = null; creditCardRequest = new GetAllCustomerMobileCreditCardRequest(); creditCards = null; customerId = (int)App.Current.Properties["CustomerId"]; billingInformation = new BillingInformation(); submitPaymentandCreateReservationRequest = new SubmitPaymentandCreateReservationRequest(); PaymentResponse = null; //imgSelect.Source = "iconCircleSelected.png"; }