Example #1
0
        public string DeleteBook(int?bookId)
        {
            string statusCode = "0";
            int    id         = Ext.GetInt(bookId);

            if (bookId > 0)
            {
                bool isDeleted = db.bookRepozitory.delete(id);
                statusCode = (isDeleted) ? "1" : "2";
            }
            return(statusCode);
            // return View(db.bookRepozitory.findAll());
        }
Example #2
0
        public ActionResult EditBook(int?bookId)
        {
            int id = Ext.GetInt(bookId);

            if (id > 0)
            {
                Book bookModel = db.bookRepozitory.findBook(id);
                return(View(bookModel));
            }
            else
            {
                return(RedirectToAction("List"));
            }
        }