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"); } }
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"); } }
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"); } }
private void DeleteTaskBtn_Click(object sender, EventArgs e) { try { AdminTasksController.RemoveTask(Unit, SelectedTask); LoadProjects(); LoadTasks(); } catch (Exception) { MessageBox.Show($"Unable to remove this project"); } }