示例#1
0
        public string SaveBook(Book book)
        {
            bool isExisted = bookGateway.ExistISBN(book);

            if (isExisted)
            {
                return("Already Exists");
            }

            else
            {
                if (book.ISBN.Length == 13)
                {
                    bool isSaved = bookGateway.SaveBook(book);

                    if (isSaved)
                    {
                        return("Book Saved Successfully");
                    }
                    else
                    {
                        return("Failed to Save");
                    }
                }

                else
                {
                    return("ISBN must be 13 digit");
                }
            }
        }