Exemple #1
0
        /// <summary>
        /// 获取分类信息
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        private string List(HttpContext context)
        {
            string parentId   = context.Request["parentid"];//上级分类id
            int    pageIndex  = !string.IsNullOrEmpty(context.Request["pageindex"]) ? int.Parse(context.Request["pageindex"]) : 1;
            int    pageSize   = !string.IsNullOrEmpty(context.Request["pagesize"]) ? int.Parse(context.Request["pagesize"]) : 10;
            int    totalCount = 0;
            var    sourceData = bllMall.GetCategoryList(pageIndex, pageSize, parentId, out totalCount);

            var list = from p in sourceData
                       select new
            {
                category_id   = p.AutoID,
                category_name = p.CategoryName,
                pre_id        = p.PreID,
                description   = p.Description,
                img_url       = p.CategoryImg,
                sort          = p.Sort,
                min_price     = p.MinPrice,
                max_price     = p.MaxPrice
                                //category_subcount = bllMall.GetCount<ZentCloud.BLLJIMP.Model.WXMallCategory>(string.Format(" PreID={0}", p.AutoID))// 直接子分类数量
            };

            //构造另外一个二级列表,并获取前6个的价格范围
            List <dynamic> levelList = new List <dynamic>();

            foreach (var item in sourceData.Where(sData => sData.PreID == 0))
            {
                levelList.Add(new {
                    category_id   = item.AutoID,
                    category_name = item.CategoryName,
                    pre_id        = item.PreID,
                    description   = item.Description,
                    img_url       = item.CategoryImg,
                    sort          = item.Sort,
                    min_price     = item.MinPrice,
                    max_price     = item.MaxPrice,
                    sub_list      = sourceData.Where(sbData => sbData.PreID == item.AutoID).Select(outSbData => new {
                        category_id   = outSbData.AutoID,
                        category_name = outSbData.CategoryName,
                        pre_id        = outSbData.PreID,
                        description   = outSbData.Description,
                        img_url       = outSbData.CategoryImg,
                        sort          = outSbData.Sort,
                        min_price     = outSbData.MinPrice,
                        max_price     = outSbData.MaxPrice,
                    })
                });
            }

            var data = new
            {
                totalcount = totalCount,
                list       = list,//列表
                level_list = levelList
            };

            return(ZentCloud.Common.JSONHelper.ObjectToJson(data));
        }
Exemple #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string type = Request["type"];

            if (!string.IsNullOrEmpty(type))
            {
                //BookingDoctorFuYou //医生预约妇幼
                sbCategory.Append(new MySpider.MyCategories().GetSelectOptionHtml(bll.GetCategoryList().Where(p => p.Type.Equals(type)).ToList(), "AutoID", "PreID", "CategoryName", 0, "ddlCategory", "width:200px", "", "", "全部"));
            }
            else
            {
                //BookingDoctor 医生预约
                sbCategory.Append(new MySpider.MyCategories().GetSelectOptionHtml(bll.GetCategoryList().Where(p => p.Type == "BookingDoctor").ToList(), "AutoID", "PreID", "CategoryName", 0, "ddlCategory", "width:200px", "", "", "全部"));
            }
        }
Exemple #3
0
        public void ProcessRequest(HttpContext context)
        {
            int    pageIndex = !string.IsNullOrEmpty(context.Request["pageindex"]) ? int.Parse(context.Request["pageindex"]) : 1;
            int    pageSize  = !string.IsNullOrEmpty(context.Request["pagesize"]) ? int.Parse(context.Request["pagesize"]) : 10;
            string type      = context.Request["type"];
            string preIds    = context.Request["pre_ids"];
            string keyWord   = context.Request["keyword"];

            System.Text.StringBuilder sbWhere = new System.Text.StringBuilder(string.Format(" WebSiteOwner='{0}'", bllMall.WebsiteOwner));
            int totalCount       = 0;
            var mallCategoryData = bllMall.GetCategoryList(pageIndex, pageSize, "", out totalCount, type);//bllMall.GetLit<ZentCloud.BLLJIMP.Model.WXMallCategory>(pageSize, pageIndex, sbWhere.ToString());
            var list             = from p in mallCategoryData
                                   select new
            {
                category_id          = p.AutoID,
                category_name        = p.CategoryName,
                category_description = p.Description,
                category_img_url     = p.CategoryImg,
                category_parent_id   = p.PreID,
                sort = p.Sort,
                type = p.Type
            };
            var data = new
            {
                totalcount = totalCount,
                list       = list//列表
            };

            context.Response.Write(ZentCloud.Common.JSONHelper.ObjectToJson(data));
        }
Exemple #4
0
        //public System.Text.StringBuilder sbStores = new System.Text.StringBuilder();
        protected void Page_Load(object sender, EventArgs e)
        {
            foreach (var item in bll.GetCategoryList())
            {
                sbCategory.AppendFormat("<option value=\"{0}\">{1}</option>", item.AutoID, item.CategoryName);
            }
            //foreach (var item in bll.GetWXMallStoreListByWebSite())
            //{
            //    sbStores.AppendFormat("<option value=\"{0}\">{1}</option>", item.AutoID, item.StoreName);

            //}
        }
Exemple #5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            config = bllWebSite.GetCompanyWebsiteConfig();
            if (config == null)
            {
                config = new CompanyWebsite_Config();
                config.WebsiteTitle       = "膏方专家预约平台";
                config.WebsiteDescription = "膏方专家预约平台";
            }



            if (string.IsNullOrEmpty(Request["id"]))
            {
                Response.Write("id 参数必传");
                Response.End();
            }
            model = bllMall.GetProduct(Request["id"]);
            if (model == null)
            {
                Response.Write("id 参数错误");
                Response.End();
            }
            config.WebsiteTitle = string.Format("中医专家-{0}-膏方预约平台已开通!", model.PName);
            if (model.IsOnSale == "0")
            {
                config.WebsiteTitle = string.Format("中医专家-{0}-膏方预约平台即将开通!", model.PName);
            }

            StringBuilder sbWhere = new StringBuilder();

            sbWhere.AppendFormat("  WebsiteOwner='{0}' And TableName ='ZCJ_WXMallOrderInfo' Order by Sort DESC", bllMall.WebsiteOwner);
            fieldList = bllMall.GetList <TableFieldMapping>(sbWhere.ToString());

            categoryList = bllMall.GetCategoryList().Where(p => p.PreID == 0).Where(p => p.Type == "BookingDoctorFuYou").ToList();

            if (!string.IsNullOrEmpty(model.CategoryId))
            {
                categoryId = model.CategoryId;
                WXMallCategory category = bllMall.Get <WXMallCategory>(string.Format(" AutoID={0}", model.CategoryId));
                if (category != null)
                {
                    if (category.PreID > 0)
                    {
                        categoryId = bllMall.Get <WXMallCategory>(string.Format(" AutoID={0}", category.PreID)).AutoID.ToString();
                    }
                }
            }
        }
Exemple #6
0
        //public System.Text.StringBuilder sbStores = new System.Text.StringBuilder();
        protected void Page_Load(object sender, EventArgs e)
        {
            //foreach (var item in bll.GetWXMallCategoryListByWebsite())
            //{
            //    sbCategory.AppendFormat("<option value=\"{0}\">{1}</option>", item.AutoID, item.CategoryName);

            //}

            sbCategory.Append(new MySpider.MyCategories().GetSelectOptionHtml(bll.GetCategoryList(), "AutoID", "PreID", "CategoryName", 0, "ddlcategory", "width:200px", ""));

            //foreach (var item in bll.GetWXMallStoreListByWebSite())
            //{
            //    sbStores.AppendFormat("<option value=\"{0}\">{1}</option>", item.AutoID, item.StoreName);

            //}
        }
Exemple #7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //foreach (var item in bll.GetWXMallStoreListByWebSite())
            //{
            //    sbStores.AppendFormat("<option  value=\"{0}\" >{1}</option>",item.AutoID,item.StoreName);

            //}
            OrderStatusList = bllMall.GetOrderStatuList();
            foreach (var item in OrderStatusList)
            {
                sbOrderStatuList.AppendFormat("<option  value=\"{0}\" >{1}</option>", item.OrderStatu, item.OrderStatu);
            }
            foreach (var item in bllMall.GetCategoryList())
            {
                sbCategory.AppendFormat("<option value=\"{0}\">{1}</option>", item.AutoID, item.CategoryName);
            }
            if (bllMall.GetWebsiteInfoModel().IsDistributionMall == 1)
            {
                IsDistributionMall = true;
            }
        }
Exemple #8
0
        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, "", ",");
            }
            string key = this.Request["key"];

            BLLJIMP.Model.Component nComponent = bll.GetComponentByKey(key, bll.WebsiteOwner);
            if (nComponent == null)
            {
                Common.WebMessageBox.Show(this, "组件未找到");
                return;
            }
            keyname = bll.GetComponentNameByKey(key);
            ComponentModel componentModel = bll.GetByKey <ComponentModel>("AutoId", nComponent.ComponentModelId.ToString());

            if (componentModel == null)
            {
                Common.WebMessageBox.Show(this, "模板未找到");
                return;
            }
            List <ComponentModelField> componentModelFields = bll.GetListByKey <ComponentModelField>("ComponentModelKey", componentModel.ComponentModelKey)
                                                              .OrderBy(p => p.ComponentFieldSort).ToList();
            dynamic cModel = new
            {
                component_model_id       = componentModel.AutoId,
                component_model_name     = componentModel.ComponentModelName,
                component_model_type     = componentModel.ComponentModelType,
                component_model_link_url = componentModel.ComponentModelLinkUrl,
                component_model_html_url = componentModel.ComponentModelHtmlUrl,
                component_model_fields   = (from p in componentModelFields
                                            select new
                {
                    component_field_id = p.AutoId,
                    component_field = p.ComponentField,
                    component_field_name = p.ComponentFieldName,
                    component_field_type = p.ComponentFieldType,
                    component_field_data_type = p.ComponentFieldType,
                    component_field_data_value = p.ComponentFieldDataValue
                })
            };

            component       = JsonConvert.SerializeObject(nComponent);
            component_model = JsonConvert.SerializeObject(cModel);


            //读取广告
            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);


            WebsiteInfo model = bllWeisite.GetWebsiteInfo();

            if (model != null && !string.IsNullOrEmpty(model.WeiXinBindDomain))
            {
                strDomain = model.WeiXinBindDomain;
            }
        }
Exemple #9
0
        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);
        }