Exemple #1
0
 /// <summary>
 /// Json通用网格返回格式:返回成功
 /// </summary>
 /// <returns>
 /// Json格式 : {code:0,rows:data,total:1,message:Success}
 /// </returns>
 protected virtual HttpResponseMessage ResponseGridResult() => HttpResponseMessageResultFormat.ResponseGridResult();
Exemple #2
0
 /// <summary>
 /// Json通用网格返回格式:返回失败
 /// </summary>
 /// <param name="code">失败代码</param>
 /// <param name="message">失败信息</param>
 /// <returns>
 /// Json格式 : {code:-1,rows:[],total:0,message:Unknown error}
 /// </returns>
 protected virtual HttpResponseMessage ResponseGridResult(int code = -1, string message = "Unknown error") => HttpResponseMessageResultFormat.ResponseGridResult(code, message);
Exemple #3
0
 /// <summary>
 /// Json通用网格返回格式:返回失败
 /// </summary>
 /// <param name="message">失败信息</param>
 /// <returns>
 /// Json格式 : {code:-1,rows:[],total:0,message:Unknown error}
 /// </returns>
 protected virtual HttpResponseMessage ResponseGridResult(string message = "Unknown error") => HttpResponseMessageResultFormat.ResponseGridResult(message);
Exemple #4
0
 /// <summary>
 /// Json通用网格返回格式:返回成功
 /// </summary>
 /// <param name="dataTable"><see cref="DataTable"/></param>
 /// <param name="count">数据量(默认为 <see cref="DataTable.Rows"/> 的Count)</param>
 /// <returns>
 /// Json格式 : {code:0,rows:DataTable,total:DataTable.Rows.Count,message:Success}
 /// </returns>
 protected virtual HttpResponseMessage ResponseGridResult(DataTable dataTable, int count = 0) => HttpResponseMessageResultFormat.ResponseGridResult(dataTable, count);
Exemple #5
0
 /// <summary>
 /// Json通用网格返回格式:返回成功
 /// </summary>
 /// <param name="list"><see cref="List{T}"/></param>
 /// <param name="count">数据量(默认为 <see cref="List{T}.Count"/>)</param>
 /// <returns>
 /// Json格式 : {code:0,rows:List,total:List.Count(),message:Success}
 /// </returns>
 protected virtual HttpResponseMessage ResponseGridResult <T>(List <T> list, int count = 0) => HttpResponseMessageResultFormat.ResponseGridResult(list, count);
Exemple #6
0
 /// <summary>
 /// Json通用网格返回格式:返回成功
 /// </summary>
 /// <param name="data">数据</param>
 /// <param name="count">数据量(默认为1,数据为null则为0)</param>
 /// <returns>
 /// Json格式 : {code:0,rows:data,total:1,message:Success}
 /// </returns>
 protected virtual HttpResponseMessage ResponseGridResult <T>(T data, int count = 1) => HttpResponseMessageResultFormat.ResponseGridResult(data, count);