Example #1
0
        private void Add_button_Click(object sender, EventArgs e)
        {
            Update_button.Hide();
            Delete_button.Hide();
            Add_button.Hide();

            Update_Form UF = Configurate.OptimalView_Form("Add", Update_DGV, RowToEdit, UpdateTable_CB.Text);

            UF.ShowDialog();
            Presenter.GetDGV(Update_DGV, UpdateTable_CB.Text, (int)OperationOption.UpdateRoutes);
        }
Example #2
0
        internal static Update_Form OptimalView_Form(string operationOption, DataGridView Update_DGV, int rowToEdit, string tableName)
        {
            Update_Form UF = new Update_Form()
            {
                DGV_row        = new List <string>(),
                DGV_header     = new List <string>(),
                TableName      = string.Empty,
                SelectedOption = operationOption
            };

            UF.TableName = tableName;

            for (int i = 0; i < Update_DGV.ColumnCount; i++)
            {
                UF.DGV_row.Add(Update_DGV.Rows[rowToEdit].Cells[i].Value.ToString());
                UF.DGV_header.Add(Update_DGV.Columns[i].HeaderText);
            }

            return(UF);
        }