public static void AddBook()
        {
            Console.WriteLine("Название книги: ");
            string name = Console.ReadLine();

            Console.WriteLine("Год публикации:");
            int publicYear = int.Parse(Console.ReadLine());

            Console.WriteLine("Издательство: ");
            string publisher = Console.ReadLine();

            Console.WriteLine("Количество страниц:");
            int countOfPages = int.Parse(Console.ReadLine());

            Console.WriteLine("Цена:");
            int price = int.Parse(Console.ReadLine());

            Console.WriteLine("Количество экземпляров:");
            int countCopy = int.Parse(Console.ReadLine());

            Console.WriteLine("Cтатус книги: ");
            string statusBook = Console.ReadLine();
            var    newBook    = new Book()
            {
                Name         = name,
                PublicYear   = publicYear,
                Publisher    = publisher,
                CountOfPages = countOfPages,
                Price        = price,
                CountCopy    = countCopy,
                StatusBook   = statusBook
            };

            bookLogic.AddBook(newBook);
        }
Exemplo n.º 2
0
 public ActionResult Create(CreateBookVM book)
 {
     try
     {
         _bookLogic.AddBook(_mapper.Map <Book>(book), book.IdAuthor);
         return(RedirectToAction("Index", "PrintEdition"));
     }
     catch (Exception ex)
     {
         Logger.Info("Something go wrong in Creating of Book page " + ex.Message);
         return(View());
     }
 }