private string Query(HttpContext context) { StringBuilder sbWhere = new StringBuilder(); int pageIndex = Convert.ToInt32(context.Request["page"]); int pageSize = Convert.ToInt32(context.Request["rows"]); string keyWord = context.Request["searchReq"]; string permissionKey = context.Request["key"]; string type = context.Request["type"]; string cateID = context.Request["cateID"]; sbWhere.AppendFormat(" 1=1 "); if (!string.IsNullOrWhiteSpace(type)) { sbWhere.AppendFormat(" AND PermissionType={0}", type); } if (!string.IsNullOrWhiteSpace(cateID) && cateID != "0") { sbWhere.AppendFormat(" AND PermissionCateId ={0}", cateID); } if (!string.IsNullOrWhiteSpace(permissionKey)) { sbWhere.AppendFormat(" AND PermissionKey like '%{0}%'", permissionKey); } if (!string.IsNullOrWhiteSpace(keyWord)) { sbWhere.AppendFormat(" AND PermissionName like '%{0}%' Or Url like '%{0}%'", keyWord); } List <PermissionInfo> list = bllPer.GetLit <PermissionInfo>(pageSize, pageIndex, sbWhere.ToString(), "PermissionName"); int totalCount = bllPer.GetCount <PermissionInfo>(sbWhere.ToString()); if (list.Count > 0) { BLLArticleCategory bllArticleCategory = new BLLArticleCategory(); List <ZentCloud.BLLJIMP.Model.ArticleCategory> cateList = new BLLJIMP.BLLArticleCategory().GetList <ZentCloud.BLLJIMP.Model.ArticleCategory>(string.Format("WebsiteOwner='{0}' And CategoryType='{1}' Order by Sort", "Common", "Permission")); for (int i = 0; i < list.Count; i++) { if (list[i].PermissionCateId == 0) { continue; } ZentCloud.BLLJIMP.Model.ArticleCategory nowType = cateList.FirstOrDefault(p => p.AutoID == list[i].PermissionCateId); if (nowType != null) { list[i].PermissionCate = nowType.CategoryName; } } } return(Common.JSONHelper.ObjectToJson( new { total = totalCount, rows = list })); }
protected void Page_Load(object sender, EventArgs e) { string indexStr = File.ReadAllText(this.Server.MapPath("orderlist.html")); indexStr = indexStr.Replace("index.html", "index.aspx"); indexStr = indexStr.Replace("orderlist.html", "orderlist.aspx"); indexStr = indexStr.Replace("orderDetail.html", "orderDetail.aspx"); indexStr = indexStr.Replace("submitOrder.html", "submitOrder.aspx"); indexStr = indexStr.Replace("/OpenWebApp/", "/"); #region 根据类型输出配置 string categoryType = Request["type"] == null ? "MeetingRoom" : Request["type"]; BLLJIMP.BLLArticleCategory bllArticleCategory = new BLLJIMP.BLLArticleCategory(); ArticeCategoryTypeResponse bookingConfig = bllArticleCategory.GetTypeConfig(bllArticleCategory.WebsiteOwner, categoryType); indexStr = indexStr.Replace("<title>我的预订</title>", string.Format("<title>{0}</title>", bookingConfig.title)); indexStr = indexStr.Replace("var BookingConfig = {};", string.Format("var BookingConfig = {0};", JsonConvert.SerializeObject(bookingConfig))); #endregion this.Response.Write(indexStr); }