//What happens when log In button is clicked
        private void LogInButton_Click(object sender, RoutedEventArgs e)
        {
            String logIn = userBox.Text;
            String pw    = passBox.Password.ToString();
            bool   valid = false;

            for (int i = 0; i < logIns.Count; i++)
            {
                if (String.Equals(logIn, logIns[i]) && (String.Equals(pw, passwords[i])))
                {
                    valid = true;
                    break;
                }
            }
            if (valid == false)
            {
                failBlock.Visibility = Visibility.Visible;
            }
            else
            {
                pz.checkNewUser(false);
                //Makes a new SwitchEventArgs (class in solution)
                SwitchEventArgs switchArgs = new SwitchEventArgs();
                switchArgs.Page = "Homepage";

                //if pageSwitchHandler exists, it sends a signal to Page_ButtonClick in MainWindow.xaml.cs that a button is clicked and it needs to switch the page
                if (this.pageSwitchHandler != null)
                {
                    this.pageSwitchHandler(this, switchArgs);
                }
            }
        }
Esempio n. 2
0
        private void routesButton_Click(object sender, RoutedEventArgs e)
        {
            //Makes a new SwitchEventArgs (class in solution)
            SwitchEventArgs switchArgs = new SwitchEventArgs();

            switchArgs.Page = "Routes";

            //if pageSwitchHandler exists, it sends a signal to Page_ButtonClick in MainWindow.xaml.cs that a button is clicked and it needs to switch the page
            if (this.pageSwitchHandler != null)
            {
                this.pageSwitchHandler(this, switchArgs);
            }
        }
Esempio n. 3
0
        private void nextButton_Click(object sender, RoutedEventArgs e)
        {
            //Makes a new SwitchEventArgs (class in solution)
            SwitchEventArgs switchArgs = new SwitchEventArgs();

            //basic = int.Parse(basicBox.Text);
            //floor = int.Parse(floorBox.Text);
            //VIP = int.Parse(VIPBox.Text);
            //pz.getSum(basic, floor, VIP);
            switchArgs.Page = "zorroPayment";

            //if pageSwitchHandler exists, it sends a signal to Page_ButtonClick in MainWindow.xaml.cs that a button is clicked and it needs to switch the page
            if (this.pageSwitchHandler != null)
            {
                this.pageSwitchHandler(this, switchArgs);
            }
        }
Esempio n. 4
0
        private void SignUpButton_Click(object sender, RoutedEventArgs e)
        {
            if (String.Equals(passBox.Password.ToString(), confirmPassBox.Password.ToString()) && (passBox.Password.ToString() != "" || confirmPassBox.Password.ToString() != ""))
            {
                pz.AddCredentials(userBox.Text, passBox.Password.ToString(), emailBox.Text);
                pz.checkNewUser(true);

                SwitchEventArgs switchArgs = new SwitchEventArgs();
                switchArgs.Page = "Homepage";

                if (this.pageSwitchHandler != null)
                {
                    this.pageSwitchHandler(this, switchArgs);
                }
            }
            else
            {
                failBlock.Visibility = Visibility.Visible;
            }
        }
Esempio n. 5
0
        //This method handles the page switching events
        private void Page_ButtonClick(object sender, EventArgs e)
        {
            //gets the string object of the signaled event and decided which page is requested
            String page = ((SwitchEventArgs)e).Page;

            //Basically a series of if/else statements
            switch (page)
            {
            case "Welcome":
                Switcher.Switch(welcome);
                welcome.failBlock.Visibility = Visibility.Hidden;
                break;

            case "Signup":
                Switcher.Switch(signIn);
                break;

            case "Homepage":
                //this.background.Opacity = 0;
                //this.Background = new SolidColorBrush(Colors.White);
                if (noEvents == true)
                {
                    Switcher.Switch(emptyHome);
                }
                else if (noEvents == false)
                {
                    Switcher.Switch(home);
                }
                break;

            case "Forgot":
                forgot.confirmBlock.Visibility = Visibility.Hidden;
                forgot.emailBox.Text           = "";
                Switcher.Switch(forgot);
                break;

            //zorro cases
            case "Zorro":
                Switcher.Switch(eventPage);
                break;

            case "zorroCalendar":
                Switcher.Switch(zorroCal);
                break;

            case "zorroSchedule":
                Switcher.Switch(zorroSched);
                break;

            case "zorroOverview":
                Switcher.Switch(overview);
                break;

            case "zorroPayment":
                Switcher.Switch(payment);
                break;

            case "zorroEmptyPayment":
                Switcher.Switch(emptyPayment);
                break;

            case "zorroReview":
                //review.setSum(sum);
                Switcher.Switch(review);
                break;

            case "Christmas":
                Switcher.Switch(event2Page);
                break;

            case "Nutcracker":
                Switcher.Switch(event3page);
                break;

            case "removeZorroCheck":
                Switcher.Switch(homePage3);
                break;

            case "ZorroRemove":
                Switcher.Switch(zorroRemove);
                break;

            case "Profile":
                Switcher.Switch(profile_page);
                break;


            case "DecemberCalendar":
                if (backLog.Count >= 2)
                {
                    if (backLog[backLog.Count - 2] == "zorroCalendar")
                    {
                        page = "zorroCalendar";
                        Switcher.Switch(zorroCal);
                    }
                    else
                    {
                        Switcher.Switch(calendarDec);
                    }
                }
                else
                {
                    Switcher.Switch(calendarDec);
                }
                break;

            case "NovemberCalendar":
                Switcher.Switch(calendarNov);
                break;

            case "JanuaryCalendar":
                Switcher.Switch(calendarJan);
                break;

            case "popularEvent":
                Switcher.Switch(popularPage);
                break;

            case "Upcomming":
                Switcher.Switch(upcomingPage);
                break;

            case "Nearby":
                Switcher.Switch(nearbyPage);
                break;

            case "emptyBookmark":
                Switcher.Switch(emptybookmark);
                break;

            case "bookmarked":
                Switcher.Switch(zorroBookmark);
                break;

            case "Routes":
                Switcher.Switch(routePage);
                break;

            case "HomePage1Event":
                Switcher.Switch(home1E);
                break;

            case "Filter":
                Switcher.Switch(filterPage);
                break;

            case "CalendarEvents":
                Switcher.Switch(calendarEvents);
                break;


            case "Back":
                //MessageBox.Show(backLog[backLog.Count - 1] + ","+ backLog[backLog.Count - 2] + "," + backLog[backLog.Count - 3]);
                SwitchEventArgs back = new SwitchEventArgs();
                if (backLog[backLog.Count - 2] != "Back")
                {
                    back.Page = backLog[backLog.Count - 2];
                    this.backbutton(this, back);
                    backLog.RemoveRange((backLog.Count - 2), 2);
                }    /* else if((backLog[backLog.Count - 2] != "Back"))
                      * {
                      * back.Page = backLog[backLog.Count - 3];
                      * this.backbutton(this, back);
                      * backLog.RemoveRange((backLog.Count - 3), 3);
                      * }
                      * else
                      * {
                      * for(int i = backLog.Count - 1; i < 0; i--)
                      * {
                      *     if(backLog[i] != "Back")
                      *     {
                      *         back.Page = backLog[backLog.Count - 2];
                      *         this.backbutton(this, back);
                      *         backLog.RemoveRange((backLog.Count - 2), 2);
                      *     }
                      * }
                      * }*/
                break;
            }
            if (page != "Back")
            {
                backLog.Add(page);
            }
        }