private void dataGrid_CellMouseClick(object sender, DataGridViewCellMouseEventArgs e) { int neededID = 0; try { neededID = Convert.ToInt32(dataGrid.Rows[e.RowIndex].Cells[0].Value); } catch (Exception) { } if (delete) { server.deleteByID(tableName, neededID); } if (change) { addItem_frm additem = new addItem_frm();; additem.tableName = this.tableName; additem.Text = additem.button.Text = "Изменить"; additem.change = true; additem.changeId = neededID; additem.ShowDialog(); } server.refreshDataGrid(tabParams, movingPictureBox, dataGrid); }
private void addItem_pictureBox_Click(object sender, EventArgs e) { addItem_frm additem = new addItem_frm();; additem.tableName = this.tableName; additem.Text = additem.button.Text = "Добавить"; additem.ShowDialog(); }