예제 #1
0
 private IActionResult View(BsType type, string message, object model, string url = null)
 {
     // 不是网址
     if (url != null && url.IndexOf('/') == -1)
     {
         url = Url.Action(url, ControllerName, new { area = AreaName });
     }
     ViewBag.BsMessage = new BsMessage(message, type, url);
     return(View(model));
 }
예제 #2
0
 private IActionResult View(BsType type, string message, object model, string url = null)
 {
     if (url != null)
     {
         // 不是网址
         if (url[0] != '/')
         {
             url = Url.Action(url, ControllerName, new { area = AreaName });
         }
         message += "<script>setTimeout(function(){location.href='" + url + "';}, 3000);</script>";
     }
     ViewBag.BsMessage = new BsMessage(message, type);
     return(View(model));
 }
예제 #3
0
 private IActionResult Json <TData>(BsType type, string message, TData data)
 {
     return(Json(new JsonMesssage <TData>(type, message, data)));
 }
예제 #4
0
 private IActionResult Json(BsType type, string message)
 {
     return(Json(new JsonMesssage(type, message)));
 }
예제 #5
0
 /// <summary>
 /// 初始化类<see cref="JsonMesssage"/>。
 /// </summary>
 /// <param name="type">显示类型。</param>
 /// <param name="message">消息。</param>
 public JsonMesssage(BsType type, string message)
 {
     Type    = type.ToString().ToLower();
     Message = message;
 }