示例#1
0
        public ActionResult List(string key = "")
        {
            var result = BookRepo.GetAll(key);

            if (TempData["Error"] != null)
            {
                ViewBag.Error = TempData["Error"];
            }
            return(View(result));
        }
示例#2
0
 public ActionResult Index(int?id)
 {
     if (id.HasValue)
     {
         var result = BookRepo.GetAll((int)id);
         return(View(result));
     }
     else
     {
         var result = BookRepo.GetAll();
         return(View(result));
     }
 }