Example #1
0
 /// <summary>
 /// 显示消息。
 /// </summary>
 /// <param name="result">操作接口。</param>
 /// <param name="url">转向地址。</param>
 /// <param name="model">模型实例对象。</param>
 /// <param name="args">参数。</param>
 protected IActionResult View(DataResult result, string url, object model, params object[] args)
 {
     if (result.Succeed())
     {
         return(View(StatusType.Success, result.ToString(args), model, url));
     }
     return(View(StatusType.Danger, result.ToString(args), model));
 }
Example #2
0
 /// <summary>
 /// 返回JSON试图结果。
 /// </summary>
 /// <param name="result">数据结果。</param>
 /// <param name="args">参数。</param>
 /// <returns>返回JSON试图结果。</returns>
 protected IActionResult Json(DataResult result, params object[] args)
 {
     if (result.Succeed())
     {
         return(Json(StatusType.Success, result.ToString(args)));
     }
     return(Json(StatusType.Danger, result.ToString(args)));
 }
Example #3
0
 /// <summary>
 /// 返回带状态消息页面结果。
 /// </summary>
 /// <param name="result">数据结果。</param>
 /// <param name="args">参数。</param>
 /// <returns>返回当前页面结果。</returns>
 protected IActionResult RedirectToResult(DataResult result, params object[] args)
 {
     if (result.Succeed())
     {
         return(RedirectToPage(StatusType.Success, result.ToString(args)));
     }
     return(RedirectToPage(StatusType.Danger, result.ToString(args)));
 }