예제 #1
0
 private void LoadProjects()
 {
     try
     {
         ProjectsViewList.Items.Clear();
         AdminTasksController.GetProjectsItemList(Unit).ForEach(item => ProjectsViewList.Items.Add(item));
     }
     catch (Exception)
     {
         MessageBox.Show("Error loading the projects, please try again later");
     }
 }
예제 #2
0
 private void LoadTasks()
 {
     try
     {
         TasksViewList.Items.Clear();
         AdminTasksController.GetTasksItemList(Unit, SelectedProject.Project_ID).ForEach(item => TasksViewList.Items.Add(item));
     }
     catch (Exception)
     {
         MessageBox.Show("Error loading tasks, please select a project");
     }
 }
예제 #3
0
 private void ProjectName_Click(object sender, EventArgs e)
 {
     ProjectsViewList.Items.Clear();
     try
     {
         AdminTasksController.GetProjectsByInput(Unit, InputTextBox.Text).ForEach(item => ProjectsViewList.Items.Add(item));
     }
     catch (Exception)
     {
         MessageBox.Show("Error loading projects from Database");
     }
 }
예제 #4
0
 private void DeleteTaskBtn_Click(object sender, EventArgs e)
 {
     try
     {
         AdminTasksController.RemoveTask(Unit, SelectedTask);
         LoadProjects();
         LoadTasks();
     }
     catch (Exception)
     {
         MessageBox.Show($"Unable to remove this project");
     }
 }