예제 #1
0
        public bool EditBook(Book book)
        {
            try
            {
                if (BookAccessor.UpdateBook(book))
                {
                    return(true);
                }
            }
            catch (Exception)
            {
                throw;
            }

            return(false);
        }
        public bool EditBook(Book book, Book oldBook, string updateType)
        {
            var result = false;

            if (book.ISBN == "" || book.Title == "" || book.Edition == "" ||
                book.EditionYear < 800 ||
                book.AuthorID < 100000)
            {
                throw new ApplicationException("You must fill out all the fields.");
            }
            try
            {
                result = (0 != BookAccessor.UpdateBook(book, oldBook, updateType));
            }
            catch (Exception)
            {
                throw;
            }
            return(result);
        }