Exemplo n.º 1
0
 private void btn_deleteCurrentDatabase_Click(object sender, EventArgs e)
 {
     ModifyStructure.DeleteDatabase();
     tabPage_readDatabase.Enabled    = false;
     tabPage_modifyDatabase.Enabled  = false;
     tabPage_modifyStructure.Enabled = false;
     ClearEverything();
 }
Exemplo n.º 2
0
 //Usuwanie kolumny
 private void btn_removeSelectedColumn_Click(object sender, EventArgs e)
 {
     if (dataGridView_modifyStructure.SelectedCells.Count > 0)
     {
         int selectedColumnIndex;
         foreach (DataGridViewCell cell in dataGridView_modifyStructure.SelectedCells)
         {
             selectedColumnIndex = cell.ColumnIndex;
             ModifyStructure.DeleteColumn(cB_tableToDelete.Text,
                                          dataGridView_modifyStructure.Columns[selectedColumnIndex].Name);
         }
     }
     RefreshGridViews();
 }
Exemplo n.º 3
0
//Usuwanie zaznaczonych kolumn i wierszy//////////////////////////////////////////////
        //Usuwanie wiersza
        private void btn_removeSelectedRow_Click(object sender, EventArgs e)
        {
            if (dataGridView_modifyStructure.SelectedCells.Count > 0)
            {
                int selectedRowIndex;
                int id;
                foreach (DataGridViewCell cell in dataGridView_modifyStructure.SelectedCells)
                {
                    selectedRowIndex = cell.RowIndex;
                    id = Convert.ToInt32(
                        dataGridView_modifyStructure.Rows[selectedRowIndex].Cells[0].Value);
                    ModifyStructure.DeleteRow(cB_tableToDelete.Text,
                                              dataGridView_modifyStructure.Columns[0].Name, id);
                }
            }
            RefreshGridViews();
        }
Exemplo n.º 4
0
///////////////////////////////////////////////////////////////////////////////////
        private void btn_deleteChosenTable_Click_1(object sender, EventArgs e)
        {
            ModifyStructure.DeleteTable(cB_tableToDelete.Text);
            RefreshComboBoxes();
            RefreshGridViews();
        }