private void FillTasks()
        {
            /* FillTasks()
             * 1. Grabs all task names and TaskIDs from the
             *    DB where the related task in the intersection table
             *    has a related milestone that is the selected one.
             * 2. Reads them into the TasksForMilestone list.
             * 3. Adds them into a ListBox.
             * */

            // Clear out other tasks.
            lb_Tasks.Items.Clear();

            string s_ConnString = "Provider=Microsoft.ACE.OLEDB.12.0;Data " +
                "Source=|DataDirectory|\\CloseoutApp.accdb";

            string s_Query = "SELECT Tasks.TaskID, TaskList.TaskName " +
                "FROM Tasks " +
                "INNER JOIN TaskList ON TaskList.TaskID = Tasks.TaskID " +
                "WHERE TaskList.RelatedMilestoneID = " +
                    GlobalVars.SelectedMilestone +
                " AND Tasks.ContractID = " + GlobalVars.SelectedContract + ";";

            using (OleDbConnection AccessConn = new OleDbConnection(s_ConnString))
            {
                using (OleDbCommand AccessCmd = AccessConn.CreateCommand())
                {
                    AccessCmd.CommandText = s_Query;
                    try
                    {
                        AccessConn.Open();

                        OleDbDataReader rdr = AccessCmd.ExecuteReader();

                        // Clear out any of these.
                        GlobalVars.TasksForMilestone.Clear();

                        while (rdr.Read())
                        {
                            TaskForMilestone t = new TaskForMilestone();
                            t.TaskID = rdr.GetInt32(0);
                            t.TaskName = rdr.GetString(1);

                            GlobalVars.TasksForMilestone.Add(t);
                        }

                        rdr.Close();
                        AccessConn.Close();

                        foreach (TaskForMilestone tsk in GlobalVars.TasksForMilestone)
                        {
                            lb_Tasks.Items.Add(tsk.TaskName);
                        }

                    }
                    catch (Exception except)
                    {
                        MessageBox.Show("Message: \n" + except, "Error", MessageBoxButton.OK, MessageBoxImage.Error);
                        // Update Status Bar if error
                    }
                }
            }
            // If there aren't currently any tasks, enable the Add All Tasks button.
            if (GlobalVars.TasksForMilestone.Count() == 0)
            {
                btn_AddAllTasks.IsEnabled = true;
            }
        }
        public void UpdateTasksForMilestoneList(int SelectedMilestone)
        {
            /* UpdateTasksForMilestoneList(int SelectedMilestone)
             *
             * 1. Reads a list of tasks for  for the passed int MilestoneID into a GlobalVar list.
             *
             * */

            string s_ConnString = "Provider=Microsoft.ACE.OLEDB.12.0;Data " +
                "Source=|DataDirectory|\\CloseoutApp.accdb";

            string s_Query = "SELECT Tasks.TaskID, TaskList.TaskName, " +
                "TaskList.TaskDescription, Tasks.StartDate, Tasks.CompletionDate, " +
                "Tasks.AssignedDate, Tasks.DueDate, Tasks.Notes, Tasks.UserAssignedTo, " +
                "Users.UserName, TaskList.EBPStepNum " +
                "FROM (Tasks INNER JOIN TaskList ON TaskList.TaskID = Tasks.TaskID ) " +
                "LEFT JOIN Users ON Tasks.UserAssignedTo = Users.UserID " +
                "WHERE TaskList.RelatedMilestoneID = " +
                    SelectedMilestone +
                " AND Tasks.ContractID = " + GlobalVars.SelectedContract + ";";

            using (OleDbConnection AccessConn = new OleDbConnection(s_ConnString))
            {
                using (OleDbCommand AccessCmd = AccessConn.CreateCommand())
                {
                    AccessCmd.CommandText = s_Query;
                    try
                    {
                        AccessConn.Open();

                        OleDbDataReader rdr = AccessCmd.ExecuteReader();

                        // Clear out any of these.
                        GlobalVars.TasksForMilestone.Clear();

                        while (rdr.Read())
                        {
                            TaskForMilestone t = new TaskForMilestone();
                            t.TaskID = rdr.GetInt32(0);
                            t.TaskName = rdr.GetString(1);
                            t.TaskDescription = rdr[2] as string ?? default(string);
                            t.StartDate = rdr[3] as DateTime? ?? default(DateTime);
                            t.CompletionDate = rdr[4] as DateTime? ?? default(DateTime);
                            t.AssignedDate = rdr[5] as DateTime? ?? default(DateTime);
                            t.DueDate = rdr[6] as DateTime? ?? default(DateTime);
                            t.Notes = rdr[7] as string ?? default(string);
                            t.UserAssignedID = rdr[8] as Int32? ?? default(Int32);
                            t.UserAssignedName = rdr[9] as string ?? default(string);
                            t.EBPStepNum = rdr.GetInt32(10);

                            GlobalVars.TasksForMilestone.Add(t);
                        }

                        rdr.Close();
                        AccessConn.Close();

                    }
                    catch (Exception exception)
                    {
                        MessageBox.Show("Database error:\n" + exception.Message +
                     "\nPlease take a screenshot and\nreport this to Ashton.",
                      "Error", MessageBoxButton.OK, MessageBoxImage.Error);
                    }
                }
            }
        }
        private void FillAvailableTasks()
        {
            /** FillAvailableTasks()
             * 1. Grabs the current selected milestone.
             * 2. Pulls all tasks from the DB where their related milestone is the selected one.
             * 3. Reads them into the AvailableTasksForMilestone list.
             * 4. Adds them to a ComboBox.
             * */

            string s_ConnString = "Provider=Microsoft.ACE.OLEDB.12.0;Data " +
                "Source=|DataDirectory|\\CloseoutApp.accdb";

            string s_Query = "SELECT TaskList.TaskID, TaskList.TaskName, " +
            "TaskList.TaskDescription " +
            "FROM TaskList " +
            "WHERE RelatedMilestoneID = " + GlobalVars.SelectedMilestone + ";";

            using (OleDbConnection AccessConn = new OleDbConnection(s_ConnString))
            {
                using (OleDbCommand AccessCmd = AccessConn.CreateCommand())
                {
                    AccessCmd.CommandText = s_Query;
                    try
                    {
                        AccessConn.Open();

                        OleDbDataReader rdr = AccessCmd.ExecuteReader();

                        // Clear out any of these.
                        GlobalVars.AvailableTasksForMilestone.Clear();

                        while (rdr.Read())
                        {
                            TaskForMilestone t = new TaskForMilestone();
                            t.TaskID = rdr.GetInt32(0);
                            t.TaskName = rdr.GetString(1);
                            t.TaskDescription = rdr[2] as string ?? default(string);

                            GlobalVars.AvailableTasksForMilestone.Add(t);
                        }

                        rdr.Close();
                        AccessConn.Close();

                        foreach (TaskForMilestone tsk in GlobalVars.AvailableTasksForMilestone)
                        {
                            cb_TasksPicker.Items.Add(tsk.TaskName);
                        }

                    }
                    catch (Exception except)
                    {
                        MessageBox.Show("Message: \n" + except, "Error", MessageBoxButton.OK, MessageBoxImage.Error);
                        // Update Status Bar if error
                    }
                }
            }
        }