private void ok_button_Click(object sender, EventArgs e) { //get users username string username = SQL.getUsername(nameBox.Text); //get userID from the name given as input int uid = SQL.getOwnerUserID(username); //insert userID and comment into "Comments" table and retrieve the commentID int id = StoryTask.insertComment(uid, commentBox.Text); //insert task_id and comment_id into "TaskComments" table StoryTask.insertTaskComment(StoryTask.getTaskID(taskNameBox.Text), id); //add name to userComments box on taskTree form userComments.Items.Add(nameBox.Text); this.Close(); }
private void currentTasks_SelectedIndexChanged(object sender, EventArgs e) { int id, uid; string name; try { //get task StoryTask.getTaskInfo(currentTasks.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 (completedTasks.SelectedItem != null) { completedTasks.SetSelected(completedTasks.Items.IndexOf(completedTasks.SelectedItem), false); } DataTable commentIDs = StoryTask.getCommentID(StoryTask.getTaskID(currentTasks.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; } catch (NullReferenceException error) { develop1.Visible = false; develop2.Visible = false; return; } }
public assignTask(string username, string projName) { InitializeComponent(); proj = projName; userName = username; //SQL.getTasks(taskCB, projName); //this doesnt work for sure // SQL.getUndoneTask(taskCB, username, projName); //SQL.getUserTask(currentLB, username, projName); SQL.getProjectMembers(memberLB, username, projName); // i think i made the sql for this right DataTable sprint_IDs = StoryTask.getProject_sprintIDs(proj); //get tasks and put their names in the corresponding listbox foreach (DataRow r in sprint_IDs.Rows) { //get all task ids from the sprint ids DataTable task_IDs = StoryTask.getProject_taskIDs(int.Parse(r["SprintID"].ToString())); //retrieve and add tasks to their correct lists foreach (DataRow row in task_IDs.Rows) { StoryTask.getTaskNameForAssign(taskCB, completeLB, int.Parse(row["Task_ID"].ToString())); } } }
private void Assign_Click_1(object sender, EventArgs e) { if (memberLB.Text.Equals("")) { MessageBox.Show("No user selected.", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1); } else if (taskCB.Text.Equals("")) { MessageBox.Show("No Task selected.", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1); } else { string s = memberLB.GetItemText(memberLB.SelectedItem); string firstname, lastname; string[] substrings = s.Split(' '); firstname = substrings[0]; lastname = substrings[1]; SQL.ExecuteAssignTask(SQL.getUserID(firstname, lastname), taskCB.Text, StoryTask.getTaskID(taskCB.Text)); // I THINK THIS SQL WORKS } }