示例#1
0
        /// <summary>
        /// 获取门店类型列表
        /// </summary>
        public string GetCityTypeListData()
        {
            var service = new TagsBLL(new SessionManager().CurrentUserLoginInfo);
            //IList<TagsEntity> data = new List<TagsEntity>();
            string content = string.Empty;

            string key     = string.Empty;
            var    orderBy = new OrderBy[] {
                new OrderBy {
                    FieldName = "TagsName", Direction = OrderByDirections.Asc
                }
            };
            var data = service.QueryByEntity(new TagsEntity()
            {
                CustomerId = this.CurrentUserInfo.CurrentUser.customer_id
            }, orderBy);

            var jsonData = new JsonData();

            jsonData.totalCount = data.Length.ToString();
            jsonData.data       = data;

            content = jsonData.ToJSON();
            return(content);
        }
示例#2
0
        protected override GetTagsByTypeNameRD ProcessRequest(DTO.Base.APIRequest <GetTagsByTypeNameRP> pRequest)
        {
            var rd   = new GetTagsByTypeNameRD();
            var para = pRequest.Parameters;
            var loggingSessionInfo = new SessionManager().CurrentUserLoginInfo; //登录状态信息
            var tagsTypeBLL        = new TagsTypeBLL(loggingSessionInfo);       //标签分类业务对象实例化
            var tagsBLL            = new TagsBLL(loggingSessionInfo);           //标签业务对象实例化

            //获取标签类型对象
            var tagsTypeEntity = tagsTypeBLL.QueryByEntity(new TagsTypeEntity()
            {
                TypeName = para.TypeName
            }, null).FirstOrDefault();

            if (tagsTypeEntity != null)
            {
                //排序字段
                var orderBy = new OrderBy[] { new OrderBy()
                                              {
                                                  FieldName = "CreateTime", Direction = OrderByDirections.Asc
                                              } };
                //获取标签列表
                var tagsList = tagsBLL.QueryByEntity(new TagsEntity()
                {
                    TypeId = tagsTypeEntity.TypeId
                }, orderBy);
                //返回数据转换
                rd.TagsList = tagsList.Select(t => new TagsInfo()
                {
                    TagsID = t.TagsId, TagsName = t.TagsName
                }).ToList();
            }
            return(rd);
        }