示例#1
0
        public ActionResult CreateView()
        {
            var model = new BookModel();

            //model.BookGenreId = 1;

            return PartialView("_CreateBook", model);
        }
示例#2
0
        public ActionResult Create(BookModel book)
        {
            try
            {

                var tmp_book = new Book();
                string err = null;

                tmp_book = AutoMapper.Mapper.Map<Book>(book);
                tmp_book.AddDate = System.DateTime.Now;

                var dao = new UserService();

                err = dao.CreateBook(tmp_book);

                // TODO: Add insert logic here

                return RedirectToAction("Index");
            }
            catch
            {
                return View();
            }
        }