Beispiel #1
0
 /// <summary>
 /// 返回JSON格式数据
 /// </summary>
 /// <param name="data"></param>
 /// <param name="status"></param>
 /// <param name="msg"></param>
 /// <returns></returns>
 protected ActionResult JsonResult(object data = null, bool status = true, string msg = "", int dataCount = 0)
 {
     return(OutPut.JsonContent(new { data, code = status ? 0 : 500, msg, dataCount }));
 }
Beispiel #2
0
 /// <summary>
 /// 返回表格数据
 /// </summary>
 /// <param name="data"></param>
 /// <param name="page"></param>
 /// <param name="limit"></param>
 /// <param name="dataCount"></param>
 /// <returns></returns>
 protected ActionResult TableResult(object data, int page, int limit, int dataCount)
 {
     return(OutPut.JsonContent(new { page, total = CoumputPageCount(limit, dataCount), records = dataCount, rows = data }));
 }