コード例 #1
0
        private void FormTaskSearch_Load(object sender, EventArgs e)
        {
            if (IsSelectionMode)
            {
                butClose.Text = "Cancel";
            }
            //Note: DateTime strings that are empty actually are " " due to how the empty datetime control behaves.
            _listTaskPriorities = Defs.GetDefsForCategory(DefCat.TaskPriorities);
            long userNum = 0;

            comboUsers.Items.Add(Lan.g(this, "All"));
            comboUsers.Items.Add(Lan.g(this, "Me"));
            comboUsers.SelectedIndex = 0;          //Always default to All.
            _listUsers = Userods.GetDeepCopy();    //List of all users for searching.  I figure we don't want to exclude hidden ones for searching.
            _listUsers.ForEach(x => comboUsers.Items.Add(x.UserName));
            comboPriority.Items.Add(Lan.g(this, "All"));
            for (int i = 0; i < _listTaskPriorities.Count; i++)
            {
                comboPriority.Items.Add(_listTaskPriorities[i].ItemName);
            }
            comboPriority.SelectedIndex = 0;
            checkLimit.Checked          = true;
            if (PrefC.HasReportServer)
            {
                checkReportServer.Checked = true;
            }
            else
            {
                checkReportServer.Visible = false;
            }
            _tableTasks = Tasks.GetDataSet(userNum, new List <long>(), 0, " ", " ", " ", " ", textDescription.Text, 0, 0, checkBoxIncludesTaskNotes.Checked,
                                           checkBoxIncludeCompleted.Checked, true, checkReportServer.Checked);
            FillGrid();
        }
コード例 #2
0
        private void RefreshTable()
        {
            long priority = 0;

            if (comboPriority.SelectedIndex != 0)
            {
                priority = _listTaskPriorities[comboPriority.SelectedIndex - 1].DefNum;
            }
            long userNum = 0;

            if (comboUsers.SelectedIndex == 1)          //Me
            {
                userNum = Security.CurUser.UserNum;
            }
            else if (comboUsers.SelectedIndex != 0)
            {
                userNum = _listUsers[comboUsers.SelectedIndex - 2].UserNum;            //1(All) + 1(Me)= 2
            }
            List <long> listTaskListNums = new List <long>();

            if (textTaskList.Text != "")
            {
                listTaskListNums = TaskLists.GetNumsByDescription(textTaskList.Text, checkReportServer.Checked);
                if (listTaskListNums.Count == 0)
                {
                    MsgBox.Show(this, "Task List not found.");
                    return;
                }
            }
            List <long> listTaskNums = new List <long>()
            {
            };

            if (textTaskNum.Text != "")
            {
                try {
                    listTaskNums = textTaskNum.Text.Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries).Select(x => PIn.Long(x)).ToList();
                }
                catch {
                    MsgBox.Show(this, "Invalid Task Num format.");
                    return;
                }
            }
            long patNum = 0;

            if (textPatNum.Text != "")
            {
                try {
                    patNum = PIn.Long(textPatNum.Text);
                }
                catch {
                    MsgBox.Show(this, "Invalid PatNum format.");
                    return;
                }
            }
            _tableTasks = Tasks.GetDataSet(userNum, listTaskListNums, listTaskNums, dateCreatedFrom.Text, dateCreatedTo.Text, dateCompletedFrom.Text,
                                           dateCompletedTo.Text, textDescription.Text, priority, patNum, checkBoxIncludesTaskNotes.Checked, checkBoxIncludeCompleted.Checked,
                                           checkLimit.Checked, checkReportServer.Checked);
        }