protected void Page_Load(object sender, EventArgs e) { model = bll.Get <PcPage>(string.Format(" WebsiteOwner='{0}' And PageId={1}", bll.WebsiteOwner, Request["pageId"])); #region 菜单列表 string is_system = this.Request["is_system"]; string use_type = this.Request["use_type"]; StringBuilder sbWhere = new StringBuilder(); StringBuilder sbWhere1 = new StringBuilder(); sbWhere.AppendFormat(" WebsiteOwner = '{0}'", bll.WebsiteOwner); sbWhere1.AppendFormat(" WebsiteOwner Is null"); sbWhere.AppendFormat(" And IsPc=1"); sbWhere1.AppendFormat(" And IsPc=1"); if (!string.IsNullOrWhiteSpace(use_type)) { sbWhere.AppendFormat(" And UseType = '{0}'", use_type); sbWhere1.AppendFormat(" And UseType = '{0}'", use_type); } var dataList = bll.GetColList <CompanyWebsite_ToolBar>(int.MaxValue, 1, sbWhere.ToString(), "AutoID,KeyType,BaseID"); if (is_system != "1") { List <CompanyWebsite_ToolBar> dataList1 = bll.GetColList <CompanyWebsite_ToolBar>(int.MaxValue, 1, sbWhere1.ToString(), "AutoID,KeyType"); List <int> nList = dataList.Select(p => p.BaseID).Distinct().ToList(); foreach (CompanyWebsite_ToolBar item in dataList1.Where(p => !nList.Contains(p.AutoID))) { dataList.Add(item); } } MenuList = dataList.OrderBy(p => p.KeyType).Select(p => p.KeyType).Distinct().ToList(); #endregion #region 幻灯片列表 var slideData = bll.GetList <BLLJIMP.Model.Slide>(string.Format("WebsiteOwner='{0}' And IsPC=1 order by Sort DESC", bll.WebsiteOwner)); foreach (var item in slideData) { if (!SlideList.Contains(item.Type)) { SlideList.Add(item.Type); } } slideListJson = ZentCloud.Common.JSONHelper.ObjectToJson(SlideList); #endregion }
public void ProcessRequest(HttpContext context) { context.Response.ContentType = "text/plain"; StringBuilder sbWhere = new StringBuilder(string.Format(" WebSiteOwner='{0}'", bll.WebsiteOwner)); var slideData = bll.GetColList <BLLJIMP.Model.Slide>(int.MaxValue, 1, sbWhere.ToString(), "AutoID,Type"); var result = slideData.Select(p => p.Type).Distinct().OrderBy(p => p); apiResp.code = (int)APIErrCode.IsSuccess; apiResp.status = true; apiResp.result = result; bll.ContextResponse(context, apiResp); }
protected void Page_Load(object sender, EventArgs e) { List <long> groupids = bllPms.GetPmsGroupIDByUser(bll.WebsiteOwner); if (groupids.Count > 0) { webpms_groups = Common.MyStringHelper.ListToStr(groupids, "", ","); } //读取广告 StringBuilder sbWhere = new StringBuilder(string.Format(" WebSiteOwner='{0}'", bll.WebsiteOwner)); var slideData = bll.GetColList <BLLJIMP.Model.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}'", bll.WebsiteOwner); sbWhere.AppendFormat(" AND ComponentType != 'page' "); var componentList = bll.GetColList <BLLJIMP.Model.Component>(int.MaxValue, 1, sbWhere.ToString(), "AutoId,ComponentName,ComponentType"); result = from p in componentList select new { component_id = p.AutoId, component_name = p.ComponentName, component_type = p.ComponentType }; common_components = 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 <BLLJIMP.Model.WXMallCategory> mallCateList = bllMall.GetCategoryList(1, int.MaxValue, null, out total); result = (from p in mallCateList select new { cate_id = p.AutoID, cate_name = p.CategoryName }).Distinct(); mall_cates = JsonConvert.SerializeObject(result); List <BLLJIMP.Model.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); }