private void saveMenuItem_Click(object sender, RoutedEventArgs e)
 {
     bool[] local = new bool[3];
     if (modelRegress != null) if (modelRegress.id == -1) { local[0] = true; local[2] = true; }
     if (modelDescret != null) if (modelDescret.id == -1) { local[1] = true; local[2] = true; }
     if (technology != null) if (technology.id == -1) local[2] = true;
     if (technologyCorrected != null) if (technologyCorrected.id == -1) local[2] = true;
     SaveHelper sWindow = new SaveHelper(local);
     if (sWindow.IsEnabled) sWindow.ShowDialog();
     int res = sWindow.result; // 0 -regress model, 1 - descret model, 2 - all avaliable
     sWindow.Close();
     if (res == 0) saveRegModel(true);
     if (res == 1) saveDesModel(true);
     if (res == 2)
     {
         if (modelRegress != null) if (modelRegress.id == -1) saveRegModel(false);
         if (modelDescret != null) if (modelDescret.id == -1) saveDesModel(false);
         if (technology != null) if (technology.id == -1)
             {
                 technology.descretID = modelDescret.id;
                 technology.regressID = modelRegress.id;
                 labelOptDesID.Text = "ID дескр. модели: " + modelDescret.id.ToString();
                 labelOptRegID.Text = "ID регр. модели: " + modelRegress.id.ToString();
                 saveTechnology(technology);
             }
         if (technologyCorrected != null) if (technologyCorrected.id == -1)
             {
                 technologyCorrected.descretID = modelDescret.id;
                 technologyCorrected.baseTechnologyID = technology.id;
                 labelCorDesID.Text = "ID дескр. модели: " + modelDescret.id.ToString();
                 labelCorOptID.Text = "ID исх. технологии: " + technology.id.ToString();
                 saveTechnology(technologyCorrected);
             }
     }
 }