private void OKDateButton_Click(object sender, EventArgs e) { if (String.IsNullOrWhiteSpace(SubSectorNameTextBox.Text)) { Infinium.LightMessageBox.Show(ref TopForm, false, "Некорректное название подучастка!", "Ошибка"); return; } if (IsNew) { TechStoreManager.AddSubSector(Convert.ToInt32(SectorsGrid.SelectedRows[0].Cells["SectorID"].Value), SubSectorNameTextBox.Text); } else { TechStoreManager.EditSubSector(SubSectorID, Convert.ToInt32(SectorsGrid.SelectedRows[0].Cells["SectorID"].Value), SubSectorNameTextBox.Text); } Ok = true; this.Close(); }