private void PreviousPageHandler(object sender, MouseButtonEventArgs e) { //Get the current instance of the navigation class CurrentPageModel currentClass = CurrentPageModel.getcurrentclass(); currentClass.currentpage = "2"; Page page3 = CurrentPageModel.thirdPage; if (page3 == null) { Page currentPage = new ProfileCreationPage3(); this.NavigationService.Navigate(currentPage); //this.NavigationService.Navigate(new Uri(@"\ProfilePages\ProfileCreationPage3.xaml", UriKind.RelativeOrAbsolute)); } else { //Load in the instance of the page this.NavigationService.Navigate(page3); //Load in the current navigation control WpfApp1.NavigationControls.NavigationControls thirdControl = (WpfApp1.NavigationControls.NavigationControls)CurrentPageModel.thirdControl; //Set the button manipulation thirdControl.buttonManipulation(currentClass.currentpage); //Set the page number thirdControl.PageNumber.Text = thirdControl.currentPageNumber(currentClass.currentpage); } //Save current instance of the page CurrentPageModel.fourthPage = this; //Save current instance of the user control CurrentPageModel.fourthControl = page4Controls; }
private void PreviousPageHandler(object sender, MouseButtonEventArgs e) { CurrentPageModel currentClass = CurrentPageModel.getcurrentclass(); currentClass._currentPage = "1"; //Gets the Saved Instance of the first page and load it// Page page2 = CurrentPageModel.secondPage; if (page2 == null) { Page currentPage = new Page2(); this.NavigationService.Navigate(currentPage); //this.NavigationService.Navigate(new Uri(@"\ProfilePages\ProfileCreationPage2.xaml", UriKind.RelativeOrAbsolute)); } else { this.NavigationService.Navigate(page2); WpfApp1.NavigationControls.NavigationControls secondControl = (WpfApp1.NavigationControls.NavigationControls)CurrentPageModel.secondControl; secondControl.buttonManipulation(currentClass.currentpage); secondControl.PageNumber.Text = secondControl.currentPageNumber(currentClass.currentpage); } //Save the Instance of the thirdPage page// CurrentPageModel.thirdPage = this; //Save the Instance of the second page controls// CurrentPageModel.thirdControl = page3Controls; }
private void PreviousPageHandler(object sender, MouseButtonEventArgs e) { //Get the current instance of the navigation class CurrentPageModel currentClass = CurrentPageModel.getcurrentclass(); currentClass.currentpage = "4"; Page page5 = CurrentPageModel.fifthPage; if (page5 == null) { Page currentPage = new ProfileCreationPage5(); this.NavigationService.Navigate(currentPage); } else { //Load in the instance of the page this.NavigationService.Navigate(page5); //Load in the current navigation control WpfApp1.NavigationControls.NavigationControls fifthControl = (WpfApp1.NavigationControls.NavigationControls)CurrentPageModel.fifthControl; //Set the button manipulation fifthControl.buttonManipulation(currentClass.currentpage); //Set the page number fifthControl.PageNumber.Text = fifthControl.currentPageNumber(currentClass.currentpage); } //Save current instance of the page CurrentPageModel.sixthPage = this; //Save current instance of the user control CurrentPageModel.sixthControl = page6Controls; }
public MainWindow() { InitializeComponent(); CurrentPageModel currentClass = new CurrentPageModel(); CurrentPageModel.setMainWindow(this); rootBox.Source = new Uri(@"\ProfilePages\ProfileCreationPage1.xaml", UriKind.RelativeOrAbsolute); }
public NavigationControls() { InitializeComponent(); CurrentPageModel currentClass = CurrentPageModel.getcurrentclass(); PageNumber.Text = currentPageNumber(currentClass.currentpage); buttonManipulation(currentClass.currentpage); }
private void NextPageHandler(object sender, MouseButtonEventArgs e) { Boolean isValidated = checkValidation(); string data = null; if (option1.IsChecked == true) { data = "a"; } if (option2.IsChecked == true) { data = "b"; } if (option3.IsChecked == true) { data = "c"; } if (option4.IsChecked == true) { data = "d"; } UserModel.UserModel currentUserModel = UserModel.UserModel.currentUserModel; currentUserModel.profile1 = data; UserModel.UserModel.currentUserModel = currentUserModel; if (isValidated == true) { CurrentPageModel currentClass = CurrentPageModel.getcurrentclass(); currentClass._currentPage = "1"; //Load the Saved Instance of the second page// Page page2 = CurrentPageModel.secondPage; if (page2 == null) { Page newPage = new Page2(); //this.NavigationService.Navigate(new Uri(@"\ProfilePages\ProfileCreationPage2.xaml", UriKind.RelativeOrAbsolute)); this.NavigationService.Navigate(newPage); } else { this.NavigationService.Navigate(page2); WpfApp1.NavigationControls.NavigationControls secondControl = (WpfApp1.NavigationControls.NavigationControls)CurrentPageModel.secondControl; secondControl.buttonManipulation(currentClass.currentpage); secondControl.PageNumber.Text = secondControl.currentPageNumber(currentClass.currentpage); } } else { MessageBox.Show("No option have been chosen. Please choose your option"); } //Save the Instance of the first page CurrentPageModel.firstPage = this; //Save the Instance of the first page controls CurrentPageModel.firstControl = page1Controls; }
private void NextPageHandler(object sender, MouseButtonEventArgs e) { Boolean isValidated = CurrentPageModel.secondValidation; string data = null; if (option1.IsChecked == true) { data = "a"; } if (option2.IsChecked == true) { data = "b"; } if (option3.IsChecked == true) { data = "c"; } if (option4.IsChecked == true) { data = "d"; } CurrentPageModel.secondValidation = true; UserModel.UserModel currentUserModel = UserModel.UserModel.currentUserModel; currentUserModel.profile2 = data; UserModel.UserModel.currentUserModel = currentUserModel; if (isValidated == true) { CurrentPageModel currentClass = CurrentPageModel.getcurrentclass(); currentClass._currentPage = "2"; Page page3 = CurrentPageModel.thirdPage; if (page3 == null) { Page currentPage = new ProfileCreationPage3(); this.NavigationService.Navigate(currentPage); } else { this.NavigationService.Navigate(page3); WpfApp1.NavigationControls.NavigationControls thirdControl = (WpfApp1.NavigationControls.NavigationControls)CurrentPageModel.thirdControl; thirdControl.buttonManipulation(currentClass.currentpage); thirdControl.PageNumber.Text = thirdControl.currentPageNumber(currentClass.currentpage); } } else { MessageBox.Show("No option have been chosen. Please choose your option"); } //Save the Instance of the second page// CurrentPageModel.secondPage = this; //Save the Instance of the second page controls// CurrentPageModel.secondControl = page2Controls; }
private void NextPageHandler(object sender, MouseButtonEventArgs e) { //Get the current instance of the navigation class Boolean isValidated = CurrentPageModel.fifthhValidation; if (isValidated == true) { CurrentPageModel currentClass = CurrentPageModel.getcurrentclass(); currentClass.currentpage = "5"; Page page6 = CurrentPageModel.sixthPage; if (page6 == null) { Page currentPage = new ProfileCreationPage6(); this.NavigationService.Navigate(currentPage); //this.NavigationService.Navigate(new Uri(@"\ProfilePages\ProfileCreationPage6.xaml", UriKind.RelativeOrAbsolute)); } else { Console.WriteLine("Hello"); //Load in the instance of the page this.NavigationService.Navigate(page6); //Load in the current navigation control WpfApp1.NavigationControls.NavigationControls sixthControl = (WpfApp1.NavigationControls.NavigationControls)CurrentPageModel.sixthControl; //Set the button manipulation sixthControl.buttonManipulation(currentClass.currentpage); //Set the page number sixthControl.PageNumber.Text = sixthControl.currentPageNumber(currentClass.currentpage); } } else { MessageBox.Show("Button Game hasn't been completed. Please complete it first"); } //Save current instance of the page CurrentPageModel.fifthPage = this; //Save current instance of the user control CurrentPageModel.fifthControl = page5Controls; }
private void SignUp2NextButton_Click(object sender, RoutedEventArgs e) { if (String.IsNullOrEmpty(SecurityQuestion1TextBox.Text) || String.IsNullOrEmpty(SecurityQuestion2TextBox.Text) || String.IsNullOrEmpty(Answer1TextBox.Text) || String.IsNullOrEmpty(Answer2TextBox.Text)) { MessageBox.Show("Please fill in all blanks!"); if (String.IsNullOrEmpty(SecurityQuestion1TextBox.Text)) { Q1Image.Visibility = Visibility.Visible; } else { Q1Image.Visibility = Visibility.Hidden; } if (String.IsNullOrEmpty(SecurityQuestion2TextBox.Text)) { Q2Image.Visibility = Visibility.Visible; } else { Q2Image.Visibility = Visibility.Hidden; } if (String.IsNullOrEmpty(Answer1TextBox.Text)) { A1Image.Visibility = Visibility.Visible; } else { A1Image.Visibility = Visibility.Hidden; } if (String.IsNullOrEmpty(Answer2TextBox.Text)) { A2Image.Visibility = Visibility.Visible; } else { A2Image.Visibility = Visibility.Hidden; } } else { string selected_userID = (App.Current as App).UserID; string selected_userPassword = (App.Current as App).UserPassword; string selected_userName = (App.Current as App).UserName; string selected_userEmail = (App.Current as App).UserEmail; string selected_userContact = (App.Current as App).UserContact; string selected_userDOB = (App.Current as App).UserDOB; string selected_securityQ1 = SecurityQuestion1TextBox.Text; string selected_securityQ1Ans = Answer1TextBox.Text; string selected_securityQ2 = SecurityQuestion2TextBox.Text; string selected_securityQ2Ans = Answer2TextBox.Text; //Comment out the method to save to database UserModel.UserModel newModel = new UserModel.UserModel(selected_userID, selected_userPassword, selected_userName, selected_userEmail, selected_userContact, selected_userDOB, selected_securityQ1, selected_securityQ1Ans, selected_securityQ2, selected_securityQ2Ans); UserModel.UserModel.currentUserModel = newModel; //newModel.saveToDatabase(); //ConnectionStringSettings conSettings = ConfigurationManager.ConnectionStrings["connString"]; //string connectionString = conSettings.ConnectionString; //try //{ // con = new SqlConnection(connectionString); // con.Open(); // cmd = new SqlCommand("INSERT INTO [dbo].[test] (UserID, Password, Name, Email, ContactNo, DOB, SecurityQ1, Q1Ans, SecurityQ2, Q2Ans) VALUES (@UserID, @Password, @Name, @Email, @ContactNo, @DOB, @SecurityQ1, @Q1Ans, @SecurityQ2, @Q2Ans)", con); // cmd.Parameters.AddWithValue("@UserID", selected_userID); // cmd.Parameters.AddWithValue("@Password", selected_userPassword); // cmd.Parameters.AddWithValue("@Name", selected_userName); // cmd.Parameters.AddWithValue("@Email", selected_userEmail); // cmd.Parameters.AddWithValue("@ContactNo", selected_userContact); // cmd.Parameters.AddWithValue("@DOB", selected_userDOB); // cmd.Parameters.AddWithValue("@SecurityQ1", SecurityQuestion1TextBox.Text); // cmd.Parameters.AddWithValue("@Q1Ans", Answer1TextBox.Text); // cmd.Parameters.AddWithValue("@SecurityQ2", SecurityQuestion2TextBox.Text); // cmd.Parameters.AddWithValue("@Q2Ans", Answer2TextBox.Text); // cmd.ExecuteNonQuery(); //} //catch (Exception ex) //{ // System.Windows.MessageBox.Show(ex.Message); //} //finally //{ // con.Close(); //} //MessageBox.Show("You're almost done. An email has been sent to your email address. Please verify your email address, thank you!"); CurrentPageModel currentModel = new CurrentPageModel(); Page currentPage = new WpfApp1.ProfilePages.Page1(); this.NavigationService.Navigate(currentPage); //rootBox.NavigationService.Navigate(currentPage); //this.NavigationService.Navigate(new Uri(@"SignUp3.xaml", UriKind.RelativeOrAbsolute)); } }