Exemple #1
0
 private void veriTabaniEkle()
 {
     if (kitapAdi.Text == "" || yazari.Text == "" || yayinEvi.Text == "" || turu.Text == "" || sayfaSayisi.Text == "" || baskisi.Text == "" || depo.Text == "" || fiyat.Text == "" || adet.Text == "")
     {
         MessageBox.Show("Alanlar doldurulmak zorundadır!! Depo eklemediyseniz önce depo eklemeniz gerekmektedir.");
     }
     else
     {
         YazarFonksiyonlari.yazarEkle(yazari.Text);
         YayinEviFonksiyonlari.yayinEviEkle(yayinEvi.Text);
         TurFonksiyolari.turEkle(turu.Text);
         KitapFonksiyolari.KitapEkle(kitapAdi.Text, yazari.Text, yayinEvi.Text, turu.Text, Convert.ToInt32(sayfaSayisi.Text), baskisi.Text, depoKoduCek(depo.Text), Convert.ToInt32(fiyat.Text), Convert.ToInt32(adet.Text));
     }
 }
 private void button8_Click(object sender, EventArgs e)
 {
     if (yazarAdiLabel.Text == guncelletextboxyazar.Text || !YazarFonksiyonlari.ayniYazarVarMi(guncelletextboxyazar.Text))
     {
         DialogResult secenek = MessageBox.Show("Bu yazar güncellenecek! Devam edilsin mi?", "Dikkat", MessageBoxButtons.YesNo, MessageBoxIcon.Information);
         if (secenek == DialogResult.Yes)
         {
             baglanti.Open();
             MySqlCommand command = new MySqlCommand();
             command.CommandText = "update yazarlar set yazarAdiSoyadi='" + guncelletextboxyazar.Text + "' where yazarKodu='" + silyazarkodulabel.Text + "'";
             command.Connection  = baglanti;
             command.ExecuteNonQuery();
             MessageBox.Show("Yazar güncellendi!!");
             baglanti.Close();
         }
     }
     else
     {
         MessageBox.Show("Aynı yazar veritabanında mevcut güncelleme başarısız!");
     }
 }
Exemple #3
0
        private void button2_Click_1(object sender, EventArgs e)
        {
            if (xx.Text == "Kitaplar")
            {
                dataGridView1.DataSource = KitapFonksiyolari.kitapListele(searcbargiris.Text);
            }
            else if (xx.Text == "Yazarlar")
            {
                dataGridView1.DataSource = YazarFonksiyonlari.yazarListele(searcbargiris.Text);
            }
            else if (xx.Text == "Yayinevleri")
            {
                dataGridView1.DataSource = YayinEviFonksiyonlari.yayinEviListele(searcbargiris.Text);
            }
            else if (xx.Text == "Depolar")
            {
                dataGridView1.DataSource = DepoFonksiyonlari.depoListele(searcbargiris.Text);
            }
            else if (xx.Text == "Siparisler")
            {
                dataGridView1.DataSource = SiparisFonksiyonlari.siparisListele(searcbargiris.Text);
            }
            else if (xx.Text == "Personeller")
            {
                dataGridView1.DataSource = PersonelKodlari.personelListele(searcbargiris.Text);
            }
            else
            {
                dataGridView1.DataSource = null;
                baglanti.Open();

                string           komut   = "select personelKodu,personelAdiSoyadi,userId,pass,adminMi from kullanicilar,personel where kullanicilar.personelKodu=personel.telefon and personel.personelAdiSoyadi like '%" + searcbargiris.Text + "%'";
                MySqlCommand     command = new MySqlCommand(komut, baglanti);
                MySqlDataAdapter da      = new MySqlDataAdapter(command);
                DataTable        dt      = new DataTable();
                da.Fill(dt);
                dataGridView1.DataSource = dt;
                baglanti.Close();
            }
        }
Exemple #4
0
 private void button3_Click_1(object sender, EventArgs e)
 {
     dataGridView1.DataSource = null;
     dataGridView1.DataSource = YazarFonksiyonlari.yazarListele(searcbargiris.Text);
     xx.Text = "Yazarlar";
 }
Exemple #5
0
 private void yazarlistele_Click(object sender, EventArgs e)
 {
     dataGridView1.DataSource = YazarFonksiyonlari.yazarListele("");
     xx.Text = "Yazarlar";
 }
        private void button2_Click_1(object sender, EventArgs e)
        {
            if (sgkitapAdi.Text == "" || sgturu.Text == "" || sgyayinEvi.Text == "" || sgyazari.Text == "" || sgfiyat.Text == "" || sgadet.Text == "" || sgdepo.Text == "")
            {
                MessageBox.Show("Alanlar doldurulmak zorundadır!");
            }
            else
            {
                baglanti.Open();
                MySqlCommand command  = new MySqlCommand();
                MySqlCommand command2 = new MySqlCommand();
                command2.CommandText = "select count(kitapAdi) from kitaplar where kitapAdi='" + sgkitapAdi.Text + "'";
                command2.Connection  = baglanti;
                int sart = Convert.ToInt32(command2.ExecuteScalar());
                if (sgkitapAdi.Text == kitaplabel.Text && sgyazari.Text == sgyazarilabel.Text && sgyayinEvi.Text == sgyayinevilabel.Text)
                {
                    DialogResult secenek = MessageBox.Show("Emin misiniz?", "Bilgilendirme Penceresi", MessageBoxButtons.YesNo, MessageBoxIcon.Information);
                    if (secenek == DialogResult.Yes)
                    {
                        YazarFonksiyonlari.yazarEkle(sgyazari.Text);
                        YayinEviFonksiyonlari.yayinEviEkle(sgyayinEvi.Text);
                        TurFonksiyolari.turEkle(sgturu.Text);

                        command.CommandText = "update kitaplar set kitapAdi='" + sgkitapAdi.Text + "',yazari='" + yazarKoduCek(sgyazari.Text) + "',yayinEvi='" + yayinEviKoduCek(sgyayinEvi.Text) + "',turu='" + turKoduCek(sgturu.Text) + "' where kitapKodu='" + kitapKoduLabel.Text + "'";
                        command.Connection  = baglanti;
                        command.ExecuteNonQuery();
                        command.CommandText = "update kitap_depo set depoKodu='" + depoKoduCek(sgdepo.Text) + "',satisFiyati=" + Convert.ToInt32(sgfiyat.Text) + ",adet=" + Convert.ToInt32(sgadet.Text) + " where kitapKodu='" + kitapKoduLabel.Text + "'";
                        command.ExecuteNonQuery();
                        MessageBox.Show("Güncelleme başarılı!!");
                    }
                }
                else if (!KitapFonksiyolari.ayniKitapVarMi(sgkitapAdi.Text, yazarKoduCek(sgyazari.Text), yayinEviKoduCek(sgyayinEvi.Text)))
                {
                    if (sgkitapAdi.Text != kitaplabel.Text && sart > 0)
                    {
                        DialogResult secenek = MessageBox.Show("Bu kitap adi zaten veritabanında mevcut!! Yine de değiştirmek istediğinizden emin misiniz?", "Bilgilendirme Penceresi", MessageBoxButtons.YesNo, MessageBoxIcon.Information);
                        if (secenek == DialogResult.Yes)
                        {
                            YazarFonksiyonlari.yazarEkle(sgyazari.Text);
                            YayinEviFonksiyonlari.yayinEviEkle(sgyayinEvi.Text);
                            TurFonksiyolari.turEkle(sgturu.Text);

                            command.CommandText = "update kitaplar set kitapAdi='" + sgkitapAdi.Text + "',yazari='" + yazarKoduCek(sgyazari.Text) + "',yayinEvi='" + yayinEviKoduCek(sgyayinEvi.Text) + "',turu='" + turKoduCek(sgturu.Text) + "' where kitapKodu='" + kitapKoduLabel.Text + "'";
                            command.Connection  = baglanti;
                            command.ExecuteNonQuery();
                            command.CommandText = "update kitap_depo set depoKodu='" + depoKoduCek(sgdepo.Text) + "',satisFiyati=" + Convert.ToInt32(sgfiyat.Text) + ",adet=" + Convert.ToInt32(sgadet.Text) + " where kitapKodu='" + kitapKoduLabel.Text + "'";
                            command.ExecuteNonQuery();
                            MessageBox.Show("Güncelleme başarılı!!");
                        }
                    }
                    else
                    {
                        DialogResult secenek = MessageBox.Show("Emin misiniz?", "Bilgilendirme Penceresi", MessageBoxButtons.YesNo, MessageBoxIcon.Information);
                        if (secenek == DialogResult.Yes)
                        {
                            YazarFonksiyonlari.yazarEkle(sgyazari.Text);
                            YayinEviFonksiyonlari.yayinEviEkle(sgyayinEvi.Text);
                            TurFonksiyolari.turEkle(sgturu.Text);

                            command.CommandText = "update kitaplar set kitapAdi='" + sgkitapAdi.Text + "',yazari='" + yazarKoduCek(sgyazari.Text) + "',yayinEvi='" + yayinEviKoduCek(sgyayinEvi.Text) + "',turu='" + turKoduCek(sgturu.Text) + "' where kitapKodu='" + kitapKoduLabel.Text + "'";
                            command.Connection  = baglanti;
                            command.ExecuteNonQuery();
                            command.CommandText = "update kitap_depo set depoKodu='" + depoKoduCek(sgdepo.Text) + "',satisFiyati=" + Convert.ToInt32(sgfiyat.Text) + ",adet=" + Convert.ToInt32(sgadet.Text) + " where kitapKodu='" + kitapKoduLabel.Text + "'";
                            command.ExecuteNonQuery();
                            MessageBox.Show("Güncelleme başarılı!!");
                        }
                    }
                }



                baglanti.Close();
            }
        }