Пример #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);

                    TableXml.DeleteColumnInfo(stationComboBox.Text, modelComboBox.Text, customerComboBox.Text, SelectHeaderColumnIndex);
                    TableXml.SaveProduct(stationComboBox.Text, modelComboBox.Text, customerComboBox.Text, DataGridView1.RowCount, DataGridView1.ColumnCount);
                }

                SelectHeaderColumnIndex = -1;
            }
        }
Пример #2
0
        private void addRowToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (SelectHeaderRowIndex > -1)
            {
                DataGridView1.Rows.Insert(SelectHeaderRowIndex);

                for (int i = 0; i < DataGridView1.RowCount; i++)
                {
                    DataGridView1.Rows[i].HeaderCell.Value = (i + 1).ToString();
                }

                SelectHeaderRowIndex = -1;

                TableXml.SaveProduct(stationComboBox.Text, modelComboBox.Text, customerComboBox.Text, DataGridView1.RowCount, DataGridView1.ColumnCount);
            }
        }
Пример #3
0
        private void addColumnToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (SelectHeaderColumnIndex > -1)
            {
                if (stationComboBox.Text != "" && modelComboBox.Text != "" && customerComboBox.Text != "")
                {
                    TABLECOLUMN tableCol = new TABLECOLUMN();
                    tableCol.Name = "New";

                    DataGridViewColumn dtCol = new DataGridViewColumn();
                    dtCol.Name         = "New";
                    dtCol.Width        = 60;
                    dtCol.SortMode     = DataGridViewColumnSortMode.NotSortable;
                    dtCol.CellTemplate = new DataGridViewTextBoxCell();

                    tableColList.Insert(SelectHeaderColumnIndex, tableCol);
                    DataGridView1.Columns.Insert(SelectHeaderColumnIndex, dtCol);
                    TableXml.InsertColumnInfo(stationComboBox.Text, modelComboBox.Text, customerComboBox.Text, SelectHeaderColumnIndex, tableCol);
                    TableXml.SaveProduct(stationComboBox.Text, modelComboBox.Text, customerComboBox.Text, DataGridView1.RowCount, DataGridView1.ColumnCount);
                }

                SelectHeaderColumnIndex = -1;
            }
        }