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)); }
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)); }
private IActionResult Json <TData>(BsType type, string message, TData data) { return(Json(new JsonMesssage <TData>(type, message, data))); }
private IActionResult Json(BsType type, string message) { return(Json(new JsonMesssage(type, message))); }
/// <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; }