public CreateList(ToDoUser user) { InitializeComponent(); this.user = user; this.list = this.user.getUserToDoList(); }
/// <summary> /// Method called to construct a new User /// </summary> /// <param name="desiredUsernam">The desired username of the user</param> /// <param name="desiredPassword">The desired password of the user</param> /// <returns>True if the user was registered/created succesfully or False if not</returns> public ToDoUser RegisterUser(string desiredUsername, string desiredPassword) { int passwordVal = HashPassword(desiredPassword); CurrentUser = new ToDoUser(desiredUsername, passwordVal); LoginUser(CurrentUser); return(CurrentUser); }
public CompleteTask(ToDoUser user, int taskIndex) { InitializeComponent(); userObject = user; this.taskIndex = taskIndex; fillTaskInfo(); fillSubtasks(); }
public EditTask(ToDoUser userObject, int taskIndex, List <Task> tasks, Dictionary <int, SubTask> subtasks) { InitializeComponent(); this.userObject = userObject; this.tasks = tasks; this.subtasks = subtasks; this.taskIndex = taskIndex; fillTaskInfo(); fillSubtaskInfo(); }
private void submitButtonClick(object sender, RoutedEventArgs e) { string submitButtonText = this.submitButtonText.Text; if (submitButtonText == "Create User") //if creating user { username = this.usernameTextBox.Text; password = this.passwordTextBox.Password.ToString(); passCheck = this.passwordRetypeTextBox.Password.ToString(); if (password.Equals(passCheck)) { ToDoUser user = todo.RegisterUser(username, password); //int userID = user.UserId; //List<TaskList> tl = user.LoadList(userID); Dashboard dash = new Dashboard(user); NavigationService.Navigate(dash); } } else if (submitButtonText == "Log In") //if logging in /* * for now: user can only make a user & use a blank list, they cannot log in with an existing user */ { username = this.usernameTextBox.Text; password = this.passwordTextBox.Password.ToString(); bool check = todo.CheckInput(username, password); if (check == true) { //ToDoUser user = todo //blake->needs data from database to construct user before we can log in a user NavigationService nav = NavigationService.GetNavigationService(this); nav.Navigate(new Uri("/GUI/Dashboard.xaml", UriKind.RelativeOrAbsolute)); } //ToDoUser user = //todo.LoginUser(); //sends user to dashboard if login is valid } }
/// <summary> /// Gathers all the pertinent data for a user and displays the main page /// </summary> /// <param name="User">The User being logged in</param> private ToDoUser LoginUser(ToDoUser User) { User.LoadList(User.UserId); return(CurrentUser); }