public ActionResult Management()
        {
            var pageModel = _iMemberLabelService.GetMemberLabelList(new LabelQuery()
            {
            });

            ViewBag.LabelInfos = pageModel.Models.ToList();
            var grades = MemberGradeApplication.GetMemberGradeList();

            return(View(grades));
        }
Esempio n. 2
0
        public ActionResult Management(long?labelId = null)
        {
            var pageModel = _iMemberLabelService.GetMemberLabelList(new LabelQuery()
            {
                PageSize = 100
            });

            ViewBag.LabelInfos = pageModel.Models.ToList();
            ViewBag.labelId    = labelId;
            var grades = MemberGradeApplication.GetMemberGrades();

            return(View(grades));
        }
Esempio n. 3
0
        public JsonResult List(int page, string keywords, int rows)
        {
            IMemberLabelService memberLabelService = this._iMemberLabelService;
            LabelQuery          labelQuery         = new LabelQuery()
            {
                LabelName = keywords,
                PageSize  = rows,
                PageNo    = page
            };
            PageModel <LabelInfo>    memberLabelList = memberLabelService.GetMemberLabelList(labelQuery);
            IEnumerable <LabelModel> list            =
                from item in memberLabelList.Models.ToList <LabelInfo>()
                select new LabelModel()
            {
                MemberNum = (long)this._iMemberService.GetMembersByLabel(item.Id).Count <MemberLabelInfo>(),
                LabelName = item.LabelName,
                Id        = item.Id
            };
            DataGridModel <LabelModel> dataGridModel = new DataGridModel <LabelModel>()
            {
                rows  = list,
                total = memberLabelList.Total
            };

            return(base.Json(dataGridModel));
        }
Esempio n. 4
0
        /// <summary>
        /// 查询某个会员标签列表
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public static QueryPageModel <LabelModel> GetMemberLabelList(long userId)
        {
            var membLabels = MemberApplication.GetMemberLabels(userId);
            var pageModel  = new QueryPageModel <LabelModel>();

            if (membLabels.Count() > 0)
            {
                var ids            = membLabels.Select(e => e.LabelId);
                var labelPageModel = _iMemberLabelService.GetMemberLabelList(new LabelQuery()
                {
                    LabelIds = ids
                });
                pageModel.Models = labelPageModel.Models.Select(e => new LabelModel {
                    LabelName = e.LabelName, Id = e.Id
                }).ToList();
                pageModel.Total = labelPageModel.Total;
            }
            return(pageModel);
        }
        public ActionResult WXGroupMessage()
        {
            var pageModel = _iMemberLabelService.GetMemberLabelList(new LabelQuery()
            {
            });

            ViewBag.LabelInfos = pageModel.Models.ToList();
            //var topregion = _iMemberService.GetAllTopRegion().Select(e => new SelectListItem
            //{
            //    Text = _iRegionService.GetRegion(e).Name,
            //    Value = e.ToString()
            //}).Where(e => !string.IsNullOrWhiteSpace(e.Text)).ToList();
            //topregion.Insert(0, new SelectListItem { Value = "-1", Text = "全部" });

            var topregion = MemberApplication.GetAllTopRegion().Select(e =>
            {
                var region       = RegionApplication.GetRegion(e);
                string shortName = "";
                if (region != null && region.Level == Region.RegionLevel.Province)
                {
                    shortName = region.ShortName;
                }
                return(new SelectListItem
                {
                    Text = shortName,
                    Value = e.ToString()
                });
            }).Where(e => !string.IsNullOrWhiteSpace(e.Text)).ToList();

            topregion.Insert(0, new SelectListItem {
                Value = "-1", Text = "全部"
            });

            ViewBag.Regions = topregion;
            return(View());
        }
Esempio n. 6
0
        public JsonResult List(int page, string keywords, int rows)
        {
            var result = _iMemberLabelService.GetMemberLabelList(new LabelQuery {
                LabelName = keywords, PageSize = rows, PageNo = page
            });
            var labels = result.Models.ToList().Select(item => new LabelModel()
            {
                MemberNum = _iMemberService.GetMembersByLabel(item.Id).Count(),
                LabelName = item.LabelName,
                Id        = item.Id
            });

            return(Json(new { rows = labels.ToList(), total = result.Total }));
            //var model = new DataGridModel<LabelModel>() { rows = labels, total = result.Total };
            //return Json(model);
        }