private void userComments_SelectedIndexChanged(object sender, EventArgs e) { comments2.Visible = true; commentDetails.Visible = true; int task_id; DataTable comment_IDs; //get the id of the selected task if (currentTasks.SelectedItem != null) { task_id = StoryTask.getTaskID(currentTasks.SelectedItem.ToString()); } else { task_id = StoryTask.getTaskID(completedTasks.SelectedItem.ToString()); } //get the id of the person whose name was selected from comments list int userID = SQL.getOwnerUserID(SQL.getUsername(userComments.Text)); //get the comment ids for the selected task comment_IDs = StoryTask.getCommentID(task_id); //find the correct comment from the userID and commentIDs StoryTask.loadCommentDetail(userID, comment_IDs, commentDetails); }
private void completedTasks_SelectedIndexChanged(object sender, EventArgs e) { int id, uid; string name; if (completedTasks.SelectedItem != null) { userComments.Items.Clear(); //get task StoryTask.getTaskInfo(completedTasks.SelectedItem.ToString(), develop1, develop2, develop1Name, develop1Email, develop1Position, develop2Name, develop2Email, develop2Position); //remove the selection of the item in the other box if one was selected if (currentTasks.SelectedItem != null) { currentTasks.SetSelected(currentTasks.Items.IndexOf(currentTasks.SelectedItem), false); } DataTable commentIDs = StoryTask.getCommentID(StoryTask.getTaskID(completedTasks.SelectedItem.ToString())); foreach (DataRow row in commentIDs.Rows) { id = int.Parse(row["CommentID"].ToString()); uid = StoryTask.getCommenter(id); name = SQL.getFullName(uid); userComments.Items.Add(name); } comments.Visible = true; userComments.Visible = true; comment.Visible = true; hideTaskInfo.Visible = true; } }