コード例 #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
        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>");
                }
            }
        }
コード例 #4
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;
            }
        }
コード例 #5
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);
     }
 }
コード例 #6
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();

                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();
            }
        }
コード例 #7
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!");
            }
        }
コード例 #8
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";
        }
コード例 #9
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>");
            }
        }
コード例 #10
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>");
            }
        }