Esempio n. 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            int Tcount = 0;
            List <ArticleCategory> cates = bllArticleCategory.GetCateList(out Tcount, "OpenClass", 86, bllJuActivity.WebsiteOwner);

            sbCategory.Append(new MySpider.MyCategories().GetSelectOptionHtml(cates, "AutoID", "PreID", "CategoryName", 86, "ddlcategory", "width:200px", ""));
        }
Esempio n. 2
0
        /// <summary>
        /// 社区列表
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        private string getStatusesList(HttpContext context)
        {
            int page     = Convert.ToInt32(context.Request["page"]),
                rows     = Convert.ToInt32(context.Request["rows"]);
            string type  = "Community";
            int    preId = int.Parse(context.Request["preId"]);

            if (page == 0)
            {
                page = 1;
            }
            if (rows == 0)
            {
                rows = int.MaxValue;
            }
            int totalCount = 0;
            var dataList   = bllArticleCategory.GetCateList(out totalCount, type, preId, bll.WebsiteOwner, rows, page);
            var data       = from p in dataList
                             select new
            {
                AutoID       = p.AutoID,
                CategoryName = p.CategoryName,
                type         = p.CategoryName,
                Summary      = p.Summary,
                Sort         = p.Sort,
                actNum       = bll.GetJuActivityCount("Statuses", p.AutoID.ToString(), null, true),
                ImgSrc       = p.ImgSrc
            };

            return(Common.JSONHelper.ObjectToJson(new {
                rows = data,
                total = totalCount
            }));
        }
Esempio n. 3
0
        public void ProcessRequest(HttpContext context)
        {
            string type = context.Request["type"];

            if (string.IsNullOrWhiteSpace(type))
            {
                type = "Article";
            }
            string websiteowner = context.Request["websiteowner"];

            if (string.IsNullOrWhiteSpace(websiteowner))
            {
                websiteowner = bll.WebsiteOwner;
            }
            int totalCount = 0;
            List <BLLJIMP.Model.ArticleCategory> categoryData = bll.GetCateList(out totalCount, type, 0, websiteowner, int.MaxValue, 1, null);

            List <MyCategoryV2Model> myCategoryModel = myCategories.GetCommCateModelList("AutoID", "PreID", "CategoryName", categoryData);
            List <ListItem>          list            = myCategories.GetCateListItem(myCategoryModel, "0");

            apiResp.result = from p in list
                             select new
            {
                value = p.Value,
                text  = p.Text
            };
            apiResp.status = true;
            apiResp.code   = (int)APIErrCode.IsSuccess;
            bll.ContextResponse(context, apiResp);
        }
Esempio n. 4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            int id = Convert.ToInt32(Request["id"]);

            if (id == 0)
            {
                model.JuActivityID = 0;
            }
            else
            {
                model = bllJuActivity.GetJuActivity(id);
            }
            int Tcount = 0;
            List <ArticleCategory> cates = bllArticleCategory.GetCateList(out Tcount, null, 80, bllJuActivity.WebsiteOwner);

            sbCategory.Append(new MySpider.MyCategories().GetSelectOptionHtml(cates, "AutoID", "PreID", "CategoryName", 80, "ddlcategory", "width:200px", model.CategoryId));
        }
Esempio n. 5
0
        public void ProcessRequest(HttpContext context)
        {
            int    rows    = Convert.ToInt32(context.Request["rows"]);
            int    page    = Convert.ToInt32(context.Request["page"]);
            string keyword = context.Request["keyword"];
            string cate    = context.Request["cate"];
            int    total   = 0;
            List <ComponentTemplate> componentTemplate = bll.GetTemplateList(rows, page, keyword, out total, cate);

            int cateTotal = 0;
            List <ArticleCategory> cateList = bllCate.GetCateList(out cateTotal, "CompTempType", 0, "Common", int.MaxValue, 1, null);

            List <dynamic> resultList = new List <dynamic>();

            foreach (var item in componentTemplate)
            {
                ArticleCategory nCate = cateList.FirstOrDefault(p => p.AutoID == item.CateId);
                resultList.Add(new
                {
                    id        = item.AutoId,
                    name      = item.Name,
                    img       = item.ThumbnailsPath,
                    sort      = item.Sort,
                    web       = item.FromWebsite,
                    cate      = item.CateId,
                    cate_name = nCate == null ? "" : nCate.CategoryName
                });
            }

            apiResp.status = true;
            apiResp.result = new
            {
                totalcount = total,
                list       = resultList
            };
            apiResp.msg  = "获取模板列表成功";
            apiResp.code = (int)APIErrCode.IsSuccess;
            bll.ContextResponse(context, apiResp);
        }
Esempio n. 6
0
        /// <summary>
        /// 类型列表
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        private string getTypeList(HttpContext context)
        {
            int page     = Convert.ToInt32(context.Request["page"]),
                rows     = Convert.ToInt32(context.Request["rows"]);
            string type  = "OpenClass";
            int    preId = int.Parse(context.Request["preId"]);

            if (page == 0)
            {
                page = 1;
            }
            if (rows == 0)
            {
                rows = int.MaxValue;
            }
            int totalCount = 0;
            var dataList   = bllArticleCategory.GetCateList(out totalCount, type, preId, bll.WebsiteOwner, rows, page);

            return(Common.JSONHelper.ObjectToJson(new {
                rows = dataList,
                total = totalCount
            }));
        }
Esempio n. 7
0
        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);
        }