Esempio n. 1
0
        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);
        }
Esempio n. 2
0
        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;
            }
        }
Esempio n. 3
0
        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();
        }
Esempio n. 4
0
 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
     }
 }