Exemplo n.º 1
0
        public ActionResult Edit(EasyBooks.Domain.Book book)
        {
            if (ModelState.IsValid)
            {
                var service = IoC.Resolve <IBookService>();

                if (book.ID != 0)
                {
                    service.Save(book.ID, book);
                }
                else
                {
                    service.InsertBook(book);
                }

                return(RedirectToAction("Index"));
            }
            else
            {
                return(View(book));
            }
        }
Exemplo n.º 2
0
 public void Save(long id, Book book)
 {
     _repository.Save(id, book);
 }
Exemplo n.º 3
0
 public void InsertBook(Book book)
 {
     _repository.Create(book);
 }