Exemplo n.º 1
0
        void SearchList()
        {
            string line = null;
            string name = null;

            DateTime from = DateTime.MinValue;
            DateTime to   = DateTime.MaxValue;

            _table = DatabaseSet.GetInspectList(line, name, from, to);
            _table.Columns.Add("NG處理", typeof(string));

            string sort = bindingSource.Sort;

            bindingSource.Sort = null;

            bindingSource.DataSource = null;
            this.GroupTable          = null;
            if (this.InspectMode == InspeceMode.ByPn)
            {
                bindingSource.DataSource = this.GroupTable;
            }
            else
            {
                bindingSource.DataSource = _table;
            }
            bindingSource.Sort = sort;

            btnSend.Enabled = _table.Rows.Count > 0;
            dgv.EditMode    = DataGridViewEditMode.EditOnEnter;
        }
Exemplo n.º 2
0
        private void btnSend_Click(object sender, EventArgs e)
        {
            DatabaseSet.待驗清單DataTable table = (DatabaseSet.待驗清單DataTable)bindingSource.DataSource;

            if (MessageBox.Show("資料經送出後不可再修改,請確認後繼續", "送出確認", MessageBoxButtons.OKCancel, MessageBoxIcon.Exclamation) == DialogResult.OK)
            {
                int delete;
                int update = DatabaseSet.UpdateInspectDeleteList(table, out delete);

                MessageBox.Show("更新了 " + update + " 筆檢驗資料\n共刪除 " + delete + " 筆檢驗資料");
                SearchList();
            }
        }
Exemplo n.º 3
0
        void SearchUnreinspectList()
        {
            string line = null;
            string name = null;

            _table = DatabaseSet.GetUnreinspectList(line, name);
            _table.Columns.Add("NG處理", typeof(string));

            string sort = bindingSource.Sort;

            bindingSource.Sort = null;

            this.GroupTable          = null;
            this.InspectMode         = InspeceMode.OnlyUnre;
            bindingSource.DataSource = _table;
            bindingSource.Sort       = sort;

            btnSend.Enabled = false;
            dgv.EditMode    = DataGridViewEditMode.EditProgrammatically;
        }
Exemplo n.º 4
0
        void SearchList()
        {
            string qcn        = txtQCN.Text.Trim();
            string partnubmer = txtPartNumber.Text.Trim();

            DateTime date = DateTime.MinValue;

            if (ckbDate.Checked)
            {
                date = dtpDate.Value;
            }

            DatabaseSet.待驗清單DataTable table = DatabaseSet.GetInspectCompleteList(qcn, partnubmer, date);
            table.Columns.Add("刪除", typeof(bool));
            bindingSource.DataSource = table;
            btnSend.Enabled          = table.Rows.Count > 0;

            dgv.AutoResizeColumns();
            dgv.Columns[0].Width = 40;
            dgv.Columns[1].Width = 50;
        }