Exemple #1
0
        private void Sofor_Load(object sender, EventArgs e)
        {
            this.Dock = DockStyle.Fill;
            string sorgu_liste = "SELECT [SoforID],[Adi],[Soyadi],[TcNo],[Telefon],[Adres] FROM Soforler";

            Asistan.dgvYenile(sorgu_liste, dgvSofor);
        }
Exemple #2
0
        private void btnKaydet_Click(object sender, EventArgs e)
        {
            string sorgu = "INSERT INTO Araclar (Plaka ,KoltukSayisi) VALUES ('" + txtPlaka.Text + "'," + txtKoltukSay.Text + ")";

            Asistan.iduSql(sorgu);
            MessageBox.Show("İşlem tamamlandı...");
            Asistan.dgvYenile("SELECT Plaka,KoltukSayisi FROM Araclar", dgvOtobus);
        }
Exemple #3
0
        private void btnKaydet_Click(object sender, EventArgs e)
        {
            string sorgu       = "INSERT INTO Soforler ([Adi],[Soyadi],[TcNo],[Telefon],[Adres]) VALUES ('" + txtAd.Text + "','" + txtSoyad.Text + "','" + txtTC.Text + "','" + txtTel.Text + "','" + txtAdres.Text + "')";
            string sorgu_liste = "SELECT [SoforID],[Adi],[Soyadi],[TcNo],[Telefon],[Adres] FROM Soforler";

            Asistan.iduSql(sorgu);
            MessageBox.Show("İşlem tamamlandı...");
            Asistan.dgvYenile(sorgu_liste, dgvSofor);
        }
        private void btnDuzenle_Click(object sender, EventArgs e)
        {
            string srgKullaniciDuzenle = "UPDATE Kullanici SET KullaniciAdi ='" + txtKullaniciAdi.Text + "' ,[Sifre] ='" + txtSifre.Text + "'    ,[Adi] ='" + txtAd.Text + "',[Soyadi] ='" + txtSoyad.Text + "' WHERE KullaniciID=" + dataGridViewListe.CurrentRow.Cells[0].Value.ToString();

            Asistan.iduSql(srgKullaniciDuzenle);
            Asistan.iduSql("ENABLE TRIGGER guncelle ON Kullanici");

            Asistan.dgvYenile(dgvYenile, dataGridViewListe);
        }
        private void btnEkle_Click(object sender, EventArgs e)
        {
            string srgEkle = "INSERT INTO Kullanici(KullaniciAdi ,Sifre,Adi,Soyadi) VALUES ('" + txtKullaniciAdi.Text + "','" + txtSifre.Text + "','" + txtAd.Text + "','" + txtSoyad.Text + "')";

            try
            {
                Asistan.iduSql(srgEkle);

                MessageBox.Show("İşlem tamamlandı...");
                Asistan.dgvYenile(dgvYenile, dataGridViewListe);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString(), "Hata");
            }
        }
        private void btnSil_Click(object sender, EventArgs e)
        {
            silme = true;
            string srgSil = "delete from Kullanici where KullaniciID=" + dataGridViewListe.CurrentRow.Cells[0].Value.ToString();

            SqlConnection con = Asistan.baglan();
            SqlCommand    cmd = new SqlCommand(srgSil, con);

            con.Open();
            cmd.ExecuteNonQuery();
            con.Close(); DialogResult sonuc = MessageBox.Show("Silme onaylansın mı ?", "Onay", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
            if (sonuc == DialogResult.Yes)
            {
                Asistan.dgvYenile(dgvYenile, dataGridViewListe);
            }
        }