Exemplo n.º 1
0
        private void miClose_Click(object sender, RoutedEventArgs e)
        {
            if (online.ID == open.Admin.ID)
            {
                MessageBoxResult rsltMessageBox = MessageBox.Show("Are you sure you want to close this project?", online.Username, MessageBoxButton.YesNo);
                switch (rsltMessageBox)
                {
                case MessageBoxResult.Yes:
                    open.Active = false;
                    ProjectController.Serialize();
                    MessageBox.Show("Project Closed!");
                    this.Hide();
                    UserMainWindow umw = new UserMainWindow(online);
                    umw.Show();
                    this.Hide();
                    break;

                case MessageBoxResult.No:
                    break;
                }
            }
            else
            {
                MessageBox.Show("Only the admin can close the project!");
            }
        }
Exemplo n.º 2
0
        private void btnBack_Click(object sender, RoutedEventArgs e)
        {
            this.Hide();
            UserMainWindow umw = new UserMainWindow(this.admin);

            umw.Show();
            this.Close();
        }
Exemplo n.º 3
0
        private void miClose_Click(object sender, RoutedEventArgs e)
        {
            MessageBoxResult rsltMessageBox = MessageBox.Show("Are you sure you want to close this task?", online.Username, MessageBoxButton.YesNo);

            switch (rsltMessageBox)
            {
            case MessageBoxResult.Yes:
                current.Active = false;
                TaskController.Serialize();
                MessageBox.Show("Task Closed!");
                this.Hide();
                UserMainWindow umw = new UserMainWindow(online);
                umw.Show();
                this.Hide();
                break;

            case MessageBoxResult.No:
                break;
            }
        }
Exemplo n.º 4
0
        private void btnLogin_Click(object sender, RoutedEventArgs e)
        {
            UserController uc = new UserController();

            if (uc.LogIn(tbxUsername.Text, pbxPassword.Password) == true)
            {
                if (uc.GetUser(tbxUsername.Text).Active == true)
                {
                    this.Hide();
                    UserMainWindow umw = new UserMainWindow(uc.GetUser(tbxUsername.Text));
                    umw.Show();
                    this.Close();
                }
                else
                {
                    MessageBox.Show("This user no longer exists!");
                }
            }
            else
            {
                MessageBox.Show("Username and Password do not Match!");
            }
        }