private void Lbx_Project_MouseDoubleClick(object sender, MouseButtonEventArgs e) { Project project = Lbx_Project.SelectedItem as Project; var goToKanBan = new Kanban(project.ProjectId); goToKanBan.Show(); this.Close(); }
private void Btn_Cnl_Click(object sender, RoutedEventArgs e) { Project selectedProject = (from project in App._projects where project.ProjectId == projectId select project).FirstOrDefault() as Project; var Kanban = new Kanban(selectedProject.ProjectId); Kanban.Show(); this.Close(); }
private void Btn_CrtTsk_Click(object sender, RoutedEventArgs e) { Project selectedProject = (from project in App._projects where project.ProjectId == projectId select project).FirstOrDefault() as Project; var toDoTasks = from t in selectedProject.tasks where t.Status == "To Do" select t; var inProgressTasks = from t in selectedProject.tasks where t.Status == "In Progress" select t; Task newTask = new Task { TaskId = Math.Abs(Guid.NewGuid().GetHashCode()).ToString(), Title = "Edit...", Description = "Edit...", TaskStartDate = DateTime.Now, TaskDeadline = DateTime.Now, AddtnInfo = "Edit...", Status = "To DO" /* Title = Tbx_title.Text, * Description = Tbx_Description.Text, * Priority = CoBox_TaskPrioprity.SelectionBoxItem as String, * Status = CoBox_Status.SelectionBoxItem as String, * AddtnInfo = Tbx_Add_Info.Text, * DependentTaskID = CoBoxDepend_Tsk.SelectionBoxItem as String*/ }; selectedProject.tasks.Add(newTask); App._projects.Add(selectedProject); Lbx_Task.SelectedItem = newTask; Lbx_Task.ScrollIntoView(newTask); if (toDoTasks != null && toDoTasks.Count() >= Int32.Parse(selectedProject.ToDoLimit)) { MessageBox.Show("Number of allowed tasks in To do is exhausted.", "Project Management", MessageBoxButton.OK, MessageBoxImage.Warning); return; } if (inProgressTasks != null && inProgressTasks.Count() >= Int32.Parse(selectedProject.InProgressLimit)) { MessageBox.Show("Number of allowed tasks in In Progress is exhausted.", "Project Management", MessageBoxButton.OK, MessageBoxImage.Warning); return; } selectedProject.tasks.Add(newTask); var res = MessageBox.Show("Task created successfully! \n Do you want to create more tasks ?", "Project Management", MessageBoxButton.YesNo, MessageBoxImage.Question); if (res == MessageBoxResult.No) { Kanban kanban = new Kanban(selectedProject.ProjectId); kanban.Show(); this.Close(); } else { AddTask addTask = new AddTask(selectedProject.ProjectId); addTask.Show(); this.Close(); } }
private void Btn_BtnGoToKanban_Click(object sender, RoutedEventArgs e) { Project project = Lbx_Project.SelectedItem as Project; if (project != null) { var goToKanBan = new Kanban(project.ProjectId); goToKanBan.Show(); this.Close(); } else { MessageBox.Show("Please select a Project..", "Project Management", MessageBoxButton.OK, MessageBoxImage.Error); } }
private void Del_Click(object sender, RoutedEventArgs e) { Project selectedProject = (from p in App._projects where p.ProjectId == projId select p).FirstOrDefault() as Project; Task toDelete = new Task(); MenuItem menu = sender as MenuItem; if (menu.Name == "ToDoDelMenu") { toDelete = Lbx_ToDoTasks.SelectedItem as Task; } else if (menu.Name == "InProgDelMenu") { toDelete = Lbx_InProgressTasks.SelectedItem as Task; } else if (menu.Name == "TestDelMenu") { toDelete = Lbx_TestingTasks.SelectedItem as Task; } else if (menu.Name == "DoneDelMenu") { toDelete = Lbx_DoneTasks.SelectedItem as Task; } /*if (clickedItem == null) * {MessageBox.Show("Pleae Selected an Item to be deleted first!!!", "Error", MessageBoxButton.OK, MessageBoxImage.Error); * return;}*/ var res = MessageBox.Show($"Are you sure you want to delete {toDelete.Title}?", "Message", MessageBoxButton.OKCancel, MessageBoxImage.Warning); if (res == MessageBoxResult.OK) { selectedProject.tasks.Remove(toDelete); } Kanban kanban = new Kanban(selectedProject.ProjectId); kanban.Show(); this.Close(); }
private void Move_Click(object sender, RoutedEventArgs e) { Project selectedProject = (from p in App._projects where p.ProjectId == projId select p).FirstOrDefault() as Project; Task toMove = new Task(); string nextStatus = "In Progress"; MenuItem menu = sender as MenuItem; if (menu.Name == "ToDoMoveMenu") { toMove = Lbx_ToDoTasks.SelectedItem as Task; nextStatus = "In Progress"; } else if (menu.Name == "InProgMoveMenu") { toMove = Lbx_InProgressTasks.SelectedItem as Task; nextStatus = "Testing"; } else if (menu.Name == "TestMoveMenu") { toMove = Lbx_TestingTasks.SelectedItem as Task; nextStatus = "Done"; } var mov = MessageBox.Show($"Are you sure you want to Move {toMove.Title} to {nextStatus} ?", "Message", MessageBoxButton.OKCancel, MessageBoxImage.Warning); if (mov == MessageBoxResult.OK) { Task task = (from t in selectedProject.tasks where t.TaskId == toMove.TaskId select t).FirstOrDefault(); task.Status = nextStatus; } Kanban kanban = new Kanban(selectedProject.ProjectId); kanban.Show(); this.Close(); }