public static string GetAllBooks(int page, int limit) { LayUITable table = new LayUITable(); table.code = 0; table.count = BookInfoDAL.SelectBookCount(); if (page == -1 || limit == -1) { table.data = BookInfoDAL.GetAllBooks(); } else { table.data = BookInfoDAL.GetAllBooks((page - 1) * limit, limit); } table.msg = "success"; return(JsonConvert.SerializeObject(table)); }