コード例 #1
0
ファイル: CreateTask.xaml.cs プロジェクト: seymej72/ToDoList
        public CreateList(ToDoUser user)
        {
            InitializeComponent();

            this.user = user;
            this.list = this.user.getUserToDoList();
        }
コード例 #2
0
        /// <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);
        }
コード例 #3
0
        public CompleteTask(ToDoUser user, int taskIndex)
        {
            InitializeComponent();

            userObject     = user;
            this.taskIndex = taskIndex;

            fillTaskInfo();
            fillSubtasks();
        }
コード例 #4
0
ファイル: EditTask.xaml.cs プロジェクト: seymej72/ToDoList
        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();
        }
コード例 #5
0
        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
            }
        }
コード例 #6
0
 /// <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);
 }