/// <summary> /// 返回页面消息弹框 /// </summary> /// <param name="msg">消息内容</param> /// <param name="url">跳转链接</param> /// <param name="icon">消息类型</param> /// <param name="anim">消息动画</param> /// <param name="time">出现时间</param> /// <returns></returns> public static string LayerMsg(string msg, Icon icon, string url = "", int anim = -1, int time = 2000) { // 链接 if (string.IsNullOrEmpty(url)) { url = EnythingUtils.GetUrlInfo(); } // 动画 anim = anim % 7; if (anim < 0) { anim = new Random().Next(0, 7); } StringBuilder str = new StringBuilder(); Dictionary <object, object> dic = new Dictionary <object, object> { { "skin", layer_Skin }, { "anim", anim }, { "time", time }, { "icon", GetIconNum(icon) } }; str.Append("<script>"); str.Append("location.href='" + url + "'; "); // 由于要返回的是父窗的方法,所以加上parent. str.Append("parent.layer.msg('" + msg + "',{"); str.Append(EnythingUtils.MosaicKeyVal(dic) + "});"); str.Append("</script>"); return(str.ToString()); }
public T GetReqObj <T>(string url) where T : class, new() { T obj = new T(); obj = EnythingUtils.JsonToObject(EnythingUtils.GetUrlHtml(url), obj) as T; return(obj); }
/// <summary> /// 返回物理路径 /// </summary> /// <param name="FileName"></param> /// <param name="Path"></param> /// <returns></returns> private static string PhysicsPath(string FileName, string Path = "") { Path = EnythingUtils.PathHandle(Path); if (!string.IsNullOrEmpty(Path)) { Path += "\\"; } Path = "~\\App_Data\\" + Path; Path = HttpContext.Current.Server.MapPath(Path); if (!Directory.Exists(Path)) { Directory.CreateDirectory(Path); } return(Path + FileName); }
/// <summary> /// 执行分页 /// </summary> public void GetPageList() { PageContent = EnythingUtils.OutPageList(PageSize, PageIndex, PageCount, PageUrl, PageCent, PageDrop); }