/// <summary> /// 设计标签 /// </summary> /// #region 用户标签管理 /// <summary> /// 查询用户标签管理 /// </summary> /// <param name="context"></param> /// <returns></returns> private string QueryTag(HttpContext context) { int pageIndex = Convert.ToInt32(context.Request["page"]); int pageSize = Convert.ToInt32(context.Request["rows"]); string tagName = context.Request["TagName"], tagType = context.Request["TagType"]; int totalCount = 0; List <MemberTag> dataList = bllTag.GetTags(bllTag.WebsiteOwner, tagName, pageIndex, pageSize, out totalCount, tagType); return(Common.JSONHelper.ObjectToJson( new { total = totalCount, rows = dataList })); }
public void ProcessRequest(HttpContext context) { int pageIndex = Convert.ToInt32(context.Request["page"]); int pageSize = Convert.ToInt32(context.Request["rows"]); string tagName = context.Request["name"], tagType = context.Request["type"]; int totalCount = 0; List <BLLJIMP.Model.MemberTag> data = bllTag.GetTags(bllTag.WebsiteOwner, tagName, pageIndex, pageSize, out totalCount, tagType); resp.isSuccess = true; resp.returnObj = new { totalcount = totalCount, list = (from p in data select new { id = p.AutoId, name = p.TagName, type = p.TagType, level = p.AccessLevel }) }; bllTag.ContextResponse(context, resp); }
private void GetInitSelect() { //读取广告 StringBuilder sbWhere = new StringBuilder(string.Format(" WebSiteOwner='{0}'", bll.WebsiteOwner)); var slideData = bll.GetColList <Slide>(int.MaxValue, 1, sbWhere.ToString(), "AutoID,Type"); dynamic result = slideData.Select(p => p.Type).Distinct().OrderBy(p => p); slides = JsonConvert.SerializeObject(result); //读取底部工具栏 sbWhere = new StringBuilder(); sbWhere.AppendFormat(" WebsiteOwner='{0}' OR WebsiteOwner Is Null ", bll.WebsiteOwner); List <CompanyWebsite_ToolBar> dataList = bll.GetColList <CompanyWebsite_ToolBar>(int.MaxValue, 1, sbWhere.ToString(), "AutoID,KeyType,UseType"); result = (from p in dataList select new { key_type = p.KeyType, use_type = p.UseType }).Distinct(); toolbars = JsonConvert.SerializeObject(result); int total = 0; //读取商品分类 List <WXMallCategory> mallCateList = bllMall.GetCategoryList(1, int.MaxValue, null, out total); List <ListItem> mallCateItemList = new List <ListItem>(); if (mallCateList.Count > 0) { mallCateItemList = bllMyCategories.GetCateListItem(bllMyCategories.GetCommCateModelList("AutoID", "PreID", "CategoryName", mallCateList), 0); } result = (from p in mallCateItemList select new { cate_id = p.Value, cate_name = p.Text, pre_id = p.Attributes["PreID"].ToString() }).Distinct(); mall_cates = JsonConvert.SerializeObject(result); //读取课程分类 List <WXMallCategory> courseCateList = bllMall.GetCategoryList(1, int.MaxValue, null, out total, type: "Course"); List <ListItem> courseCateItemList = new List <ListItem>(); if (courseCateList.Count > 0) { courseCateItemList = bllMyCategories.GetCateListItem(bllMyCategories.GetCommCateModelList("AutoID", "PreID", "CategoryName", courseCateList), 0); } result = (from p in courseCateItemList select new { cate_id = p.Value, cate_name = p.Text, pre_id = p.Attributes["PreID"].ToString() }).Distinct(); course_cates = JsonConvert.SerializeObject(result); //读取商品标签 List <MemberTag> tagList = bllTag.GetTags(bllTag.WebsiteOwner, null, 1, int.MaxValue, out total, "Mall"); result = tagList.OrderBy(p => p.TagName).Select(p => p.TagName).Distinct(); mall_tags = JsonConvert.SerializeObject(result); //读取文章分类 List <ArticleCategory> artCateList = bllArticleCategory.GetCateList(out total, "Article", null, bllArticleCategory.WebsiteOwner, int.MaxValue, 1); List <ListItem> artCateItemList = new List <ListItem>(); if (artCateList.Count > 0) { artCateItemList = bllMyCategories.GetCateListItem(bllMyCategories.GetCommCateModelList("AutoID", "PreID", "CategoryName", artCateList), 0); } result = (from p in artCateItemList select new { cate_id = p.Value, cate_name = p.Text }).Distinct(); art_cates = JsonConvert.SerializeObject(result); //读取活动分类 List <ArticleCategory> actCateList = bllArticleCategory.GetCateList(out total, "Activity", null, bllArticleCategory.WebsiteOwner, int.MaxValue, 1); List <ListItem> actCateItemList = new List <ListItem>(); if (actCateList.Count > 0) { actCateItemList = bllMyCategories.GetCateListItem(bllMyCategories.GetCommCateModelList("AutoID", "PreID", "CategoryName", actCateList), 0); } result = (from p in actCateItemList select new { cate_id = p.Value, cate_name = p.Text }).Distinct(); act_cates = JsonConvert.SerializeObject(result); List <ArticleCategory> tempCateList = bllArticleCategory.GetCateList(out total, "CompTempType", 0, "Common", int.MaxValue, 1, null); result = (from p in tempCateList select new { value = p.AutoID, text = p.CategoryName }).Distinct(); template_types = JsonConvert.SerializeObject(result); }