示例#1
0
        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;
        }
示例#2
0
        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();
            }
        }
示例#3
0
        private void btnGuncelle_Click(object sender, EventArgs e)
        {
            if (lvYazar.SelectedItems.Count > 0)
            {
                if (!string.IsNullOrEmpty(txtYazarAdi.Text) & !string.IsNullOrEmpty(txtYazarSoyadi.Text))
                {
                    EAuthors author = new EAuthors();
                    author.ID = Convert.ToInt32((int)lvYazar.SelectedItems[0].Tag);

                    author.FirstName = txtYazarAdi.Text;
                    author.LastName  = txtYazarSoyadi.Text;

                    if (BLLAuthors.Update(author))
                    {
                        MessageBox.Show("Güncelleme başarılı!");
                        txtYazarAdi.Clear();
                        txtYazarSoyadi.Clear();
                        lvYazar.Items.Clear();
                        Listele();
                    }
                    else
                    {
                        MessageBox.Show("Güncelleme başarısız oldu!");
                    }
                }
                else
                {
                    MessageBox.Show("Eksik bilgi girdiniz. Lütfen kontrol ediniz!");
                }
            }
            else
            {
                MessageBox.Show("Güncelleme işlemi yapmak istediğiniz yazarı listeden çift tıklayarak seçiniz.");
            }
        }
示例#4
0
        private void btnSil_Click(object sender, EventArgs e)
        {
            if (lvYazar.SelectedItems.Count > 0)
            {
                int selectedAuthorID = (int)lvYazar.SelectedItems[0].Tag;

                DialogResult result = MessageBox.Show("Silmek istediğinize emin misiniz ?", "Uyarı", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
                if (result == DialogResult.Yes)
                {
                    EAuthors silinecekYazar = new EAuthors();
                    silinecekYazar.ID = selectedAuthorID;
                    EAuthors author = new EAuthors();

                    author.ID = silinecekYazar.ID;
                    if (BLLAuthors.Delete(author))
                    {
                        MessageBox.Show("Silme işleminiz başarıyla tamamlanmıştır.");
                        lvYazar.Items.Clear();
                        txtYazarAdi.Clear();
                        txtYazarSoyadi.Clear();
                    }
                    else
                    {
                        MessageBox.Show("Bir hata oluştu!");
                    }
                    Listele();
                }
            }
            else
            {
                MessageBox.Show("Silmek istediğiniz yazarı seçiniz.");
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (IsPostBack)
            {
                return;
            }

            if (Request.QueryString["ID"] != null)
            {
                EAuthors author = new EAuthors();
                author.ID = int.Parse(Request.QueryString["ID"]);
                bool sonuc = BLLAuthors.Delete(author);
                if (sonuc)
                {
                    Response.Write("<script>alert('Harika! Silindi!')</script>");
                }
                else
                {
                    Response.Write("<script>alert('Hay Aksi! Silinemedi!')</script>");
                }
            }

            rptYazarlar.DataSource = BLLAuthors.GetAll();
            rptYazarlar.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>");
                }
            }
        }
示例#6
0
        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;
            }
        }
示例#7
0
        private void lvYazar_DoubleClick(object sender, EventArgs e)
        {
            int selectedAuthorID = (int)lvYazar.SelectedItems[0].Tag;

            EAuthors selectedAuthor = new EAuthors();

            selectedAuthor = BLLAuthors.GetIdOnly(selectedAuthorID);

            txtYazarAdi.Text    = selectedAuthor.FirstName;
            txtYazarSoyadi.Text = selectedAuthor.LastName;
        }
示例#8
0
 void Listele()
 {
     foreach (EAuthors item in BLLAuthors.GetAll())
     {
         ListViewItem lvi = new ListViewItem();
         lvi.Text = item.FirstName;
         lvi.SubItems.Add(item.LastName).ToString();
         lvi.Tag = item.ID;
         lvYazar.Items.Add(lvi);
     }
 }
示例#9
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                int authorID = Convert.ToInt32(Request.QueryString["yazarID"].ToString());

                EAuthors author = new EAuthors();
                author              = BLLAuthors.GetIdOnly(authorID);
                txtYazarAdi.Text    = author.FirstName;
                txtYazarSoyadi.Text = author.LastName;
            }
        }
        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();
            }
        }
示例#11
0
        private void btnKaydet_Click(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(txtYazarAdi.Text) & !string.IsNullOrEmpty(txtYazarSoyadi.Text))
            {
                List <EAuthors> authorList = BLLAuthors.GetAll();

                authorList = (from l in authorList
                              where l.FirstName.Trim().ToLower().Equals(txtYazarAdi.Text.Trim().ToLower()) &&
                              l.LastName.Trim().ToLower().Equals(txtYazarSoyadi.Text.Trim().ToLower())
                              select l).ToList();

                if (authorList.Count == 0)
                {
                    EAuthors author = new EAuthors();
                    author.FirstName = txtYazarAdi.Text;
                    author.LastName  = txtYazarSoyadi.Text;

                    bool sonuc = BLLAuthors.InsertNewAuthor(author);

                    if (sonuc)
                    {
                        MessageBox.Show("Yazar kayıt işlemi başarıyla gerçekleşmiştir!");
                        txtYazarAdi.Clear();
                        txtYazarSoyadi.Clear();
                        txtYazarAdi.Focus();
                        lvYazar.Items.Clear();
                        Listele();
                    }
                    else
                    {
                        MessageBox.Show("Bir hata oluştu");
                    }
                }
                else
                {
                    MessageBox.Show("Yazar zaten kayıtlı!");
                }
            }
            else
            {
                MessageBox.Show("Eksik bilgi girdiniz.Lütfen kontrol ediniz!");
            }
        }
示例#12
0
        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";
        }
示例#13
0
        protected void btnKaydet_Click(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(txtYazarAdi.Text) & !string.IsNullOrEmpty(txtYazarSoyadi.Text))
            {
                List <EAuthors> authorList = BLLAuthors.GetAll();

                authorList = (from l in authorList
                              where l.FirstName.Trim().ToLower().Equals(txtYazarAdi.Text.Trim().ToLower()) &&
                              l.LastName.Trim().ToLower().Equals(txtYazarSoyadi.Text.Trim().ToLower())
                              select l).ToList();

                if (authorList.Count == 0)
                {
                    EAuthors author = new EAuthors();
                    author.FirstName = txtYazarAdi.Text;
                    author.LastName  = txtYazarSoyadi.Text;

                    if (BLLAuthors.InsertNewAuthor(author))
                    {
                        Response.Write("<script>alert('Yazar 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 yazar zaten kayıtlıdır!')</script>");
                }
                txtYazarAdi.Text    = String.Empty;
                txtYazarSoyadi.Text = String.Empty;
                txtYazarAdi.Focus();
            }
            else
            {
                Response.Write("<script>alert('Eksik bilgi girdiniz. Lütfen kontrol ediniz!')</script>");
            }
        }
示例#14
0
        protected void btnGuncelle_Click(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(txtYazarAdi.Text) & !string.IsNullOrEmpty(txtYazarSoyadi.Text))
            {
                List <EAuthors> authorList = new List <EAuthors>();
                authorList = BLLAuthors.GetAll();

                authorList = (from l in authorList
                              where l.FirstName.Trim().ToLower().Equals(txtYazarAdi.Text.Trim().ToLower()) &&
                              l.LastName.Trim().ToLower().Equals(txtYazarSoyadi.Text.Trim().ToLower())
                              select l).ToList();
                if (authorList.Count == 0)
                {
                    EAuthors guncellenecek = new EAuthors();
                    guncellenecek.ID        = int.Parse(Request.QueryString["yazarID"]);
                    guncellenecek.FirstName = txtYazarAdi.Text;
                    guncellenecek.LastName  = txtYazarSoyadi.Text;
                    bool sonuc = BLLAuthors.Update(guncellenecek);
                    if (sonuc)
                    {
                        Response.Write("<script>alert('Harika! Güncellendi!');</script>");
                        Response.Redirect("Yazarlar.aspx?scs=1");
                    }
                    else
                    {
                        Response.Write("<script>alert('Hay Aksi! Hata Oluştu!')</script>");
                    }
                }
                else
                {
                    Response.Write("<script>alert('Aynı isimde kayıtlı yazar mevcuttur!')</script>");
                    Response.Redirect("Yazarlar.aspx?scs=1");
                }
            }
            else
            {
                Response.Write("<script>alert('Eksik bilgi girdiniz. Lütfen kontrol ediniz!')</script>");
            }
        }