private void bunifuCustomDataGridTypesDataBase_CellContentClick(object sender, DataGridViewCellEventArgs e) { if (e.ColumnIndex == 2) { AddForms.DNCAddForm.DNCFabricTypeAddForm editType = new AddForms.DNCAddForm.DNCFabricTypeAddForm( bunifuCustomDataGridTypesDataBase.Rows[e.RowIndex].Cells["ColumnType_id"].Value.ToString(), bunifuCustomDataGridTypesDataBase.Rows[e.RowIndex].Cells["ColumnType"].Value.ToString() ); editType.DialogResult = DialogResult.None; editType.ShowDialog(); if (editType.DialogResult == DialogResult.OK) { load_types(); } } else if (e.ColumnIndex == 3) { DialogResult dialog = MessageBox.Show("Ви дійсно бажаєте видалити цей об'єкт?", "?", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (dialog == DialogResult.No) { return; } AddForms.DNCAddForm.DNCFabricTypeAddForm editType = new AddForms.DNCAddForm.DNCFabricTypeAddForm( bunifuCustomDataGridTypesDataBase.Rows[e.RowIndex].Cells["ColumnType_id"].Value.ToString(), this ); } }
private void buttonAdd_Click(object sender, EventArgs e) { AddForms.DNCAddForm.DNCFabricTypeAddForm newType = new AddForms.DNCAddForm.DNCFabricTypeAddForm(); newType.DialogResult = DialogResult.None; newType.ShowDialog(); if (newType.DialogResult == DialogResult.OK) { load_types(); } }