private void BtnEditIssuedBook_Click(object sender, EventArgs e)
        {
            var issuedBook = issuedBooksBindingSource.Current as IssuedBook;

            if (issuedBook == null)
            {
                return;
            }

            var reader = readersRepository.FindById(issuedBook.IdReader);
            var book   = booksRepository.FindById(issuedBook.IdBook);

            using (var form = new AddEditIssuedBookForm(issuedBook, book,
                                                        reader, issuedBooksRepository))
            {
                if (form.ShowDialog() == DialogResult.OK)
                {
                    issuedBooksBindingSource.ResetCurrentItem();
                    bookBindingSource.DataSource = booksRepository.GetAll();
                }
            }
        }
Example #2
0
 // GET: Books/Details/5
 public ActionResult Details(int id)
 {
     return(View(booksRepository.FindById(id)));
 }