Exemplo n.º 1
0
 private void btnGuncelle_Click(object sender, EventArgs e)
 {
     if (seciliOgretmen == null)
     {
         MessageBox.Show("Güncellenecek Öğretmen bulunamadı");
         return;
     }
     seciliOgretmen = Ogretmenler.Where(x => x.TCKN == seciliOgretmen.TCKN).First();
     try
     {
         seciliOgretmen.Ad          = txtAd.Text;
         seciliOgretmen.Adres       = txtAdres.Text;
         seciliOgretmen.DogumTarihi = dtpDogumTarihi.Value;
         seciliOgretmen.Soyad       = txtSoyad.Text;
         seciliOgretmen.TCKN        = txtTCKN.Text;
         seciliOgretmen.Telefon     = txtTelefon.Text.Replace(" ", "");
         seciliOgretmen.Cinsiyet    = (Cinsiyetler)Enum.Parse(typeof(Cinsiyetler), cmbCinsiyet.SelectedItem.ToString());
         seciliOgretmen.Brans       = (Branslar)Enum.Parse(typeof(Branslar), cmbBrans.SelectedItem.ToString());
         seciliOgretmen.SicilNo     = txtSicil.Text;
         seciliOgretmen.Maas        = nMaas.Value;
         MessageBox.Show("Güncelleme işlemi başarılı");
         seciliOgretmen = null;
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
     FormMethods.ListeyiDoldur <Ogretmen>(lst, Ogretmenler);
     FormMethods.FormTemizle(this.Controls);
 }
Exemplo n.º 2
0
        private void btnSil_Click(object sender, EventArgs e)
        {
            if (seciliOgretmen == null)
            {
                MessageBox.Show("Silinecek Öğretmen bulunamadı");
                return;
            }
            DialogResult sonuc = MessageBox.Show($"{seciliOgretmen.Ad} isimli öğretmen silinsin mi?", "Silme işlemi", MessageBoxButtons.YesNo, MessageBoxIcon.Question);

            if (sonuc == DialogResult.Yes)
            {
                Insan.KisiSil <Ogretmen>(seciliOgretmen, Ogretmenler);
            }
            FormMethods.ListeyiDoldur <Ogretmen>(lst, Ogretmenler);
            FormMethods.FormTemizle(this.Controls);
            seciliOgretmen = null;
        }
Exemplo n.º 3
0
 private void btnKaydet_Click(object sender, EventArgs e)
 {
     try
     {
         Ogretmen orm = new Ogretmen()
         {
             Ad          = txtAd.Text,
             Adres       = txtAdres.Text,
             Brans       = (Branslar)Enum.Parse(typeof(Branslar), cmbBrans.SelectedItem.ToString()),
             Cinsiyet    = (Cinsiyetler)Enum.Parse(typeof(Cinsiyetler), cmbCinsiyet.SelectedItem.ToString()),
             DogumTarihi = dtpDogumTarihi.Value,
             Maas        = nMaas.Value,
             SicilNo     = txtSicil.Text,
             Soyad       = txtSoyad.Text,
             TCKN        = txtTCKN.Text,
             Telefon     = txtTelefon.Text.Replace(" ", "")
         };
         if (Insan.TCKNKontrol <Ogretmen>(orm, Ogretmenler))
         {
             Ogretmenler.Add(orm);
         }
         else
         {
             throw new Exception("TCKN Kontrol et");
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
     finally
     {
         FormMethods.FormTemizle(this.Controls);
         FormMethods.ListeyiDoldur <Ogretmen>(lst, Ogretmenler);
     }
 }
Exemplo n.º 4
0
 private void txtArama_TextChanged(object sender, EventArgs e)
 {
     FormMethods.ListeyiDoldur <Ogrenci>(lst, Insan.KisiAra <Ogrenci>(txtArama.Text, Ogrenciler));
 }
Exemplo n.º 5
0
 private void OgrenciForm_Load(object sender, EventArgs e)
 {
     cmbCinsiyet.Items.AddRange(Enum.GetNames(typeof(Cinsiyetler)));
     FormMethods.ListeyiDoldur <Ogrenci>(lst, Ogrenciler);
 }