private void RemoveMachineButton_Click(object sender, EventArgs e) { if (MachinesOperationsGrid.SelectedRows.Count == 0) { return; } int MachinesOperationID = Convert.ToInt32(MachinesOperationsGrid.SelectedRows[0].Cells["MachinesOperationID"].Value); if (TechStoreManager.OperationsUseInCatalog(MachinesOperationID)) { bool OKCancel = Infinium.LightMessageBox.Show(ref TopForm, true, "Операция используется в каталоге. Вы уверены, что хотите удалить?", "Удаление"); if (!OKCancel) { return; } } TechStoreManager.RemoveMachinesOperation(MachinesOperationID); MachinesOperationsBS.DataSource = TechStoreManager.MachinesOperationsDT.Copy(); if (MachinesOperationsGrid.Rows.Count == 0) { MachinesOperationNameTextBox.Text = ""; NormTextBox.Text = ""; ArticleTextBox.Text = ""; MeasureComboBox.SelectedValue = 1; } }