Exemple #1
0
        private void deleteColumnToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (SelectHeaderColumnIndex > -1)
            {
                if (stationComboBox.Text != "" && modelComboBox.Text != "" && customerComboBox.Text != "")
                {
                    tableColList.RemoveAt(SelectHeaderColumnIndex);
                    DataGridView1.Columns.RemoveAt(SelectHeaderColumnIndex);

                    Sqlite.DeleteColumnInfo(stationComboBox.Text, modelComboBox.Text, customerComboBox.Text, SelectHeaderColumnIndex);
                    Sqlite.UpdateProduct(stationComboBox.Text, modelComboBox.Text, customerComboBox.Text, DataGridView1.RowCount, DataGridView1.ColumnCount);
                }

                SelectHeaderColumnIndex = -1;
            }
        }
Exemple #2
0
        private void deleteBtn_Click(object sender, EventArgs e)
        {
            if (DataGridView1.CurrentCell == null)
            {
                MessageBox.Show("请选择表格", "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            if (stationComboBox.Text == "")
            {
                MessageBox.Show("请输入站別", "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            if (modelComboBox.Text == "")
            {
                MessageBox.Show("请输入产品型号", "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            if (customerComboBox.Text == "")
            {
                MessageBox.Show("请输入客戶別", "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            if (MessageBox.Show("确定删除表格啊?", "警告", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes)
            {
                Sqlite.DeleteProduct(stationComboBox.Text, modelComboBox.Text, customerComboBox.Text);
                for (int i = 0; i < tableColList.Count; i++)
                {
                    Sqlite.DeleteColumnInfo(stationComboBox.Text, modelComboBox.Text, customerComboBox.Text, i);
                }

                DataGridView1.Rows.Clear();
                DataGridView1.Columns.Clear();
                stationComboBox.Text  = "";
                modelComboBox.Text    = "";
                customerComboBox.Text = "";
            }
        }