private void button1_Click(object sender, EventArgs e) { DoxaKutuphaneDAL.Entity.Kategori k = (DoxaKutuphaneDAL.Entity.Kategori)cmbKtgrSil.SelectedItem; DoxaKutuphaneDAL.Facade.Kategori.KategoriSil(k.KategoriId); ComboDoldur(); cmbKtgrSil.Text = ""; }
private void btnAra_Click(object sender, EventArgs e) { DoxaKutuphaneDAL.Entity.Kitap ktp = (DoxaKutuphaneDAL.Entity.Kitap)cmbKitapAdAra.SelectedItem; DoxaKutuphaneDAL.Entity.Kategori ktgr = (DoxaKutuphaneDAL.Entity.Kategori)cmbKategoriAra.SelectedItem; DoxaKutuphaneDAL.Entity.YayinEvi yyn = (DoxaKutuphaneDAL.Entity.YayinEvi)cmbYayinEviAra.SelectedItem; DoxaKutuphaneDAL.Entity.Yazar yzr = (DoxaKutuphaneDAL.Entity.Yazar)cmbYazarAdAra.SelectedItem; if (chkKategori.Checked && chkKitapAd.Checked && chkYayinEvi.Checked && chkYazarAd.Checked) { dataGridView1.DataSource = DoxaKutuphaneDAL.Facade.Kitap.KitapGetir(ktp.KitapAd, ktgr.KategoriId, yzr.YazarId, yyn.YayinEviId); } else if (chkKitapAd.Checked && chkKategori.Checked) { dataGridView1.DataSource = DoxaKutuphaneDAL.Facade.Kitap.KitapGetir(ktp.KitapAd, ktgr.KategoriId, 0, 0); } else if (chkKitapAd.Checked && chkYayinEvi.Checked) { dataGridView1.DataSource = DoxaKutuphaneDAL.Facade.Kitap.KitapGetir(ktp.KitapAd, 0, 0, yyn.YayinEviId); } else if (chkKitapAd.Checked && chkYazarAd.Checked) { dataGridView1.DataSource = DoxaKutuphaneDAL.Facade.Kitap.KitapGetir(ktp.KitapAd, 0, yzr.YazarId, 0); } else if (chkKategori.Checked && chkYayinEvi.Checked) { dataGridView1.DataSource = DoxaKutuphaneDAL.Facade.Kitap.KitapGetir("", ktgr.KategoriId, 0, yyn.YayinEviId); } else if (chkKategori.Checked && chkYazarAd.Checked) { dataGridView1.DataSource = DoxaKutuphaneDAL.Facade.Kitap.KitapGetir("", ktgr.KategoriId, yzr.YazarId, 0); } else if (chkYayinEvi.Checked && chkYazarAd.Checked) { dataGridView1.DataSource = DoxaKutuphaneDAL.Facade.Kitap.KitapGetir("", 0, yzr.YazarId, yyn.YayinEviId); } else if (chkKategori.Checked) { dataGridView1.DataSource = DoxaKutuphaneDAL.Facade.Kitap.KitapGetir("", ktgr.KategoriId, 0, 0); } else if (chkKitapAd.Checked) { dataGridView1.DataSource = DoxaKutuphaneDAL.Facade.Kitap.KitapGetir(ktp.KitapAd, 0, 0, 0); } else if (chkYayinEvi.Checked) { dataGridView1.DataSource = DoxaKutuphaneDAL.Facade.Kitap.KitapGetir("", 0, 0, yyn.YayinEviId); } else if (chkYazarAd.Checked) { dataGridView1.DataSource = DoxaKutuphaneDAL.Facade.Kitap.KitapGetir("", 0, yzr.YazarId, 0); } else { MessageBox.Show("Belanı Arıyosun BAK !!!"); } }
private void btnKitapEkle_Click(object sender, EventArgs e) { DoxaKutuphaneDAL.Entity.Kategori k = (DoxaKutuphaneDAL.Entity.Kategori)cmbKtgrAdEkleKtp.SelectedItem; DoxaKutuphaneDAL.Entity.YayinEvi yyn = (DoxaKutuphaneDAL.Entity.YayinEvi)cmbYynEvAdEkleKtp.SelectedItem; DoxaKutuphaneDAL.Entity.Yazar yzr = (DoxaKutuphaneDAL.Entity.Yazar)cmbYzrAdEkleKtp.SelectedItem; bool kontrol = DoxaKutuphaneDAL.Facade.Kitap.KitapEkle(txtKitapAdEkle.Text, k.KategoriId, yzr.YazarId, yyn.YayinEviId); if (kontrol) { MessageBox.Show("Mission is successful!"); } else { MessageBox.Show("There is a Problem!"); } }
public void KategoriDoldur() { cmbKtgrAdEkleKtp.Items.Clear(); SqlCommand com = new SqlCommand("KategoriGetir", con); com.CommandType = CommandType.StoredProcedure; DoxaMethodsDAL.Facade.Connection.ConOpen(con); SqlDataReader dr = com.ExecuteReader(); while (dr.Read()) { DoxaKutuphaneDAL.Entity.Kategori k = new DoxaKutuphaneDAL.Entity.Kategori(); k.KategoriId = Convert.ToInt32(dr["KategoriId"]); k.KategoriAd = dr["KategoriAd"].ToString(); cmbKtgrAdEkleKtp.Items.Add(k); } DoxaMethodsDAL.Facade.Connection.ConClose(con); dr.Close(); }