Example #1
0
        private List<HttpLinkItem> GetBread(string province, OutDoor outdoor, Company company)
        {
            List<HttpLinkItem> model = new List<HttpLinkItem>();

            HttpLinkItem breaditem = new HttpLinkItem()
            {
                Url = Url.Action("index", "home", new
                {
                    province = province
                })
            };

            model.Add(breaditem);

            breaditem = new HttpLinkItem()
            {
                Url = Url.Action("index", "list", new
                {
                    province = province,
                    mediacode = outdoor.OutDoorMediaCate.PCategory.ID,
                }),
                Name = outdoor.OutDoorMediaCate.PCategory.CateName
            };

            model.Add(breaditem);

            breaditem = new HttpLinkItem()
            {
                Url = Url.Action("index", "list", new
                {
                    province = province,
                    mediacode = outdoor.OutDoorMediaCate.PCategory.ID,
                    childmediacode = outdoor.OutDoorMediaCate.ID

                }),
                Name = outdoor.OutDoorMediaCate.CateName
            };

            model.Add(breaditem);

            breaditem = new HttpLinkItem()
            {
                Url = Url.Action("index", "shop", new
                {
                    id = company.MemberID
                }),
                Name = company.Name
            };

            model.Add(breaditem);

            breaditem = new HttpLinkItem()
               {
               Name = outdoor.Name
               };

            model.Add(breaditem);
            return model;
        }
Example #2
0
        public List<HttpLinkGroup> GetProvinceList(int province)
        {
            List<HttpLinkGroup> result = new List<HttpLinkGroup>();

            HttpLinkGroup quanguo = new HttpLinkGroup()
            {
                Group = new HttpLinkItem()
                {
                    Name = "全国"
                }
            };

            HttpLinkItem quanguoLink = new HttpLinkItem()
            {
                Name = "全国",
                ProvinceName = ProvinceName.quanguo.ToString()
            };

            quanguo.Items.Add(quanguoLink);

            result.Add(quanguo);

            var provinceList = UIHelper.ProvinceList.Where(x => x.Value != "quanguo").OrderBy(x => x.Value).ToList();

            foreach (var item in provinceList)
            {
                var prefix = item.Value.Substring(0, 1).ToUpper();

                var groupItem = result.SingleOrDefault(x => x.Group.Name == prefix);

                if (groupItem == null)
                {
                    groupItem = new HttpLinkGroup()
                    {
                        Group = new HttpLinkItem()
                        {
                            Name = item.Value.Substring(0, 1).ToUpper()
                        }
                    };
                    result.Add(groupItem);
                }

                HttpLinkItem itemLink = new HttpLinkItem()
                {
                    Name = item.Text,
                    ProvinceName = item.Value
                };
                groupItem.Items.Add(itemLink);
            }
            return result;
        }
Example #3
0
        private List<HttpLinkItem> GetBread(List<HttpLinkGroup> menu, ListSearchItemViewModel search)
        {
            List<HttpLinkItem> model = new List<HttpLinkItem>();

            HttpLinkItem home = new HttpLinkItem()
            {
                Url = Url.Action("index", "home", new
                {
                    province = search.Province
                })
            };
            model.Add(home);

            foreach (var item in menu)
            {
                if (item.Group.Selected)
                {
                    model.Add(new HttpLinkItem()
                    {
                        Name = item.Group.Name,
                        Url = Url.Action("index", "list", new
                        {
                            province = search.Province,
                            city = search.City,
                            mediacode = item.Group.ID
                        })
                    });

                    foreach (var childitem in item.Items)
                    {
                        if (childitem.Selected)
                        {
                            model.Add(new HttpLinkItem()
                            {
                                Name = childitem.Name,
                                Url = Url.Action("index", "list", new
                                {
                                    province = search.Province,
                                    city = search.City,
                                    mediacode = item.Group.ID,
                                    childmediacode = childitem.ID
                                })
                            });
                        }
                    }
                }
            }
            return model;
        }
Example #4
0
        /// <summary>
        /// 获取分类导航菜单数据
        /// </summary>
        /// <returns></returns>
        public List<HttpLinkGroup> GetLeftMenu(int province)
        {
            List<HttpLinkGroup> result = new List<HttpLinkGroup>();

            var category = outDoorMediaCateService.IncludeGetALL().ToList();

            foreach (var item in category)
            {
                HttpLinkGroup groupItem = new HttpLinkGroup();

                HttpLinkItem groupLink = new HttpLinkItem()
                {
                    ID = item.ID,
                    Name = item.CateName,
                    Province = province
                };

                groupItem.Group = groupLink;

                List<HttpLinkItem> items = item.ChildCategoies.Select(x => new HttpLinkItem
                {
                    ID = x.ID,
                    Name = x.CateName,
                    Province = province,
                    PCategoryCode = groupLink.ID,
                    CategoryCode = x.ID

                }).ToList();

                groupItem.Items = items;
                result.Add(groupItem);
            }

            return result;
        }