public void Borrow(BookCopy BookCopyToBorrow, Customer customer)
 {
     string isbn = BookCopyToBorrow.Book.ISBN;
     int customerID = customer.CustomerID;
     int copyID = BookCopyToBorrow.CopyID;
     dataContext.usp_borrow_book(isbn, customerID, copyID);
 }
 public void ShowChangeCustomerWindow(Customer customer)
 {
     ChangeCustomer cc = new ChangeCustomer();
     cc.CustomerToChange = customer;
     cc.Show();
 }
        public List<Borrowing> GetAllBorrowings()
        {
            var query = from c in dataContext.get_all_borrows()
                        select new
                        {
                            ISBN = c.ISBN,
                            CopyID = c.CopyID,
                            CustomerID = c.CustomerID,
                            Name = c.Name
                        };
            List<Borrowing> borrowings = new List<Borrowing>();
            foreach (var item in query)
            {
                Book book = new Book();
                book.ISBN = item.ISBN;

                BookCopy bc = new BookCopy();
                bc.Book = book;
                bc.CopyID = item.CopyID;

                Customer cust = new Customer();
                cust.CustomerID = item.CustomerID;
                cust.Name = item.Name;

                Borrowing b = new Borrowing();
                b.BookCopy = bc;
                b.Customer = cust;

                borrowings.Add(b);
            }
            return borrowings;
        }