private void OKDateButton_Click(object sender, EventArgs e) { if (String.IsNullOrWhiteSpace(ToolsTypeNameTextBox.Text)) { Infinium.LightMessageBox.Show(ref TopForm, false, "Некорректное название типа!", "Ошибка"); return; } if (IsNew) { TechStoreManager.AddToolsType(Convert.ToInt32(ToolsGroupGrid.SelectedRows[0].Cells["ToolsGroupID"].Value), ToolsTypeNameTextBox.Text); } else { TechStoreManager.EditToolsType(ToolsTypeID, Convert.ToInt32(ToolsGroupGrid.SelectedRows[0].Cells["ToolsGroupID"].Value), ToolsTypeNameTextBox.Text); } Ok = true; this.Close(); }