示例#1
0
        void PersonelEkle()
        {
            Boolean PersonelVarmi = false;

            if (txtPerAd.Text == "" || txtPerAdres.Text == "" ||
                txtPerSoyAd.Text == "" || txtPerTcNo.Text == "" ||
                txtPerTcNo == null || txtPerTelefon.Text == "" || txtPerTelefon == null
                )
            {
                MessageBox.Show("* Alanlar Boş Bırakılamaz");
            }
            else
            {
                if (txtPerTcNo.Text.Length < 11)
                {
                    MessageBox.Show("Tc Kimlik Numarası 11 Haneden Küçük Olamaz");
                }
                else
                {
                    foreach (Personel personel in bankaAPP.PersonelListesi)
                    {
                        if (personel.TcKimlikNo.ToString() == txtPerTcNo.Text)
                        {
                            PersonelVarmi = true;
                        }
                    }
                    if (!PersonelVarmi)
                    {
                        per               = new Personel();
                        per.Ad            = txtPerAd.Text;
                        per.Soyad         = txtPerSoyAd.Text;
                        per.Adres         = txtPerAdres.Text;
                        per.TcKimlikNo    = Convert.ToInt64(txtPerTcNo.Text);
                        per.Telefon       = Convert.ToInt64(txtPerTelefon.Text);
                        per.BaslamaTarihi = dtPerIseBaslamaTarihi.Value;
                        per.PersonelTuru  = cbPersonelTuru.Text;
                        per.PersonelNo    = Convert.ToInt64(txtPerTcNo.Text);
                        per.DogumTarihi   = dtPerDogumTarihi.Value;
                        bankaAPP.PersonelEkle(per);
                        MessageBox.Show("Personel Ekleme İşlemi Başarılı.");
                    }
                    else if (PersonelVarmi)
                    {
                        MessageBox.Show("Böyle bir TcNumaralı personel bulunuyor");
                    }
                }
            }
        }
示例#2
0
 public void PersonelEkle(Personel p)
 {
     PersonelListesi.Add(p);
 }