示例#1
0
        private void OKDateButton_Click(object sender, EventArgs e)
        {
            if (String.IsNullOrWhiteSpace(SectorNameTextBox.Text))
            {
                Infinium.LightMessageBox.Show(ref TopForm, false,
                                              "Некорректное название участка!",
                                              "Ошибка");
                return;
            }

            int FactoryID;

            if (FactoryComboBox.SelectedItem.ToString() == "Профиль")
            {
                FactoryID = 1;
            }
            else
            {
                FactoryID = 2;
            }

            if (!IsNew)
            {
                TechStoreManager.EditSector(SectorID, FactoryID, SectorNameTextBox.Text);
            }
            else
            {
                TechStoreManager.AddSector(FactoryID, SectorNameTextBox.Text);
            }

            Ok = true;
            this.Close();
        }