Example #1
0
 private void GetAllParamsFromDialog(MyList <Mammalia> mamList, createNewMammaliaDialog dlg)
 {
     mamList.GetHeadData().Multicellular = dlg.MulticellularDlg;
     mamList.GetHeadData().Aerobe        = dlg.AerobeDlg;
     mamList.GetHeadData().Dioecious     = dlg.DioeciousDlg;
     mamList.GetHeadData().Phylum        = dlg.PhylumDlg;
     mamList.GetHeadData().Classis       = dlg.ClassisDlg;
     if (dlg.SpeciesDlg == "")
     {
         dlg.SpeciesDlg = "Not defined";
     }
     mamList.GetHeadData().Species = dlg.SpeciesDlg;
     mamList.GetHeadData().Weight  = dlg.WeightDlg;
     mamList.GetHeadData()[0] = dlg.HabitatDlg1;
     mamList.GetHeadData()[1] = dlg.HabitatDlg2;
     mamList.GetHeadData()[2] = dlg.HabitatDlg3;
     mamList.GetHeadData()[3] = dlg.HabitatDlg4;
     for (int i = 0; i < 4; i++)
     {
         if (mamList.GetHeadData()[i] == "")
         {
             mamList.GetHeadData()[i] = "Not defined";
         }
     }
 }
Example #2
0
 private void PutDefoltParamsToDialog(createNewMammaliaDialog dlg)
 {
     dlg.MulticellularDlg = false;
     dlg.AerobeDlg        = false;
     dlg.DioeciousDlg     = false;
     dlg.PhylumDlg        = "Хордовые";
     dlg.ClassisDlg       = "Млекопитающие";
 }
Example #3
0
        private void button2_Click(object sender, EventArgs e)//addMammalia
        {
            createNewMammaliaDialog createDlg = new createNewMammaliaDialog();

            mamList.AddNode(new Mammalia());
            PutDefoltParamsToDialog(createDlg);
            createDlg.ShowDialog();
            GetAllParamsFromDialog(mamList, createDlg);
            MessageBox.Show("Добавлена запись:\n\n" + mamList.GetHeadData().ToString());
            showSpeciesInListBBox();
        }
Example #4
0
        private void сЗадаваемымиПараметрамиToolStripMenuItem_Click(object sender, EventArgs e)
        {
            createNewMammaliaDialog createDlg = new createNewMammaliaDialog();

            mamList.AddNode(new Mammalia());
            PutDefoltParamsToDialog(createDlg);
            createDlg.ShowDialog();
            GetAllParamsFromDialog(mamList, createDlg);
            MessageBox.Show("Добавлена запись:\n\n" + mamList.GetHeadData().ToString());
            showSpeciesInListBBox();
        }
Example #5
0
 private void PutAllParamsToDialog(MyList <Mammalia> mamList, createNewMammaliaDialog dlg)
 {
     dlg.MulticellularDlg = mamList.GetHeadData().Multicellular;
     dlg.AerobeDlg        = mamList.GetHeadData().Aerobe;
     dlg.DioeciousDlg     = mamList.GetHeadData().Dioecious;
     dlg.PhylumDlg        = mamList.GetHeadData().Phylum;
     dlg.ClassisDlg       = mamList.GetHeadData().Classis;
     dlg.SpeciesDlg       = mamList.GetHeadData().Species;
     dlg.WeightDlg        = mamList.GetHeadData().Weight;
     dlg.HabitatDlg1      = mamList.GetHeadData()[0];
     dlg.HabitatDlg2      = mamList.GetHeadData()[1];
     dlg.HabitatDlg3      = mamList.GetHeadData()[2];
     dlg.HabitatDlg4      = mamList.GetHeadData()[3];
 }
Example #6
0
        private void redactMammalia_Click(object sender, EventArgs e)
        {
            createNewMammaliaDialog redactDlg;

            if (mamList.ExistHead() == true)
            {
                redactDlg = new createNewMammaliaDialog(mamList.GetHeadData());
            }
            else
            {
                MessageBox.Show("В списке нет ни одной записи.");
                return;
            }
            PutAllParamsToDialog(mamList, redactDlg);
            redactDlg.ShowDialog();
            GetAllParamsFromDialog(mamList, redactDlg);
            MessageBox.Show(mamList.GetHeadData().ToString());
            showSpeciesInListBBox();
        }