Ejemplo n.º 1
0
        public ActionResult Confirm(int id)
        {
            CopyBook.CopyBooks(id);

            /*string message = "Do you want to add this book?";
             * string title = "Message";
             * MessageBoxButtons buttons = MessageBoxButtons.YesNo;
             * DialogResult result = MessageBox.Show(message, title, buttons);
             * if (result == DialogResult.Yes)
             * {
             *   CopyItem.CopyBook.CopyBooks(id);
             *   if (MessageBox.Show("This book has been added to your list! Do you want to check your list?", "Message", MessageBoxButtons.YesNo) == DialogResult.Yes)
             *   {
             *       return new RedirectResult("MyBooks");
             *   }
             *   else
             *   {
             *       return new RedirectResult("DisplayBook");
             *   }
             * }
             * else
             * {
             *   return new RedirectResult("DisplayBook");
             * }*/
            return(RedirectToAction("Cart"));
        }
Ejemplo n.º 2
0
        public int PassingBookData(Book model)
        {
            var copyBook = new CopyBook()
            {
                Title       = model.Title,
                Author      = model.Author,
                Description = model.Description,
                Category    = model.Category,
                TotalPage   = model.TotalPage.HasValue ? model.TotalPage.Value : 0,
                Language    = model.Language
            };

            _context.Books.Add(copyBook);
            _context.SaveChanges();
            return(copyBook.Id);
        }
        public async Task <int> AddNewBook(Book model)
        {
            var book = new CopyBook()
            {
                Id          = model.Id,
                Title       = model.Title,
                Author      = model.Author,
                Description = model.Description,
                Category    = model.Category,
                TotalPage   = model.TotalPage
            };
            await _context.Books.AddAsync(book);

            await _context.SaveChangesAsync();

            return(book.Id);
        }
Ejemplo n.º 4
0
        static void Main(string[] args)
        {
            Book     book = new Book("Hello I am from book");
            CopyBook cp   = new CopyBook("Hello i am from copybook");
            Journal  jr   = new Journal("Hello i am from journal");
            Notebook nt   = new Notebook("Hello i am from notebook");

            book.GetContent();
            jr.GetContent();
            nt.GetText();
            cp.GetText();

            WriteLine("\nWrite a text in to notebook");

            nt.SetText();
            nt.GetText();

            WriteLine("\nWrite a text in to notebook");

            cp.SetText();
            cp.GetText();
        }