Esempio n. 1
0
 private void ogrenciKaydet_Click(object sender, EventArgs e) //tasarımsal bir veriden yararlanarak öğrenci ve görevli eklemeyi tamamlar.
 {
     if (comboSube.Visible == true)                           //bu veri sadece öğrenci eklemede olduğu için ayırt etmede kullanıldı.
     {
         if (textBox1.TextLength != 0 & TcNo.TextLength != 0 & textBox2.TextLength != 0 & comboSube.SelectedIndex != -1 & comboOgrenciTip.SelectedIndex != -1)
         {                                           //verilerin dolu olmaso
             if (comboOgrenciTip.SelectedIndex == 0) //lisans yüksek lisans vb öğrenci tiplerinin seçimine göre davranır.
             {
                 Lisans yeni = new Lisans(textBox1.Text, Convert.ToDouble(TcNo.Text),
                                          Convert.ToInt32(textBox2.Text), new Sube(Convert.ToInt32(comboSube.SelectedItem)));
                 selectedDers.ogrenciEkle(yeni);      //gerekli bilgiler textboxlar vb araçlardan alınıp nesne yaratılır.
                 listOgrenciler.Items.Add(yeni.Name); //nesnedeki fonksiyona iletilerek eklenir
                 panelkaydet.Visible           = false;
                 textBox1.Text                 = null;
                 TcNo.Text                     = null; //tasarımsal
                 textBox2.Text                 = null;
                 comboSube.SelectedIndex       = -1;
                 comboOgrenciTip.SelectedIndex = -1;
             }
             else if (comboOgrenciTip.SelectedIndex == 1)
             {
                 YuksekLisans yeni = new YuksekLisans(textBox1.Text, Convert.ToDouble(TcNo.Text),
                                                      Convert.ToInt32(textBox2.Text), new Sube(Convert.ToInt32(comboSube.SelectedItem)));
                 selectedDers.ogrenciEkle(yeni); //yukarıdaki işlemlerin benzeri.
                 listOgrenciler.Items.Add(yeni.Name);
                 panelkaydet.Visible           = false;
                 textBox1.Text                 = null;
                 TcNo.Text                     = null; //tasarımsal
                 textBox2.Text                 = null;
                 comboSube.SelectedIndex       = -1;
                 comboOgrenciTip.SelectedIndex = -1;
             }
             else
             {
                 Doktora yeni = new Doktora(textBox1.Text, Convert.ToDouble(TcNo.Text),
                                            Convert.ToInt32(textBox2.Text), new Sube(Convert.ToInt32(comboSube.SelectedItem)));
                 selectedDers.ogrenciEkle(yeni); //yukarıdaki işlemlerin benzeri.
                 listOgrenciler.Items.Add(yeni.Name);
                 panelkaydet.Visible           = false;
                 textBox1.Text                 = null;
                 TcNo.Text                     = null; //tasarımsal
                 textBox2.Text                 = null;
                 comboSube.SelectedIndex       = -1;
                 comboOgrenciTip.SelectedIndex = -1;
             }
         }
         else
         {
             MessageBox.Show("Öğrenci bilgilerini doldurunuz.");
         }
     }
     else
     {
         if (textBox1.TextLength != 0 & TcNo.TextLength != 0 & textBox2.TextLength != 0)
         {
             OgretimElemani yeni = new OgretimElemani(textBox1.Text, Convert.ToDouble(TcNo.Text),
                                                      Convert.ToInt32(textBox2.Text)); //yukarıdaki işlemlerin benzeri şekilde görevli eklenir.
             selectedDers.ogretimGorevlisiEkle(yeni);
             listOgretimElemanlari.Items.Add(yeni.Name);
             panelkaydet.Visible = false;
             textBox1.Text       = null; //tasarımsal
             TcNo.Text           = null;
             textBox2.Text       = null;
         }
         else
         {
             MessageBox.Show("Öğretim görevlisi bilgilerini doldurunuz.");
         }
     }
 }
Esempio n. 2
0
 public void ogretimGorevlisiEkle(OgretimElemani ogretimElemani) //görevli ekleme.
 {
     ogretimGorevlileri.Add(ogretimElemani);
 }