public override void ViewWillAppear(bool animated)
 {
     if (!isFromMenu)
     {
         NavigationItem.Customize(NavigationController);
     }
 }
Example #2
0
 public override void ViewWillAppear(bool animated)
 {
     AppSettings.CurrentNavigation = NavigationController;
     //thisController = NavigationController;
     if (!isFromMenu)
     {
         NavigationItem.Customize(NavigationController);
     }
 }
Example #3
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            //thisController = NavigationController;
            AppSettings.CurrentNavigation = NavigationController;
            NavigationItem.Customize(NavigationController);

            btnScheduleARide5.SetCustomButton();

            SetLocationPart();
            SetFarePart();

            btnScheduleARide5.TouchUpInside += (object sender, EventArgs e) => {
                ConfirmRideInformation();
            };
        }
Example #4
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            //thisController = NavigationController;
            AppSettings.CurrentNavigation = NavigationController;
            NavigationItem.Customize(NavigationController);

            var tap = new UITapGestureRecognizer(() => { View.EndEditing(true); });

            View.AddGestureRecognizer(tap);

            btnScheduleARide3.SetCustomButton();

            SetBindings();
            if (Facade.Instance.CurrentRide.IsFirstTime)
            {
                Facade.Instance.CurrentRide.IsFirstTime = false;
                SetBindingsOnce();
            }
        }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            //thisController = NavigationController;
            AppSettings.CurrentNavigation = NavigationController;
            NavigationItem.Customize(NavigationController);

            var tap = new UITapGestureRecognizer(() => { View.EndEditing(true); });

            View.AddGestureRecognizer(tap);

            edtGratuity.ShouldReturn  += TextFieldShouldReturn;
            edtPromoCode.ShouldReturn += TextFieldShouldReturn;
            edtExtraBags.ShouldReturn += TextFieldShouldReturn;

            switchMandG.SetState(Facade.Instance.CurrentRide.IsMeetandGreet, false);

            SetupExtraBags(edtExtraBags);
            SetupGratuity(edtGratuity);

            switchMandG.ValueChanged += (sender, e) => {
                Facade.Instance.CurrentRide.IsMeetandGreet = switchMandG.On;
            };

            if (Facade.Instance.CurrentRide.SelectedFare.serviceid == "0")
            {
                edtGratuity.Enabled = false;
            }

            btnScheduleARide4.SetCustomButton();

            GetSpecialServices();

            SetBindings();
            if (IsFirstTime)
            {
                IsFirstTime = false;
                SetBindingsOnce();
            }
        }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            thisController = NavigationController;
            NavigationItem.Customize(NavigationController);

            resultsTableController = new ResultsTableController {
                FilteredPredictions = new List <PlaceAutocompleteAPI_Prediction> ()
            };

            searchController = new UISearchController(resultsTableController)
            {
                WeakDelegate = this,
                DimsBackgroundDuringPresentation = false,
                WeakSearchResultsUpdater         = this
            };

            searchController.SearchBar.SizeToFit();

            TableView.TableHeaderView = searchController.SearchBar;

            resultsTableController.TableView.WeakDelegate = this;
            searchController.SearchBar.WeakDelegate       = this;

            DefinesPresentationContext = true;

            if (searchControllerWasActive)
            {
                searchController.Active   = searchControllerWasActive;
                searchControllerWasActive = false;

                if (searchControllerSearchFieldWasFirstResponder)
                {
                    searchController.SearchBar.BecomeFirstResponder();
                    searchControllerSearchFieldWasFirstResponder = false;
                }
            }
        }
Example #7
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            thisController = NavigationController;

            Title = "SIGN UP";

            NavigationItem.Customize(NavigationController);

            btnConfirmRegistration.SetCustomButton();

            edtFirstName.ShouldReturn      += TextFieldShouldReturn;
            edtLastName.ShouldReturn       += TextFieldShouldReturn;
            edtMobileNumber.ShouldReturn   += TextFieldShouldReturn;
            edtEmailAddress.ShouldReturn   += TextFieldShouldReturn;
            edtPassword.ShouldReturn       += TextFieldShouldReturn;
            edtRepeatPassword.ShouldReturn += TextFieldShouldReturn;

            var tap = new UITapGestureRecognizer(() => { View.EndEditing(true); });

            View.AddGestureRecognizer(tap);


                        #if DEBUG
            edtFirstName.Text      = "John";
            edtLastName.Text       = "Dow";
            edtMobileNumber.Text   = "8058081234";
            edtEmailAddress.Text   = "*****@*****.**";
            edtPassword.Text       = "123456";
            edtRepeatPassword.Text = "123456";
                        #endif

            if (AppSettings.LoginType > 0)
            {
                edtFirstName.Text      = AppSettings.UserFirstName;
                edtLastName.Text       = AppSettings.UserLastName;
                edtMobileNumber.Text   = AppSettings.UserPhone;
                edtEmailAddress.Text   = AppSettings.UserEmail;
                edtPassword.Text       = "";
                edtRepeatPassword.Text = "";
            }

            this.SetBinding(
                () => edtFirstName.Text,
                () => ViewModel.FirstName,
                BindingMode.TwoWay)
            .UpdateSourceTrigger("EditingChanged");

            this.SetBinding(
                () => edtLastName.Text,
                () => ViewModel.LastName,
                BindingMode.TwoWay)
            .UpdateSourceTrigger("EditingChanged");

            this.SetBinding(
                () => edtMobileNumber.Text,
                () => ViewModel.MobileNumber,
                BindingMode.TwoWay)
            .UpdateSourceTrigger("EditingChanged");

            this.SetBinding(
                () => edtEmailAddress.Text,
                () => ViewModel.EmailAdress,
                BindingMode.TwoWay)
            .UpdateSourceTrigger("EditingChanged");

            this.SetBinding(
                () => edtPassword.Text,
                () => ViewModel.Password,
                BindingMode.TwoWay)
            .UpdateSourceTrigger("EditingChanged");

            this.SetBinding(
                () => edtRepeatPassword.Text,
                () => ViewModel.RepeatPassword,
                BindingMode.TwoWay)
            .UpdateSourceTrigger("EditingChanged");

            this.SetBinding(
                () => chkIAgree.On,
                () => ViewModel.IsAgree,
                BindingMode.TwoWay)
            .UpdateSourceTrigger("ValueChanged");

            ViewModel.LoginType = AppSettings.LoginType.ToString();
            ViewModel.Token     = AppSettings.UserToken;

            btnConfirmRegistration.SetCommand("TouchUpInside", ViewModel.IncrementCommand);

            this.SetBinding(
                () => ViewModel.ValidaionError)
            .UpdateSourceTrigger("ValidaionErrorChanges")
            .WhenSourceChanges(
                () => {
                if (ViewModel.ValidaionError != null && ViewModel.ValidaionError.Count > 0)
                {
                    var delimeter = Environment.NewLine + "and" + Environment.NewLine;
                    var message   = String.Join(delimeter, ViewModel.ValidaionError.Select(r => r.ErrorMessage));
                    InvokeOnMainThread(() => new UIAlertView(
                                           "Just a couple things left:", message, null, "Ok", null).Show());
                }
            });

            this.SetBinding(
                () => ViewModel.CanMoveForward)
            .UpdateSourceTrigger("CanMoveForwardChanges")
            .WhenSourceChanges(
                () => {
                if (ViewModel.CanMoveForward)
                {
                    AppSettings.LoginType     = (int)LoginType.Email;
                    AppSettings.UserToken     = string.Empty;
                    AppSettings.UserEmail     = edtEmailAddress.Text;
                    AppSettings.UserPassword  = edtPassword.Text;
                    AppSettings.UserFirstName = edtFirstName.Text;
                    AppSettings.UserLastName  = edtLastName.Text;
                    AppSettings.UserPhone     = edtMobileNumber.Text;
                    AppSettings.UserPhoto     = string.Empty;

                    var dic = new Dictionary <String, String>
                    {
                        { Constant.LOGINAPI_USERNAME, edtEmailAddress.Text },
                        { Constant.LOGINAPI_PASSWORD, edtPassword.Text }
                    };

                    string result = String.Empty;

                    try
                    {
                        Task runSync = Task.Factory.StartNew(async() => {
                            result = await AppData.ApiCall(Constant.LOGINAPI, dic);
                            var tt = (LoginResponse)AppData.ParseResponse(Constant.LOGINAPI, result);

                            AppSettings.UserID = tt.Customerid;
                        }).Unwrap();
                        //runSync.Wait();
                    }
                    catch (Exception ex)
                    {
                    }
                    finally{
                        //HideLoadingView();
                    }

                    UIStoryboard sb = UIStoryboard.FromName("MainStoryboard", null);
                    AddCreditCardViewController pvc = (AddCreditCardViewController)sb.InstantiateViewController("AddCreditCardViewController");
                    pvc.fromWhere = "signup";
                    thisController.PushViewController(pvc, true);
                }
            });

            this.SetBinding(
                () => ViewModel.AppExceptions)
            .UpdateSourceTrigger("AppExceptionsChanges")
            .WhenSourceChanges(
                () => {
                if (ViewModel.AppExceptions != null && ViewModel.AppExceptions.Count > 0)
                {
                    var delimeter = Environment.NewLine + "and" + Environment.NewLine;
                    var message   = String.Join(delimeter, ViewModel.AppExceptions.Select(r => r.Message));
                    InvokeOnMainThread(() => new UIAlertView(
                                           "Errors:", message, null, "Ok", null).Show());
                }
            });
        }
Example #8
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            NavigationItem.Customize(NavigationController);

            btnSubmit.SetCustomButton();
            btnCancelResetPassword.SetCustomButton();

            edtOldPassword.ShouldReturn     += TextFieldShouldReturn;
            edtNewPassword.ShouldReturn     += TextFieldShouldReturn;
            edtConfNewPassword.ShouldReturn += TextFieldShouldReturn;

            var tap = new UITapGestureRecognizer(() => { View.EndEditing(true); });

            View.AddGestureRecognizer(tap);

            ViewModel.IsEmailLogin = false;

            LoginType currentLt;

            if (Enum.TryParse(AppSettings.LoginType.ToString(CultureInfo.InvariantCulture), out currentLt))
            {
                if (currentLt == LoginType.Email)
                {
                    ViewModel.IsEmailLogin = true;
                    ViewModel.CurrentEmail = AppSettings.UserEmail;
                }
            }

            this.SetBinding(
                () => edtOldPassword.Text,
                () => ViewModel.OldPassword,
                BindingMode.TwoWay)
            .UpdateSourceTrigger("EditingChanged");

            this.SetBinding(
                () => edtNewPassword.Text,
                () => ViewModel.NewPassword,
                BindingMode.TwoWay)
            .UpdateSourceTrigger("EditingChanged");

            this.SetBinding(
                () => edtConfNewPassword.Text,
                () => ViewModel.ConfirmNewPassword,
                BindingMode.TwoWay)
            .UpdateSourceTrigger("EditingChanged");

            btnSubmit.SetCommand("TouchUpInside", ViewModel.SubmitCommand);

            this.SetBinding(
                () => ViewModel.ValidaionError)
            .UpdateSourceTrigger("ValidaionErrorChanges")
            .WhenSourceChanges(
                () => {
                if (ViewModel.ValidaionError != null && ViewModel.ValidaionError.Count > 0)
                {
                    var delimeter = Environment.NewLine + "and" + Environment.NewLine;
                    var message   = String.Join(delimeter, ViewModel.ValidaionError.Select(r => r.ErrorMessage));
                    InvokeOnMainThread(() => new UIAlertView(
                                           "Just a couple things left:", message, null, "Ok", null).Show());
                }
            });

            this.SetBinding(
                () => ViewModel.AppExceptions)
            .UpdateSourceTrigger("AppExceptionsChanges")
            .WhenSourceChanges(
                () => {
                if (ViewModel.AppExceptions != null && ViewModel.AppExceptions.Count > 0)
                {
                    var delimeter = Environment.NewLine + "and" + Environment.NewLine;
                    var message   = String.Join(delimeter, ViewModel.AppExceptions.Select(r => r.Message));
                    InvokeOnMainThread(() => new UIAlertView(
                                           "Errors:", message, null, "Ok", null).Show());
                }
            });

            this.SetBinding(
                () => ViewModel.CanMoveForward)
            .UpdateSourceTrigger("CanMoveForwardChanges")
            .WhenSourceChanges(
                () =>
            {
                if (ViewModel.CanMoveForward)
                {
                    InvokeOnMainThread(() => new UIAlertView(
                                           "Success", "Password has been changed", null, "Ok", null).Show());
                }
            });
        }
Example #9
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();


            if (!isFromMenu)
            {
                NavigationItem.Customize(NavigationController);
            }

            var tap = new UITapGestureRecognizer(() => { View.EndEditing(true); });

            View.AddGestureRecognizer(tap);

            //switchPandH.On = false;
            switchPandH.ValueChanged += (sender, e) => {
                if (switchPandH.On)
                {
                    lblHours.TextColor = UIColor.White;
                    edtNumberOfHours.BackgroundColor = UIColor.White;
                    edtNumberOfHours.Enabled         = true;
                }
                else
                {
                    lblHours.TextColor = UIColor.DarkGray;
                    edtNumberOfHours.BackgroundColor = UIColor.DarkGray;
                    edtNumberOfHours.Enabled         = false;
                }
                GetFares();
            };

            viewSelectUpto.SetCustomView();

            btnSwitch1.Selected        = false;
            btnSwitch1.BackgroundColor = new UIColor((nfloat)(116 / 255.0), (nfloat)(143 / 255.0), (nfloat)(175 / 255.0), (nfloat)1.0);

            btnSwitch2.Selected        = true;
            btnSwitch2.BackgroundColor = new UIColor((nfloat)(21 / 255.0), (nfloat)(100 / 255.0), (nfloat)(179 / 255.0), (nfloat)1.0);

            btnSwitch3.Selected        = false;
            btnSwitch3.BackgroundColor = new UIColor((nfloat)(116 / 255.0), (nfloat)(143 / 255.0), (nfloat)(175 / 255.0), (nfloat)1.0);

            btnSwitch1.TouchUpInside += (sender, e) => {
                SetUpto(0);
            };

            btnSwitch2.TouchUpInside += (sender, e) => {
                SetUpto(1);
            };

            btnSwitch3.TouchUpInside += (sender, e) => {
                SetUpto(2);
            };

            btnFare.SetTitle("Complete all fields above", UIControlState.Normal);

            btnScheduleARide2.SetCustomButton();

            SetBindings();
            if (IsFirstTime)
            {
                IsFirstTime = false;
                SetBindingsOnce();
            }
        }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            thisController = NavigationController;
            NavigationItem.Customize(NavigationController);

            btnSubmit.SetCustomButton();
            btnScaneCard.SetCustomButton();

            edtCCV.ShouldReturn            += TextFieldShouldReturn;
            edtZipCode.ShouldReturn        += TextFieldShouldReturn;
            edtCreditDate.ShouldReturn     += TextFieldShouldReturn;
            edtCreditCardData.ShouldReturn += TextFieldShouldReturn;
            edtCardHolderName.ShouldReturn += TextFieldShouldReturn;

            var tap = new UITapGestureRecognizer(() => { View.EndEditing(true); });

            View.AddGestureRecognizer(tap);

            edtCreditCardData.EditingDidBegin += (object sender, EventArgs e) => {
                paymentViewController = new CardIOPaymentViewController(this, false);
                NavigationController.PresentViewController(paymentViewController, true, null);
            };

            btnSubmit.TouchUpInside += async(object sender, EventArgs e) => {
                var dic = new Dictionary <String, String>
                {
                    { Constant.INSERTCREDITCARDDETAILSFORPHONE_CCNAME, edtCardHolderName.Text },
                    { Constant.INSERTCREDITCARDDETAILSFORPHONE_CCNUM, creditCardInfo.CardNumber },
                    { Constant.INSERTCREDITCARDDETAILSFORPHONE_CCTYPE, crditCardType.ToString() },
                    { Constant.INSERTCREDITCARDDETAILSFORPHONE_CID, creditCardInfo.Cvv },
                    { Constant.INSERTCREDITCARDDETAILSFORPHONE_CUSTOMERID, AppSettings.UserID },
                    { Constant.INSERTCREDITCARDDETAILSFORPHONE_EXPDATE, creditCardInfo.ExpiryMonth + creditCardInfo.ExpiryYear.ToString().Substring(2, 2) },
                    { Constant.INSERTCREDITCARDDETAILSFORPHONE_LOGINTYPE, "0" },                    // do not use the actual login types
                    { Constant.INSERTCREDITCARDDETAILSFORPHONE_TOKENID, string.Empty },             // do not use the actual token
                    { Constant.INSERTCREDITCARDDETAILSFORPHONE_ZIP, edtZipCode.Text }
                };

                var result = string.Empty;

                try
                {
                    result = await AppData.ApiCall(Constant.INSERTCREDITCARDDETAILSFORPHONE, dic);
                }
                catch (Exception ex)
                {
                    InvokeOnMainThread(() => new UIAlertView(
                                           "Exception:", ex.Message, null, "Ok", null).Show());
                    CrashReporter.Report(ex);
                    return;
                }

                var tt = (InsertCreditCardDetailsForPhoneResponse)AppData.ParseResponse(Constant.INSERTCREDITCARDDETAILSFORPHONE, result);

                UIAlertView alert = new UIAlertView(tt.Result, tt.Msg, null, "Ok", null);
                alert.Clicked += (object senderObj, UIButtonEventArgs buttonArgs) =>
                {
                    if (buttonArgs.ButtonIndex == 0 && (tt.Result == "Success" || tt.Result == "Sucess"))
                    {
                        if (fromWhere == string.Empty)
                        {
                            return;
                        }

                        if (fromWhere == "signup")
                        {
                            var dvc = (HomeViewController)Storyboard.InstantiateViewController("HomeViewController");
                            PresentViewController(dvc, true, null);
                        }
                        else
                        {
                            thisController.PopViewController(true);
                        }
                    }
                    else
                    {
                        //negativeCallback();
                    }
                };

                InvokeOnMainThread(alert.Show);
            };

            btnScaneCard.TouchUpInside += async(object sender, EventArgs e) => {
                paymentViewController = new CardIOPaymentViewController(this);
                NavigationController.PresentViewController(paymentViewController, true, null);
            };
        }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            NavigationItem.Customize(NavigationController);

            DateTime pDate = DateTime.Parse(item.createdOn);

            string[] arrDate = pDate.GetDateTimeFormats();

            lblDetailTripTitle.Text = arrDate[8];

            btnDetailReservationID.SetCustomRIDButton();
            string strReservationID = String.Format("{1} {2}", Environment.NewLine, "  Reservation #: ", item.ReservationID);

            btnDetailReservationID.SetTitle(strReservationID, UIControlState.Normal);

            btnCancelReservation.SetCustomButton();
            btnCancelReservation.TouchUpInside += (object sender, EventArgs e) => {
                var phoneCallTask = MessagingPlugin.PhoneDialer;
                if (phoneCallTask.CanMakePhoneCall)
                {
                    phoneCallTask.MakePhoneCall("8002477919", "Roadrunner Support");
                }
                else
                {
                    var okAlertController = UIAlertController.Create("error", "you can't make phone call on emulator", UIAlertControllerStyle.Alert);
                    okAlertController.AddAction(UIAlertAction.Create("ok", UIAlertActionStyle.Default, null));
                    PresentViewController(okAlertController, true, null);
                }
            };

            if (item.pickUpTime == "")
            {
                pDate = DateTime.Now;
            }
            else
            {
                pDate = DateTime.Parse(item.pickUpTime);
            }
            arrDate = pDate.GetDateTimeFormats();

            lblDetailPickupDate.Text = String.Format("{1} {2} {3}", Environment.NewLine, "Pick up at ", arrDate[106], " from");

            var pCity = item.Pickcity.IsMatchRegex
                                ? String.Format("{1} {2} {3} {4} {5} {6}", Environment.NewLine, item.Pickcity.stNum, item.Pickcity.street, item.Pickcity.complex, item.Pickcity.unit,
                                                item.Pickcity.city, item.Pickcity.zip)
                                : String.Format("{1}", Environment.NewLine, item.Pickcity.raw);

            lblDetailPickupLocation.Text = pCity;

            if (item.dropOffTime == "")
            {
                pDate = DateTime.Now;
            }
            else
            {
                pDate = DateTime.Parse(item.dropOffTime);
            }
            arrDate = pDate.GetDateTimeFormats();

            lblDetailDropoffDate.Text = String.Format("{1} {2} {3}", Environment.NewLine, "Take off at ", arrDate[106], " from");

            var dCity = item.Dropoff.IsMatchRegex
                                ? String.Format("{1} {2} {3} {4} {5} {6}", Environment.NewLine, item.Dropoff.stNum, item.Dropoff.street, item.Dropoff.complex, item.Dropoff.unit, item.Dropoff.city,
                                                item.Dropoff.zip)
                                : String.Format("{1}", Environment.NewLine, item.Dropoff.raw);

            lblDetailDropoffLocation.Text = dCity;
        }
Example #12
0
        public override void ViewDidLoad()
        {
            UserTrackingReporter.TrackUser(Constant.CATEGORY_FORGOT_PASSWORD, "ViewDidLoad");

            base.ViewDidLoad();

            NavigationItem.Customize(NavigationController);

            btnRestorePassword.SetCustomButton();

            edtEmailAdress.ShouldReturn += TextFieldShouldReturn;

            var tap = new UITapGestureRecognizer(() => { View.EndEditing(true); });

            View.AddGestureRecognizer(tap);

                        #if DEBUG
            edtEmailAdress.Text = "*****@*****.**";
            #endif

            btnRestorePassword.TouchUpInside += async delegate(object sender, EventArgs e)
            {
                UserTrackingReporter.TrackUser(Constant.CATEGORY_FORGOT_PASSWORD, "Restore Password clicked");

                var txt = edtEmailAdress.Text;

                if (!AppData.IsValidEmail(txt))
                {
                    ShowMessageBox("Error", "Please enter valid email address.", "Ok", null, null);
                }
                else
                {
                    UserTrackingReporter.TrackUser(Constant.CATEGORY_FORGOT_PASSWORD, "Resetting password");
                    ShowLoadingView("Password Resetting...");

                    Dictionary <string, string> dic = new Dictionary <string, string>()
                    {
                        { Constant.FORGOTPASSWORDAPIUSEREMAIL, txt }
                    };

                    ForgotPasswordResponse fpr;
                    try
                    {
                        var result = await AppData.ApiCall(Constant.FORGOTPASSWORDAPI, dic);

                        fpr = (ForgotPasswordResponse)AppData.ParseResponse(Constant.FORGOTPASSWORDAPI, result);
                        HideLoadingView();
                    }
                    catch (Exception ex)
                    {
                        HideLoadingView();
                        var msg = String.Format("An error occurred requesting password reset.{0}{0}Error: {1}", Environment.NewLine, ex.Message);
                        ShowMessageBox("Error", msg, "Ok", null, null);
                        CrashReporter.Report(ex);
                        return;
                    }

                    if (fpr != null && fpr.Result.ToLower().Contains("success"))
                    {
                        ShowMessageBox("Success", "E-mail to reset password has been sent", "Ok", null, null);
                    }
                    else
                    {
                        ShowMessageBox("Error", "Something goes wrong, please contact our support", "Ok", null, null);
                    }

                    var justVC = Storyboard.InstantiateViewController("LoginViewController");
                    this.NavigationController.PushViewController(justVC, true);
                }
            };
        }