Exemplo n.º 1
0
 private void borrowToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (id != null)
     {
         Borrow borrowPage = new Borrow(id);
         borrowPage.MdiParent = this;
         borrowPage.Show();
     }
     else
     {
         MessageBox.Show("Please login first.");
     }
 }
Exemplo n.º 2
0
        // insert data of borrower for admin to monitor the borrowe return the book or not
        private void InsertBorrowerInfoToDatabase()
        {
            borrowD = borrowDate.Value.ToString("dd-mm-yyyy");
            returnD = returnDate.Value.ToString("dd-mm-yyyy");

            libraryDataContext borrowBook = new libraryDataContext(@"Data Source=(LocalDB)\v11.0;AttachDbFilename=F:\C# project\LibraryManagementSystem\Library management software(final)\Library management software\Library management software\datatable.mdf;Integrated Security=True;Connect Timeout=30");
            Borrow             borrowInfo = new Borrow
            {
                name       = getNameLbl.Text,
                userId     = getUserIdLbl.Text,
                bookId     = BookIdTF.Text,
                borrowDate = borrowD,
                returnDate = returnD,
                totalDays  = dateDiffTF.Text
            };

            //borrowInfo.BookBorrowInfos.InsertOnSubmit();
            borrowBook.Borrows.InsertOnSubmit(borrowInfo);
            borrowBook.SubmitChanges();
        }
 partial void DeleteBorrow(Borrow instance);
 partial void UpdateBorrow(Borrow instance);
 partial void InsertBorrow(Borrow instance);