private void GelismisArama_Load(object sender, EventArgs e) { dataGridView1.AutoGenerateColumns = false; dataGridView1.DataSource = BLLBooks.GetAll(); cmbYazar.DataSource = BLLAuthors.GetAll(); cmbYazar.DisplayMember = "FullName"; cmbYazar.ValueMember = "ID"; cmbTur.DataSource = BLLCategories.GetAll(); cmbTur.DisplayMember = "Name"; cmbTur.ValueMember = "ID"; cmbRaf.DataSource = BLLShelf.GetAll(); cmbRaf.DisplayMember = "ShelfNo"; cmbRaf.ValueMember = "ID"; cmbYayinevi.DataSource = BLLPublisher.GetAll(); cmbYayinevi.DisplayMember = "Name"; cmbYayinevi.ValueMember = "ID"; cmbRaf.Enabled = false; cmbTur.Enabled = false; cmbYayinevi.Enabled = false; cmbYazar.Enabled = false; }
protected void Page_Load(object sender, EventArgs e) { if (IsPostBack) { return; } if (Request.QueryString["ID"] != null) { EShelf shelf = new EShelf(); shelf.ID = int.Parse(Request.QueryString["ID"]); bool sonuc = BLLShelf.Delete(shelf); if (sonuc) { Response.Write("<script>alert('Harika! Silindi!')</script>"); } else { Response.Write("<script>alert('Hay Aksi! Silinemedi!')</script>"); } } rptRaflar.DataSource = BLLShelf.GetAll(); rptRaflar.DataBind(); if (Request.QueryString["scs"] != null) { int scsID = Convert.ToInt32(Request.QueryString["scs"].ToString()); if (scsID == 1) { Response.Write("<script>alert('Harika! Güncellendi!');</script>"); } } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { cmbKitapYazari.DataSource = BLLAuthors.GetAll(); cmbKitapYazari.DataTextField = "FullName"; cmbKitapYazari.DataValueField = "ID"; cmbKitapYazari.DataBind(); cmbTur.DataSource = BLLCategories.GetAll(); cmbTur.DataTextField = "Name"; cmbTur.DataValueField = "ID"; cmbTur.DataBind(); cmbRafNo.DataSource = BLLShelf.GetAll(); cmbRafNo.DataTextField = "ShelfNo"; cmbRafNo.DataValueField = "ID"; cmbRafNo.DataBind(); cmbYayinEvi.DataSource = BLLPublisher.GetAll(); cmbYayinEvi.DataTextField = "Name"; cmbYayinEvi.DataValueField = "ID"; cmbYayinEvi.DataBind(); } }
private void btnSil_Click(object sender, EventArgs e) { if (lstRaf.SelectedItems.Count > 0) { int silinecekShelfID = (int)lstRaf.SelectedValue; DialogResult result = MessageBox.Show("Silmek istediğinize emin misiniz ?", "Uyarı", MessageBoxButtons.YesNo, MessageBoxIcon.Warning); if (result == DialogResult.Yes) { EShelf shelf = new EShelf(); shelf.ID = silinecekShelfID; if (BLLShelf.Delete(shelf)) { MessageBox.Show("Silme işleminiz başarıyla tamamlanmıştır."); lstRaf.DataSource = BLLShelf.GetAll(); } else { MessageBox.Show("Bir hata oluştu!"); } } } else { MessageBox.Show("Lütfen silmek istediğiniz rafı seçiniz!"); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { cmbKitapYazari.DataSource = BLLAuthors.GetAll(); cmbKitapYazari.DataTextField = "FullName"; cmbKitapYazari.DataValueField = "ID"; cmbKitapYazari.DataBind(); cmbTur.DataSource = BLLCategories.GetAll(); cmbTur.DataTextField = "Name"; cmbTur.DataValueField = "ID"; cmbTur.DataBind(); cmbRafNo.DataSource = BLLShelf.GetAll(); cmbRafNo.DataTextField = "ShelfNo"; cmbRafNo.DataValueField = "ID"; cmbRafNo.DataBind(); cmbYayinEvi.DataSource = BLLPublisher.GetAll(); cmbYayinEvi.DataTextField = "Name"; cmbYayinEvi.DataValueField = "ID"; cmbYayinEvi.DataBind(); } if (chbRaf.Checked == true) { panelRaf.Enabled = true; } else { panelRaf.Enabled = false; } if (chbTur.Checked == true) { panelTur.Enabled = true; } else { panelTur.Enabled = false; } if (chbYayinevi.Checked == true) { panelYayinEvi.Enabled = true; } else { panelYayinEvi.Enabled = false; } if (chbYazar.Checked == true) { panelKitapYazari.Enabled = true; } else { panelKitapYazari.Enabled = false; } }
private void RafKayit_Load(object sender, EventArgs e) { cmbRafTuru.DataSource = BLLCategories.GetAll(); cmbRafTuru.DisplayMember = "Name"; cmbRafTuru.ValueMember = "ID"; lstRaf.DataSource = BLLShelf.GetAll(); lstRaf.DisplayMember = "ShelfNo"; lstRaf.ValueMember = "ID"; }
void Listele() { foreach (EShelf item in BLLShelf.GetAll()) { ListViewItem lvi = new ListViewItem(); lvi.Text = item.ShelfNo; lvi.SubItems.Add(item.Category.Name).ToString(); lvi.Tag = item.ID; lvRehber.Items.Add(lvi); } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { cmbKitapYazari.DataSource = BLLAuthors.GetAll(); cmbKitapYazari.DataTextField = "FullName"; cmbKitapYazari.DataValueField = "ID"; cmbKitapYazari.DataBind(); cmbTur.DataSource = BLLCategories.GetAll(); cmbTur.DataTextField = "Name"; cmbTur.DataValueField = "ID"; cmbTur.DataBind(); cmbRafNo.DataSource = BLLShelf.GetAll(); cmbRafNo.DataTextField = "ShelfNo"; cmbRafNo.DataValueField = "ID"; cmbRafNo.DataBind(); cmbYayinEvi.DataSource = BLLPublisher.GetAll(); cmbYayinEvi.DataTextField = "Name"; cmbYayinEvi.DataValueField = "ID"; cmbYayinEvi.DataBind(); int bookID = Convert.ToInt32(Request.QueryString["bookID"].ToString()); EBooks book = new EBooks(); book.Author = new EAuthors(); book.Shelf = new EShelf(); book.Category = new ECategories(); book.Publisher = new EPublisher(); book = BLLBooks.GetIdOnly(bookID); txtKitapAdi.Text = book.Name; txtISBNNo.Text = book.ISBNNO; cmbRafNo.SelectedValue = book.Shelf.ID.ToString(); cmbKitapYazari.SelectedValue = book.Author.ID.ToString(); cmbTur.SelectedValue = book.Category.ID.ToString(); cmbYayinEvi.SelectedValue = book.Publisher.ID.ToString(); dtpBasimTarihi.Text = book.DateOfPublish.ToString(); } }
private void Form1_Load(object sender, EventArgs e) { dataGridView1.AutoGenerateColumns = false; dataGridView1.DataSource = BLLBooks.GetAll(); cmbKitapYazari.DataSource = BLLAuthors.GetAll(); cmbKitapYazari.DisplayMember = "FullName"; cmbKitapYazari.ValueMember = "ID"; cmbTur.DataSource = BLLCategories.GetAll(); cmbTur.DisplayMember = "Name"; cmbTur.ValueMember = "ID"; cmbRafNo.DataSource = BLLShelf.GetAll(); cmbRafNo.DisplayMember = "ShelfNo"; cmbRafNo.ValueMember = "ID"; cmbYayinEvi.DataSource = BLLPublisher.GetAll(); cmbYayinEvi.DisplayMember = "Name"; cmbYayinEvi.ValueMember = "ID"; }
private void btnEkle_Click(object sender, EventArgs e) { if (!string.IsNullOrEmpty(txtRafNo.Text)) { List <EShelf> shelfList = BLLShelf.GetAll(); shelfList = (from l in shelfList where l.ShelfNo.Trim().ToLower().Equals(txtRafNo.Text.Trim().ToLower()) select l).ToList(); if (shelfList.Count == 0) { EShelf shelf = new EShelf(); shelf.Category = new ECategories(); shelf.ShelfNo = txtRafNo.Text; shelf.Category.ID = Convert.ToInt32(cmbRafTuru.SelectedValue); if (BLLShelf.InsertNewShelf(shelf)) { MessageBox.Show("Yeni raf kayıt işlemi başarıyla tamamlanmıştır!"); lstRaf.DataSource = BLLShelf.GetAll(); txtRafNo.Clear(); txtRafNo.Focus(); } else { MessageBox.Show("Bir hata oluştu!"); } } else { MessageBox.Show("Kaydetmek istediğiniz raf zaten kayıtlı!"); } } else { MessageBox.Show("Raf numarası boş geçilemez!"); } }
protected void btnKaydet_Click(object sender, EventArgs e) { if (!string.IsNullOrEmpty(txtRafNo.Text)) { List <EShelf> shelfList = BLLShelf.GetAll(); shelfList = (from l in shelfList where l.ShelfNo.Trim().ToLower().Equals(txtRafNo.Text.Trim().ToLower()) select l).ToList(); if (shelfList.Count == 0) { EShelf shelf = new EShelf(); shelf.Category = new ECategories(); shelf.ShelfNo = txtRafNo.Text; shelf.Category.ID = Convert.ToInt32(cmbRafTuru.SelectedValue); if (BLLShelf.InsertNewShelf(shelf)) { Response.Write("<script>alert('Raf kayıt işleminiz başarıyla gerçekleşmiştir.')</script>"); } else { Response.Write("<script>alert('Hata Oluştu!')</script>"); } } else { Response.Write("<script>alert('Kaydetmek istediğiniz raf zaten kayıtlı!')</script>"); } txtRafNo.Text = String.Empty; cmbRafTuru.ClearSelection(); txtRafNo.Focus(); } else { Response.Write("<script>alert('Raf numarası boş geçilemez!')</script>"); } }