Пример #1
0
        public static bool KisiselOgrenciEkle(Kisisel yeniOgrenciKisisel)
        {
            SqlConnection conn = DbConncection.GetSqlConnection();
            var           cmd  = new SqlCommand();

            cmd.CommandText = "INSERT INTO Ahmet_Kisisel(TC,Ad,Soyad,DogumTarih,CinsiyetId,MedeniDurumId,Mail,EvTel,CepTel,Unvan,KullaniciTipiId,OgrenciId,KullaniciAdi,Sifre) VALUES(@TC, @Ad, @Soyad, @DogumTarih, @CinsiyetId, @MedeniDurumId, @Mail, @EvTel, @CepTel,@Unvan,@KullaniciTipiId,@OgrenciId,@KullaniciAdi,@Sifre)";
            cmd.Connection  = conn;
            cmd.Parameters.AddWithValue("@TC", yeniOgrenciKisisel.TC);
            cmd.Parameters.AddWithValue("@Ad", yeniOgrenciKisisel.Ad);
            cmd.Parameters.AddWithValue("@Soyad", yeniOgrenciKisisel.Soyad);
            cmd.Parameters.AddWithValue("@DogumTarih", yeniOgrenciKisisel.DogumTarih);
            cmd.Parameters.AddWithValue("@CinsiyetId", yeniOgrenciKisisel.CinsiyetId);
            cmd.Parameters.AddWithValue("@MedeniDurumId", yeniOgrenciKisisel.MedeniDurumId);
            cmd.Parameters.AddWithValue("@Mail", yeniOgrenciKisisel.Mail);
            cmd.Parameters.AddWithValue("@EvTel", yeniOgrenciKisisel.EvTel);
            cmd.Parameters.AddWithValue("@CepTel", yeniOgrenciKisisel.CepTel);
            cmd.Parameters.AddWithValue("@Unvan", yeniOgrenciKisisel.Unvan);
            cmd.Parameters.AddWithValue("@KullaniciTipiId", yeniOgrenciKisisel.KullaniciTipiId);
            cmd.Parameters.AddWithValue("@OgrenciId", yeniOgrenciKisisel.OgrenciId);
            cmd.Parameters.AddWithValue("@KullaniciAdi", yeniOgrenciKisisel.KullaniciAdi);
            cmd.Parameters.AddWithValue("@Sifre", yeniOgrenciKisisel.Sifre);

            conn.Open();
            return(cmd.ExecuteNonQuery() > 0);

            conn.Close();
        }
Пример #2
0
        private void AdSoyadDoldur()
        {
            OgrenciTablo ogrencitablo = new OgrenciTablo();

            ogrencitablo.OgrenciNo = txtOgrenciNo.Text;
            int ogrenciIdsi = OgrenciTablo.OgrenciIdBul(ogrencitablo);

            SqlConnection conn = DbConncection.GetSqlConnection();
            var           cmd  = new SqlCommand();

            cmd.CommandText = "SELECT Ad,Soyad FROM Ahmet_Kisisel where Ahmet_Kisisel.OgrenciId=@OgrenciId";
            cmd.Parameters.AddWithValue("@OgrenciId", ogrenciIdsi);
            cmd.Connection = conn;
            conn.Open();

            SqlDataReader reader = cmd.ExecuteReader();

            while (reader.Read())
            {
                Kisisel adsoyad = new Kisisel();
                {
                    adsoyad.Ad    = reader.GetString(0);
                    adsoyad.Soyad = reader.GetString(1);
                }
                txtAdSoyad.Text = (adsoyad.Ad + " " + adsoyad.Soyad);
            }
            conn.Close();
            DerslerDoldur();
        }
Пример #3
0
        public void btnGiris_Click(object sender, EventArgs e)
        {
            kullaniciAdi = txtKullaniciAdi.Text;
            string kullaniciSifre = txtSifre.Text;
            var    KullaniciSorgu = new Kisisel();

            KullaniciTipi secilenKullaniciTipi   = (KullaniciTipi)cmbKullaniciTipi.SelectedItem;
            int           secilenKullaniciTipiId = secilenKullaniciTipi.KullaniciTipiId;

            int gelensorgusonucu = Kisisel.KullaniciSorgula(kullaniciAdi, kullaniciSifre, secilenKullaniciTipiId);

            if (gelensorgusonucu == 1)
            {
                ogrenci.Show();
                this.Hide();
            }

            else if (gelensorgusonucu == 2)
            {
                ogretmen.Show();
                this.Hide();
            }

            else if (gelensorgusonucu == 3)
            {
                veli.Show();
                this.Hide();
            }

            else if (gelensorgusonucu == 4)
            {
                memur.Show();
                this.Hide();
            }

            else
            {
                MessageBox.Show("Geçersiz Kullanıcı Adı, Şifre ve Kullanıcı Tipi Kombinasyonu");
            }
        }
Пример #4
0
        private void OgretmenDoldur()
        {
            SqlConnection conn = DbConncection.GetSqlConnection();
            var           cmd  = new SqlCommand();

            cmd.CommandText = "SELECT OgretmenId,Ad,Soyad FROM Ahmet_Kisisel WHERE Ahmet_Kisisel.OgretmenId Is Not Null";
            cmd.Connection  = conn;
            conn.Open();
            SqlDataReader reader = cmd.ExecuteReader();

            while (reader.Read())
            {
                Kisisel kisisel = new Kisisel();
                {
                    kisisel.OgretmenId = reader.GetInt32(0);
                    kisisel.Ad         = reader.GetString(1);
                    kisisel.Soyad      = reader.GetString(2);
                }
                cmbOgretmen.Items.Add(kisisel);
            }
            conn.Close();
        }
        private void btnKayıtEkle_Click(object sender, EventArgs e)
        {
            if (((KullaniciTipi)cmbKayıtTipi.SelectedItem).KullaniciTipiId == 1)
            {
                OgrenciTablo ogrencitablo = new OgrenciTablo();
                ogrencitablo.OgrenciNo        = txtOgrenciNo.Text;
                ogrencitablo.OkulaGirisDonemi = ((String)cmbOkulaGirisDonemi.SelectedItem);
                ogrencitablo.OgrenciSinifi    = ((Int32)cmbOgrenciSinif.SelectedItem);
                ogrencitablo.FakulteId        = ((Fakulte)cmbFakulte.SelectedItem).FakulteId;
                ogrencitablo.BolumId          = ((Bolum)cmbBolum.SelectedItem).BolumId;
                OgrenciTablo.OgrenciTabloEkle(ogrencitablo);

                Kisisel ogrencikisisel = new Kisisel();
                ogrencikisisel.TC              = txtTc.Text;
                ogrencikisisel.Ad              = txtAd.Text;
                ogrencikisisel.Soyad           = txtSoyad.Text;
                ogrencikisisel.DogumTarih      = datetimeDogumTarih.Value;
                ogrencikisisel.CinsiyetId      = ((Cinsiyet)cmbCinsiyet.SelectedItem).CinsiyetId;
                ogrencikisisel.MedeniDurumId   = ((MedeniDurum)cmbMedeniDurum.SelectedItem).MedeniDurumId;
                ogrencikisisel.Mail            = txtmail.Text;
                ogrencikisisel.EvTel           = txtEvTel.Text;
                ogrencikisisel.CepTel          = txtCepTel.Text;
                ogrencikisisel.Unvan           = txtUnvan.Text;
                ogrencikisisel.KullaniciTipiId = ((KullaniciTipi)cmbKayıtTipi.SelectedItem).KullaniciTipiId;
                ogrencikisisel.KullaniciAdi    = ogrencitablo.OgrenciNo;
                ogrencikisisel.Sifre           = ogrencikisisel.TC;
                ogrencikisisel.OgrenciId       = OgrenciTablo.OgrenciIdBul(ogrencitablo);
                Kisisel.KisiselOgrenciEkle(ogrencikisisel);

                GecmisEgitim gecmis = new GecmisEgitim();
                gecmis.MezuniyetYil      = ((Int32)cmbMezuniyetYil.SelectedItem);
                gecmis.MezuniyetDerecesi = Convert.ToDouble(txtMezuniyetDerecesi.Text);
                gecmis.MezunOkul         = txtGecmisOkul.Text;
                gecmis.OgrenciId         = OgrenciTablo.OgrenciIdBul(ogrencitablo);
                GecmisEgitim.GecmisOgrenciEkle(gecmis);
                Temizle();

                MessageBox.Show("Öğrenci Kaydedildi");
            }
            if (((KullaniciTipi)cmbKayıtTipi.SelectedItem).KullaniciTipiId == 2)
            {
                OgretmenTablo ogretmentablo = new OgretmenTablo();
                ogretmentablo.IseBaslama       = datetimeIseBaslama.Value;
                ogretmentablo.GecmisDeneyimler = txtGecmisDeneyimler.Text;
                OgretmenTablo.OgretmenTabloEkle(ogretmentablo);

                Kisisel ogretmenkisisel = new Kisisel();
                ogretmenkisisel.TC              = txtTc.Text;
                ogretmenkisisel.Ad              = txtAd.Text;
                ogretmenkisisel.Soyad           = txtSoyad.Text;
                ogretmenkisisel.DogumTarih      = datetimeDogumTarih.Value;
                ogretmenkisisel.CinsiyetId      = ((Cinsiyet)cmbCinsiyet.SelectedItem).CinsiyetId;
                ogretmenkisisel.MedeniDurumId   = ((MedeniDurum)cmbMedeniDurum.SelectedItem).MedeniDurumId;
                ogretmenkisisel.Mail            = txtmail.Text;
                ogretmenkisisel.EvTel           = txtEvTel.Text;
                ogretmenkisisel.CepTel          = txtCepTel.Text;
                ogretmenkisisel.Unvan           = txtUnvan.Text;
                ogretmenkisisel.KullaniciTipiId = ((KullaniciTipi)cmbKayıtTipi.SelectedItem).KullaniciTipiId;
                ogretmenkisisel.OgretmenId      = OgretmenTablo.OgretmenIdBul();
                ogretmenkisisel.KullaniciAdi    = ogretmenkisisel.TC;
                ogretmenkisisel.Sifre           = ogretmenkisisel.TC;
                Kisisel.KisiselOgretmenEkle(ogretmenkisisel);

                GecmisEgitim gecmis = new GecmisEgitim();
                gecmis.MezuniyetYil      = ((Int32)cmbMezuniyetYil.SelectedItem);
                gecmis.MezuniyetDerecesi = Convert.ToDouble(txtMezuniyetDerecesi.Text);
                gecmis.MezunOkul         = txtGecmisOkul.Text;
                gecmis.OgretmenId        = OgretmenTablo.OgretmenIdBul();
                GecmisEgitim.GecmisOgretmenEkle(gecmis);

                MessageBox.Show("Öğretmen Kaydedildi");
            }
            if (((KullaniciTipi)cmbKayıtTipi.SelectedItem).KullaniciTipiId == 3)
            {
                VeliTablo velitablo = new VeliTablo();
                velitablo.OgrenciNo = txtOgrenciNo.Text;
                velitablo.OgrenciId = VeliTablo.VeliOgrenciIdBul(velitablo);
                VeliTablo.VeliTabloEkle(velitablo);

                Kisisel velikisisel = new Kisisel();
                velikisisel.TC              = txtTc.Text;
                velikisisel.Ad              = txtAd.Text;
                velikisisel.Soyad           = txtSoyad.Text;
                velikisisel.DogumTarih      = datetimeDogumTarih.Value;
                velikisisel.CinsiyetId      = ((Cinsiyet)cmbCinsiyet.SelectedItem).CinsiyetId;
                velikisisel.MedeniDurumId   = ((MedeniDurum)cmbMedeniDurum.SelectedItem).MedeniDurumId;
                velikisisel.Mail            = txtmail.Text;
                velikisisel.EvTel           = txtEvTel.Text;
                velikisisel.CepTel          = txtCepTel.Text;
                velikisisel.Unvan           = txtUnvan.Text;
                velikisisel.KullaniciTipiId = ((KullaniciTipi)cmbKayıtTipi.SelectedItem).KullaniciTipiId;
                velikisisel.VeliId          = VeliTablo.VeliIdBul();
                velikisisel.KullaniciAdi    = velikisisel.TC;
                velikisisel.Sifre           = velikisisel.TC;
                Kisisel.KisiselVeliEkle(velikisisel);

                MessageBox.Show("Veli Kaydedildi");
            }
            if (((KullaniciTipi)cmbKayıtTipi.SelectedItem).KullaniciTipiId == 4)
            {
                MemurTablo memurtablo = new MemurTablo();
                memurtablo.IseBaslama       = datetimeIseBaslama.Value;
                memurtablo.GecmisDeneyimler = txtGecmisDeneyimler.Text;
                MemurTablo.MemurTabloEkle(memurtablo);

                Kisisel memurkisisel = new Kisisel();
                memurkisisel.TC              = txtTc.Text;
                memurkisisel.Ad              = txtAd.Text;
                memurkisisel.Soyad           = txtSoyad.Text;
                memurkisisel.DogumTarih      = datetimeDogumTarih.Value;
                memurkisisel.CinsiyetId      = ((Cinsiyet)cmbCinsiyet.SelectedItem).CinsiyetId;
                memurkisisel.MedeniDurumId   = ((MedeniDurum)cmbMedeniDurum.SelectedItem).MedeniDurumId;
                memurkisisel.Mail            = txtmail.Text;
                memurkisisel.EvTel           = txtEvTel.Text;
                memurkisisel.CepTel          = txtCepTel.Text;
                memurkisisel.Unvan           = txtUnvan.Text;
                memurkisisel.KullaniciTipiId = ((KullaniciTipi)cmbKayıtTipi.SelectedItem).KullaniciTipiId;
                memurkisisel.MemurId         = MemurTablo.MemurIdBul();
                memurkisisel.KullaniciAdi    = memurkisisel.TC;
                memurkisisel.Sifre           = memurkisisel.TC;
                Kisisel.KisiselMemurEkle(memurkisisel);

                GecmisEgitim gecmis = new GecmisEgitim();
                gecmis.MezuniyetYil      = ((Int32)cmbMezuniyetYil.SelectedItem);
                gecmis.MezuniyetDerecesi = Convert.ToDouble(txtMezuniyetDerecesi.Text);
                gecmis.MezunOkul         = txtGecmisOkul.Text;
                gecmis.MemurId           = MemurTablo.MemurIdBul();
                GecmisEgitim.GecmisMemurEkle(gecmis);

                MessageBox.Show("MemurKaydedildi");
            }
            Temizle();
        }