Exemplo n.º 1
0
        private void _btnProjectBrowse_Click(object sender, EventArgs e)
        {
            var projects          = ProjectList.Load(false);
            WorkorderSelector frm = new WorkorderSelector(projects);

            frm.Owner = this;

            if (frm.ShowDialog() == DialogResult.OK)
            {
                _lblProjectCode.Text = frm.SelectedProject.Code;
                _lblProjectCode.Tag  = frm.SelectedProject.Id;
                CheckTimesForOverlap();
            }
        }
Exemplo n.º 2
0
        private void HandleProjectButtonClick(DataGridViewCellEventArgs e)
        {
            ProjectList projects = ProjectList.Load(false);

            WorkorderSelector frm = new WorkorderSelector(projects);

            frm.Owner = this;

            if (frm.ShowDialog() == DialogResult.OK)
            {
                CurrentItems.Items[e.RowIndex].ProjectID = frm.SelectedProject.Id;

                _dgvItems.Refresh();
                _cachedProjects = ProjectList.Load(false);
                SetProjectCodesFromIDs();
            }
        }
Exemplo n.º 3
0
        private void _dataGridView_SortCompare(object sender, DataGridViewSortCompareEventArgs e)
        {
            string a = e.CellValue1.ToString();
            string b = e.CellValue2.ToString();

            if (_dataGridView.SortedColumn.Index == codeDataGridViewTextBoxColumn.Index)
            {
                try
                {
                    e.SortResult = WorkorderSelector.ProjectCodeSort(a, b, _dataGridView.SortOrder);
                    e.Handled    = true;
                    return;
                }
                catch { }
            }

            e.SortResult = string.Compare(a, b);
            e.Handled    = true;
        }
Exemplo n.º 4
0
        private void HandleProjectButtonClick(DataGridViewCellEventArgs e)
        {
            ProjectList       projects = ProjectList.Load(false);
            WorkorderSelector frm      = new WorkorderSelector(projects);

            frm.Owner = this;

            if (frm.ShowDialog() == DialogResult.OK)
            {
                for (int i = e.RowIndex; i >= 0; i--)
                {
                    _unconfirmedItems.Items[i].ProjectID = frm.SelectedProject.Id;
                }

                _dgvItems.Refresh();
                _cachedProjects = ProjectList.Load(false);
                SetProjectCodesFromIDs();
                SetWidth();
            }
        }