예제 #1
0
        private void btnTeslimAl_Click(object sender, EventArgs e)
        {
            EBorrowedBooks returnBook = new EBorrowedBooks();

            returnBook = (EBorrowedBooks)dataGridView1.SelectedRows[0].DataBoundItem;
            DialogResult result = MessageBox.Show("'" + returnBook.bookName + "'" + " " + "isimli kitabı teslim almak istediğinizden emin misiniz?", "Uyarı", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);

            if (result == DialogResult.Yes)
            {
                returnBook.IsReturned   = false;
                returnBook.DateOfReturn = DateTime.Now;
                bool sonuc = BLLBorrowedBooks.Update(returnBook);
                if (sonuc)
                {
                    MessageBox.Show("Harika! Kitap Teslim Alındı!");
                    txtIsbnNo.Clear();
                }
                else
                {
                    MessageBox.Show("Bir hata oluştu!");
                }
            }

            List <EBorrowedBooks> kiralist = BLLBorrowedBooks.GetAll();

            kiralist = (from k in kiralist
                        where k.IsReturned == true
                        select k).ToList <EBorrowedBooks>();
            dataGridView1.DataSource = kiralist;
        }
예제 #2
0
        private void KitapTeslimFormu_Load(object sender, EventArgs e)
        {
            dataGridView1.AutoGenerateColumns = false;
            List <EBorrowedBooks> kiralist = BLLBorrowedBooks.GetAll();

            kiralist = (from k in kiralist
                        where k.IsReturned == true
                        select k).ToList <EBorrowedBooks>();
            dataGridView1.DataSource = kiralist;
        }
예제 #3
0
        private void txtIsbnNo_TextChanged(object sender, EventArgs e)
        {
            string searchText = txtIsbnNo.Text;

            List <EBorrowedBooks> kiralamaList = BLLBorrowedBooks.GetAll();

            kiralamaList = (from l in kiralamaList
                            where l.Book.ISBNNO.Trim().ToLower().Contains(searchText.Trim().ToLower()) &&
                            l.IsReturned == true
                            select l).ToList <EBorrowedBooks>();

            dataGridView1.DataSource = kiralamaList;
        }
예제 #4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (IsPostBack)
            {
                return;
            }

            if (Request.QueryString["ID"] != null)
            {
                EBorrowedBooks returnBook = new EBorrowedBooks();
                returnBook.ID           = int.Parse(Request.QueryString["ID"]);
                returnBook              = BLLBorrowedBooks.GetIdOnly(returnBook.ID);
                returnBook.DateOfReturn = DateTime.Now;
                returnBook.IsReturned   = false;


                bool sonuc = BLLBorrowedBooks.Update(returnBook);
                if (sonuc)
                {
                    Response.Write("<script>alert('Harika! Kitap Teslim Alındı!')</script>");
                }
                else
                {
                    Response.Write("<script>alert('Bir hata oluştu!')</script>");
                }
            }

            List <EBorrowedBooks> bookList = BLLBorrowedBooks.GetAll();

            if (bookList != null && bookList.Count > 0)
            {
                bookList = (from l in bookList
                            where l.IsReturned == true
                            select l).ToList <EBorrowedBooks>();
            }
            else
            {
                Response.Write("<script>alert('Teslim alınacak kitap bulunamadı!')</script>");
            }
            rptKitaplar.DataSource = bookList;
            rptKitaplar.DataBind();
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            List <EBorrowedBooks> borrowedBookList = BLLBorrowedBooks.GetAll();

            if (chbDisarda.Checked)
            {
                chbGecTeslim.Enabled = chbGecikmis.Enabled = false;
                if (borrowedBookList != null && borrowedBookList.Count > 0)
                {
                    borrowedBookList = (from l in borrowedBookList
                                        where l.IsReturned == true
                                        select l).ToList <EBorrowedBooks>();
                    if (borrowedBookList.Count > 0)
                    {
                        rptKitaplar.DataSource = borrowedBookList;
                        rptKitaplar.DataBind();
                    }
                }
            }
            else if (chbGecikmis.Checked)
            {
                chbGecTeslim.Enabled = chbDisarda.Enabled = false;
                if (borrowedBookList != null && borrowedBookList.Count > 0)
                {
                    borrowedBookList = (from l in borrowedBookList
                                        where new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day) >= new DateTime(l.ExpireDate.Year, l.ExpireDate.Month, l.ExpireDate.Day) &&
                                        l.IsReturned == true
                                        select l).ToList <EBorrowedBooks>();
                    if (borrowedBookList.Count > 0)
                    {
                        rptKitaplar.DataSource = borrowedBookList;
                        rptKitaplar.DataBind();
                    }
                    else
                    {
                        rptKitaplar.DataSource = borrowedBookList;
                        rptKitaplar.DataBind();
                    }
                }
            }
            else if (chbGecTeslim.Checked)
            {
                chbGecikmis.Enabled = chbDisarda.Enabled = false;
                if (borrowedBookList != null && borrowedBookList.Count > 0)
                {
                    borrowedBookList = (from l in borrowedBookList
                                        where l.DateOfReturn.HasValue &&
                                        new DateTime(l.DateOfReturn.Value.Year, l.DateOfReturn.Value.Month, l.DateOfReturn.Value.Day) >= new DateTime(l.ExpireDate.Year, l.ExpireDate.Month, l.ExpireDate.Day) &&
                                        l.IsReturned == false
                                        select l).ToList <EBorrowedBooks>();
                    if (borrowedBookList.Count > 0)
                    {
                        rptKitaplar.DataSource = borrowedBookList;
                        rptKitaplar.DataBind();
                    }
                    else
                    {
                        rptKitaplar.DataSource = borrowedBookList;
                        rptKitaplar.DataBind();
                    }
                }
            }
            else
            {
                chbGecTeslim.Enabled   = chbGecikmis.Enabled = chbDisarda.Enabled = true;
                rptKitaplar.DataSource = borrowedBookList;
                rptKitaplar.DataBind();
            }
        }
 private void KiralananKitaplar_Load(object sender, EventArgs e)
 {
     dataGridView1.AutoGenerateColumns = false;
     dataGridView1.DataSource          = BLLBorrowedBooks.GetAll();
 }