private void btnKaydet_Click(object sender, RoutedEventArgs e)
        {
            if (txtAd.Text == "")
            {
                MessageBox.Show("İsim alanı boş geçilemez…");
                lblMesaj.Visibility = Visibility.Visible;
                lblMesaj.Content    = "İsim Alanı boş bırakılamaz";
            }

            else if (txtSoyad.Text == "")
            {
                MessageBox.Show("Soyisim alanı boş geçilemez…");
                lblMesaj.Visibility = Visibility.Visible;
                lblMesaj.Content    = "Soyad Alanı boş bırakılamaz";
            }

            else if (cmbCinsiyet.Text == "")
            {
                MessageBox.Show("Cinsiyet alanı boş geçilemez…");
                lblMesaj.Visibility = Visibility.Visible;
                lblMesaj.Content    = "Cinsiyet Alanı boş bırakılamaz";
            }

            else if (txtOgrenciNo.Text == "")
            {
                MessageBox.Show("Öğrenci No alanı boş geçilemez…");
                lblMesaj.Visibility = Visibility.Visible;
                lblMesaj.Content    = "Ogrenci No Alanı boş bırakılamaz";
            }

            else if (cmbBolum.Text == "")
            {
                MessageBox.Show("Bölüm bilgisi boş geçilemez…");
                lblMesaj.Visibility = Visibility.Visible;
                lblMesaj.Content    = "Bölüm Alanı boş bırakılamaz";
            }

            else
            {
                Bilgiler kullanici = new Bilgiler();
                kullanici.Ad        = txtAd.Text;
                kullanici.Soyad     = txtSoyad.Text;
                kullanici.Cinsiyet  = cmbCinsiyet.Text;
                kullanici.OgrenciNo = txtOgrenciNo.Text;
                kullanici.Bolum     = cmbBolum.Text;
                bilgiler.Add(kullanici);
                tablo2.Items.Add(kullanici);
                cmbIndex.Items.Add(kullanici.OgrenciNo);
                lblMesaj.Visibility = Visibility.Hidden;
            }
        }
Example #2
0
        private void btnKaydet_Click(object sender, RoutedEventArgs e)
        {
            if (txtAd.Text == "")
            {
                MessageBox.Show("İsim alanı boş geçilemez…");
                errorMessage("İsim");
            }

            else if (txtSoyad.Text == "")
            {
                MessageBox.Show("Soyisim alanı boş geçilemez…");
                errorMessage("Soyisim");
            }

            else if (cmbCinsiyet.Text == "")
            {
                MessageBox.Show("Cinsiyet alanı boş geçilemez…");
                errorMessage("Cinsiyet");
            }

            else if (txtOgrenciNo.Text == "")
            {
                MessageBox.Show("Öğrenci No alanı boş geçilemez…");
                errorMessage("Öğrenci No");
            }

            else if (cmbBolum.Text == "")
            {
                MessageBox.Show("Bölüm bilgisi boş geçilemez…");
                errorMessage("Bölüm");
            }

            else
            {
                Bilgiler kullanici = new Bilgiler();
                kullanici.Ad        = txtAd.Text;
                kullanici.Soyad     = txtSoyad.Text;
                kullanici.Cinsiyet  = cmbCinsiyet.Text;
                kullanici.OgrenciNo = txtOgrenciNo.Text;
                kullanici.Bolum     = cmbBolum.Text;
                bilgiler.Add(kullanici);
                tablo2.Items.Add(kullanici);
                cmbIndex.Items.Add(kullanici.Ad);
                lblErrorMessage.Visibility = Visibility.Hidden;
            }
        }