Exemple #1
0
        private async void updateAgreement()
        {
            ExtendAgreementRequest  request  = new ExtendAgreementRequest();
            ExtendAgreementResponse response = null;

            request.agreementId = agreementDetail.AgreementID;
            request.extendDate  = agreementDetail.CheckinDate.AddDays(int.Parse(NumberOfDays.SelectedItem.ToString())).ToString("MM/dd/yyyy hh:mm tt").Replace("PM", "pm").Replace("AM", "am");

            int agreementID = 0;
            //AgreementReview agreementReview = new AgreementReview();
            //agreementReview = agreementDetail;
            //agreementReview.OldChcekInDate = agreementReview.CheckinDate;
            //agreementReview.CheckinDate = extendedDate.Date + extendedTime.Time;
            //agreementReview.CheckinDateString = (extendedDate.Date + extendedTime.Time).ToString();
            //agreementReview.CheckoutDateString = agreementReview.CheckoutDate.ToString();
            //agreementReview.AgreementReferral = new Referral();
            //agreementReview.UpdatedDate = DateTime.Now;
            //agreementReview.ChangedDate = DateTime.Now;
            //agreementReview.AgreementStatus = NativeCamperVansModel.Constants.AgreementStatusConst.Open;
            //agreementReview.AgreementInsurance = new AgreementInsurence();
            //agreementReview.Customer = new Customer();
            AgreementController controller = new AgreementController();
            bool isAgBusy = false;

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

                    await Task.Run(() =>
                    {
                        response = controller.extendAgreement(request, _token);
                    });
                }
                catch (Exception ex)
                {
                    await PopupNavigation.Instance.PushAsync(new Error_popup(ex.Message));
                }
                finally
                {
                    isAgBusy = false;
                    await PopupNavigation.Instance.PopAsync();

                    if (response != null)
                    {
                        if (response.message.ErrorCode == "200")
                        {
                            MessagingCenter.Send(this, "agreementUpdated");
                            await PopupNavigation.Instance.PopAllAsync();
                        }
                        else
                        {
                            await PopupNavigation.Instance.PushAsync(new Error_popup("Update failed. Please try again."));
                        }
                    }
                }
            }
        }
        private void updateAgreement()
        {
            ExtendAgreementRequest  request  = new ExtendAgreementRequest();
            ExtendAgreementResponse response = null;

            request.agreementId = agreementDetail.AgreementID;
            request.extendDate  = agreementDetail.CheckinDate.AddDays(int.Parse(NumberOfDays.SelectedItem.ToString())).ToString("MM/dd/yyyy hh:mm tt").Replace("PM", "pm").Replace("AM", "am");

            int agreementID = 0;
            //AgreementReview agreementReview = new AgreementReview();
            //agreementReview = agreementDetail;
            //agreementReview.OldChcekInDate = agreementReview.CheckinDate;
            //agreementReview.CheckinDate = extendedDate.Date + extendedTime.Time;
            //agreementReview.CheckinDateString = (extendedDate.Date + extendedTime.Time).ToString();
            //agreementReview.CheckoutDateString = agreementReview.CheckoutDate.ToString();
            //agreementReview.AgreementReferral = new Referral();
            //agreementReview.UpdatedDate = DateTime.Now;
            //agreementReview.ChangedDate = DateTime.Now;
            //agreementReview.AgreementStatus = BespokeMobileModel.Constants.AgreementStatusConst.Open;
            //agreementReview.AgreementInsurance = new AgreementInsurence();
            //agreementReview.Customer = new Customer();
            AgreementController controller = new AgreementController();

            response = controller.extendAgreement(request, _token);
            if (response.message.ErrorCode == "200")
            {
                MessagingCenter.Send(this, "agreementUpdated");
                PopupNavigation.Instance.PopAllAsync();
            }
            else
            {
                PopupNavigation.Instance.PushAsync(new Error_popup("Update failed. Please try again."));
            }
            PopupNavigation.Instance.PopAllAsync();
        }
        private void applyAgreementPromotion(GetPromotionMobileResponse promotionMobileResponse)
        {
            extendAgreemetRequest.addPromotion = new PromotionItem()
            {
                PromotionID = promotionMobileResponse.PromResult.PromotionID, PromotionDiscount = (decimal)promotionMobileResponse.PromResult.DiscountValue, PromotionCode = promotionMobileResponse.promotion.PromotionCode
            };
            extendAgreemetRequest.deletePromotion = null;
            promoTitileLabel.Text = promotionMobileResponse.promotion.PromotionCode;
            promoDetailLabel.Text = "$" + promotionMobileResponse.promotion.DiscountValue.ToString("0.00");
            appliedPromoId        = promotionMobileResponse.PromResult.PromotionID;
            hideAddPromotionGrid();
            AgreementController controller = new AgreementController();

            try
            {
                extendAgreementResponse = controller.extendAgreement(extendAgreemetRequest, token);
            }

            finally
            {
                if (extendAgreementResponse != null)
                {
                    if (extendAgreementResponse.message != null)
                    {
                        if (extendAgreementResponse.message.ErrorCode == "200")
                        {
                            balanceDue = (decimal)extendAgreementResponse.agreementReview.BalanceDue;
                            if (balanceDue <= 0)
                            {
                                balanceDue = 0;
                            }
                            agreementReview  = extendAgreementResponse.agreementReview;
                            amountLAbel.Text = "$ " + balanceDue.ToString("0.00");

                            foreach (PromotionItem p in extendAgreementResponse.agreementReview.PromotionList)
                            {
                                if (p.PromotionID == appliedPromoId)
                                {
                                    promoDetailLabel.Text = "$" + p.PromotionDiscount.ToString("0.00");
                                }
                            }

                            int ordNo = 1;
                            foreach (PromotionItem p1 in agreementReview.PromotionList)
                            {
                                p1.PromotionListId = ordNo;
                                ordNo += 1;
                            }
                        }
                    }
                }
            }
        }
Exemple #4
0
        private AddAgreementSignMobileResponse saveSignature(AddAgreementSignMobileRequest signMobileRequest, string token)
        {
            AgreementController            agreementController = new AgreementController();
            AddAgreementSignMobileResponse response            = null;

            try
            {
                response = agreementController.saveSignature(signMobileRequest, token);
            }
            catch (Exception e)
            {
                throw e;
            }
            return(response);
        }
Exemple #5
0
        private ReloadSignatureImageURLMobileResponse getDamageSignature(ReloadSignatureImageURLMobileRequest imageURLMobileRequest, string token)
        {
            ReloadSignatureImageURLMobileResponse response = null;
            AgreementController controller = new AgreementController();

            try
            {
                response = controller.getDamageSignature(imageURLMobileRequest, token);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(response);
        }
Exemple #6
0
        private GetAgreementByAgreementIdMobileResponse getAgreement(GetAgreementByAgreementIdMobileRequest agreementByAgreementIdMobileRequest, string token)
        {
            AgreementController agreementController          = new AgreementController();
            GetAgreementByAgreementIdMobileResponse response = null;

            try
            {
                response = agreementController.getAgreement(agreementByAgreementIdMobileRequest, token, 0);
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(response);
        }
        private GetAgreementByCustomerIdMobileResponse getAgreementMobile(getAgreementByCustomerIdMobileRequest getAgreementByCustomerIdMobileRequest, string token)
        {
            AgreementController agreementController = new AgreementController();
            GetAgreementByCustomerIdMobileResponse response;

            try
            {
                response = agreementController.getAgreementMobile(getAgreementByCustomerIdMobileRequest, token);
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(response);
        }
        private async void SaveBtn_Clicked(object sender, EventArgs e)
        {
            vehicleImage.base64Img = _base64Image;
            AgreementController controller = new AgreementController();

            bool busy = false;

            if (!busy)
            {
                try
                {
                    busy = true;
                    await PopupNavigation.Instance.PushAsync(new LoadingPopup("Updating Vehicle Image"));

                    await Task.Run(() =>
                    {
                        addfourTypeVehicleImagesResponse = controller.addfourTypeVehicleImages(vehicleImage, token);
                    });
                }
                finally
                {
                    if (addfourTypeVehicleImagesResponse.message != null)
                    {
                        if (addfourTypeVehicleImagesResponse.message.ErrorCode == "200")
                        {
                            MessagingCenter.Send(this, "MyItemsChanged");
                            await PopupNavigation.Instance.PushAsync(new SuccessPopUp("Vehicle Image Saved Successfully"));
                        }
                        else
                        {
                            await PopupNavigation.Instance.PushAsync(new Error_popup(addfourTypeVehicleImagesResponse.message.ErrorMessage));

                            vehicleImage.base64Img = null;
                        }
                    }
                    else
                    {
                        await PopupNavigation.Instance.PushAsync(new Error_popup("Image Saving Failed"));

                        vehicleImage.base64Img = null;
                    }
                }
            }
        }
Exemple #9
0
        private GetAgreementByAgreementIdMobileResponse getAgreement(GetAgreementByAgreementIdMobileRequest agreementByAgreementIdMobileRequest, string token, int vehicleId)
        {
            AgreementController agreementController          = new AgreementController();
            GetAgreementByAgreementIdMobileResponse response = null;

            try
            {
                response = agreementController.getAgreement(agreementByAgreementIdMobileRequest, token, vehicleId);
                //getVehicleDetailsMobile = vehicleController.getVehicleTypesMobile(token);
                //foreach(VehicleTypeMobileResult vtmr in getVehicleDetailsMobile.listVehicle)
                //{
                //    if(vtmr.ve)
                //}
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(response);
        }
Exemple #10
0
        private void refreshBalance()
        {
            DateTime     timeUtc = DateTime.UtcNow;
            TimeZoneInfo estZone = TimeZoneInfo.FindSystemTimeZoneById("America/New_York");

            estTime            = TimeZoneInfo.ConvertTimeFromUtc(timeUtc, estZone);
            request.extendDate = estTime.ToString("MM/dd/yyyy hh:mm tt").Replace("PM", "pm").Replace("AM", "am");
            AgreementController controller = new AgreementController();

            response = controller.extendAgreement(request, _token);

            if (response != null)
            {
                if (response.agreementReview != null)
                {
                    if (response.agreementReview.BalanceDue != null)
                    {
                        averDueStack.IsVisible    = true;
                        overdueBalanceAmount.Text = ((decimal)response.agreementReview.BalanceDue).ToString("0.00");
                    }
                }
            }
        }
Exemple #11
0
        private async void updateAgreement()
        {
            ExtendAgreementRequest  request  = new ExtendAgreementRequest();
            ExtendAgreementResponse response = null;

            request.agreementId = agreementDetail.AgreementID;
            request.extendDate  = agreementDetail.CheckinDate.AddDays(int.Parse(NumberOfDays.SelectedItem.ToString())).ToString("MM/dd/yyyy hh:mm tt").Replace("PM", "pm").Replace("AM", "am");

            //AgreementReview agreementReview = new AgreementReview();
            //agreementReview = agreementDetail;
            //agreementReview.OldChcekInDate = agreementReview.CheckinDate;
            //agreementReview.CheckinDate = extendedDate.Date + extendedTime.Time;
            //agreementReview.CheckinDateString = (extendedDate.Date + extendedTime.Time).ToString();
            //agreementReview.CheckoutDateString = agreementReview.CheckoutDate.ToString();
            //agreementReview.AgreementReferral = new Referral();
            //agreementReview.UpdatedDate = DateTime.Now;
            //agreementReview.ChangedDate = DateTime.Now;
            //agreementReview.AgreementStatus = MaxVonGrafKftMobileModel.Constants.AgreementStatusConst.Open;
            //agreementReview.AgreementInsurance = new AgreementInsurence();
            //agreementReview.Customer = new Customer();
            AgreementController controller = new AgreementController();
            bool isAgBusy = false;

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

                    await Task.Run(() =>
                    {
                        response = controller.extendAgreement(request, _token);
                    });
                }
                catch (Exception ex)
                {
                    await PopupNavigation.Instance.PushAsync(new Error_popup(ex.Message));
                }
                finally
                {
                    isAgBusy = false;
                    await PopupNavigation.Instance.PopAsync();

                    if (response != null)
                    {
                        if (response.message != null)
                        {
                            if (response.message.ErrorCode == "200")
                            {
                                if (response.agreementReview.BalanceDue > 0)
                                {
                                    await Navigation.PushModalAsync(new ProcessPaymentPage((decimal)response.agreementReview.BalanceDue, response.agreementReview.AgreementID, locationIdForPayment, response.agreementReview, request));
                                }
                                else
                                {
                                    await PopupNavigation.Instance.PushAsync(new Error_popup("Sorry, Something went wrong , Please try again. "));
                                }
                            }
                            else
                            {
                                await PopupNavigation.Instance.PushAsync(new Error_popup("Sorry, Update failed, Please try again. "));
                            }
                        }
                        else
                        {
                            await PopupNavigation.Instance.PushAsync(new Error_popup("Sorry, Update failed, Please try again. "));
                        }
                    }
                    else
                    {
                        await PopupNavigation.Instance.PushAsync(new Error_popup("Sorry, Update failed, Please try again. "));
                    }
                }
            }
            //if (response.message.ErrorCode == "200")
            //{
            //    //MessagingCenter.Send(this, "agreementUpdated");
            //    PopupNavigation.Instance.PopAllAsync();
            //}
        }
        async void promoDeleteBtn_Clicked(System.Object sender, System.EventArgs e)
        {
            if (appliedPromoId > 0 && !isExtendAgreement)
            {
                reservationView.PromotionList    = reservationView.PromotionList.FindAll(et => et.PromotionID != appliedPromoId);
                summaryMobileRequest.reservation = reservationView;
                try
                {
                    try
                    {
                        summaryMobileResponsecs = getSummaryDetails(summaryMobileRequest, token);
                    }
                    catch (Exception ex)
                    {
                        throw ex;
                    }
                }
                finally
                {
                    //amountWantToPay
                    decimal amountWant = 0;
                    if (summaryMobileResponsecs.rate.ReservationSummary.EstimatedTotal == null)
                    {
                        amountWant = (decimal)summaryMobileResponsecs.rate.EstimatedTotal - reservationView.AdvancedPayment;
                    }
                    else
                    {
                        amountWant = Convert.ToDecimal(summaryMobileResponsecs.rate.ReservationSummary.EstimatedTotal) - reservationView.AdvancedPayment;
                    }
                    amountWantToPay = amountWant;

                    amountLAbel.Text = "$ " + amountWantToPay.ToString("0.00");

                    reservationView.BasePrice               = Convert.ToDecimal(summaryMobileResponsecs.rate.ReservationSummary.FinalBaseRate);
                    reservationView.PreSubTotal             = Convert.ToDecimal(summaryMobileResponsecs.rate.ReservationSummary.PreSubTotal);
                    reservationView.TotalDiscountOnBaseRate = Convert.ToDecimal(summaryMobileResponsecs.rate.ReservationSummary.PromoDiscountOnBaseRate);
                    reservationView.TotalDiscount           = Convert.ToDecimal(summaryMobileResponsecs.rate.ReservationSummary.PromoDiscountOnBaseRate);
                    reservationView.TotalDiscountOnSubTotal = Convert.ToDecimal(summaryMobileResponsecs.rate.ReservationSummary.PromoDiscountOnSubtotal);
                }
            }
            else if (appliedPromoId > 0 && isExtendAgreement)
            {
                extendAgreemetRequest.deletePromotion = new PromotionItem()
                {
                    PromotionID = appliedPromoId
                };
                extendAgreemetRequest.addPromotion = null;
                AgreementController controller = new AgreementController();
                try
                {
                    extendAgreementResponse = controller.extendAgreement(extendAgreemetRequest, token);
                }

                finally
                {
                    if (extendAgreementResponse != null)
                    {
                        if (extendAgreementResponse.message != null)
                        {
                            if (extendAgreementResponse.message.ErrorCode == "200")
                            {
                                balanceDue       = (decimal)extendAgreementResponse.agreementReview.BalanceDue;
                                agreementReview  = extendAgreementResponse.agreementReview;
                                amountLAbel.Text = "$ " + balanceDue.ToString("0.00");
                            }
                        }
                    }
                }
            }

            viewAddPromotionGrid();
        }
Exemple #13
0
        public VehicleDamageImage(int agreementId, string AgreementNumber, int VehicleId, string InoutStatus)
        {
            InitializeComponent();
            frontStaticImage = new VehicleImage();
            rearStaticImage  = new VehicleImage();
            leftStaticImage  = new VehicleImage();
            rightStaticImage = new VehicleImage();

            //new
            agreementController      = new AgreementController();
            loadvehicleViewImagesReq = new LoadvehicleViewImagesReq();
            response = null;


            var assembly = typeof(VehicleDamageImage);

            FrontImage.Source    = ImageSource.FromResource("BespokeMobile.Assets.Front.png", assembly);
            RearImage.Source     = ImageSource.FromResource("BespokeMobile.Assets.back.png", assembly);
            LeftImage.Source     = ImageSource.FromResource("BespokeMobile.Assets.side1.png", assembly);
            RightImage.Source    = ImageSource.FromResource("BespokeMobile.Assets.side2.png", assembly);
            this.agreementId     = agreementId;
            token                = App.Current.Properties["currentToken"].ToString();
            clientId             = Constants.ClientId;
            customerId           = int.Parse(App.Current.Properties["CustomerId"].ToString());
            this.AgreementNumber = AgreementNumber;
            this.VehicleId       = VehicleId;
            loadvehicleViewImagesReq.AgreementID = agreementId;
            loadvehicleViewImagesReq.clientId    = clientId;
            this.InoutStatus = InoutStatus;
            if (InoutStatus == "out")
            {
                ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
                frontStaticImage.customerId  = customerId;
                frontStaticImage.clientId    = clientId;
                frontStaticImage.agreementId = agreementId;
                frontStaticImage.agreementNo = AgreementNumber;
                frontStaticImage.imageView   = "frontViewOut";
                frontStaticImage.vehicleId   = VehicleId;
                ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
                rearStaticImage.customerId  = customerId;
                rearStaticImage.clientId    = clientId;
                rearStaticImage.agreementId = agreementId;
                rearStaticImage.agreementNo = AgreementNumber;
                rearStaticImage.vehicleId   = VehicleId;
                rearStaticImage.imageView   = "rearViewOut";
                ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
                leftStaticImage.customerId  = customerId;
                leftStaticImage.clientId    = clientId;
                leftStaticImage.agreementId = agreementId;
                leftStaticImage.agreementNo = AgreementNumber;
                leftStaticImage.vehicleId   = VehicleId;
                leftStaticImage.imageView   = "leftViewOut";
                ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
                rightStaticImage.customerId  = customerId;
                rightStaticImage.clientId    = clientId;
                rightStaticImage.agreementId = agreementId;
                rightStaticImage.agreementNo = AgreementNumber;
                rightStaticImage.vehicleId   = VehicleId;
                rightStaticImage.imageView   = "rightViewOut";
                ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
            }
            if (InoutStatus == "in")
            {
                ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
                frontStaticImage.customerId  = customerId;
                frontStaticImage.clientId    = clientId;
                frontStaticImage.agreementId = agreementId;
                frontStaticImage.agreementNo = AgreementNumber;
                frontStaticImage.imageView   = "frontViewIn";
                frontStaticImage.vehicleId   = VehicleId;
                ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
                rearStaticImage.customerId  = customerId;
                rearStaticImage.clientId    = clientId;
                rearStaticImage.agreementId = agreementId;
                rearStaticImage.agreementNo = AgreementNumber;
                rearStaticImage.vehicleId   = VehicleId;
                rearStaticImage.imageView   = "rearViewIn";
                ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
                leftStaticImage.customerId  = customerId;
                leftStaticImage.clientId    = clientId;
                leftStaticImage.agreementId = agreementId;
                leftStaticImage.agreementNo = AgreementNumber;
                leftStaticImage.vehicleId   = VehicleId;
                leftStaticImage.imageView   = "leftViewIn";
                ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
                rightStaticImage.customerId  = customerId;
                rightStaticImage.clientId    = clientId;
                rightStaticImage.agreementId = agreementId;
                rightStaticImage.agreementNo = AgreementNumber;
                rightStaticImage.vehicleId   = VehicleId;
                rightStaticImage.imageView   = "rightViewIn";
                ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
            }



            var frontImageTap = new TapGestureRecognizer();

            frontImageTap.Tapped += (s, e) =>
            {
                PopupNavigation.Instance.PushAsync(new VehicleImagePopup("Front Image", frontStaticImage));
            };
            FrontImageFrame.GestureRecognizers.Add(frontImageTap);
            FrontImage.GestureRecognizers.Add(frontImageTap);


            var RearImageTap = new TapGestureRecognizer();

            RearImageTap.Tapped += (s, e) =>
            {
                PopupNavigation.Instance.PushAsync(new VehicleImagePopup("Rear Image", rearStaticImage));
            };
            RearImageFrame.GestureRecognizers.Add(RearImageTap);
            RearImage.GestureRecognizers.Add(RearImageTap);

            var LeftImageTap = new TapGestureRecognizer();

            LeftImageTap.Tapped += (s, e) =>
            {
                PopupNavigation.Instance.PushAsync(new VehicleImagePopup("Left Image", leftStaticImage));
            };
            LeftImageFrame.GestureRecognizers.Add(LeftImageTap);
            LeftImage.GestureRecognizers.Add(LeftImageTap);

            var RightImageTap = new TapGestureRecognizer();

            RightImageTap.Tapped += (s, e) =>
            {
                PopupNavigation.Instance.PushAsync(new VehicleImagePopup("Right Image", rightStaticImage));
            };
            RightImageFrame.GestureRecognizers.Add(RightImageTap);
            RightImage.GestureRecognizers.Add(RightImageTap);
        }