示例#1
0
        public void UserSearchList(
            string filter
            , int pageNumber
            , string mode
            , GlobalTemplateMembers.CommonHeadFootTemplate head
            , UserSearchListTemplate item
            , GlobalTemplateMembers.CommonHeadFootTemplate foot
            , GlobalTemplateMembers.NodataTemplate nodata
            )
        {
            AdminUserFilter searchFilter;

            UserCollection users    = new UserCollection();
            int            rowCount = 0;

            searchFilter = AdminUserFilter.GetFromFilter(filter);


            if (!string.IsNullOrEmpty(mode) &&
                (mode.IndexOf("admin", StringComparison.OrdinalIgnoreCase) >= 0 ||
                 mode.IndexOf("realname", StringComparison.OrdinalIgnoreCase) >= 0))
            {
                if (searchFilter == null)
                {
                    searchFilter = new AdminUserFilter();

                    searchFilter.Order  = UserOrderBy.UserID;
                    searchFilter.IsDesc = true;
                }

                if (searchFilter.FuzzySearch == null)
                {
                    searchFilter.FuzzySearch = true;                                  //默认就是模糊搜索
                }
                users = UserBO.Instance.AdminSearchUsers(My.UserID, searchFilter, pageNumber, out rowCount);
            }
            else
            {
                if (searchFilter == null)
                {
                    return;
                }
            }


            if (rowCount > 0)
            {
                head.Invoke(new GlobalTemplateMembers.CommonHeadFootTemplateParams(rowCount, searchFilter.Pagesize));
                foreach (User user in users)
                {
                    item.Invoke(user);
                }
                foot.Invoke(new GlobalTemplateMembers.CommonHeadFootTemplateParams(rowCount, searchFilter.Pagesize));
            }
            else
            {
                nodata.Invoke();
            }
        }
示例#2
0
        public void InviteSerialStatList(
            string sortBy
            , int pageSize
            , int PageNumber
            , GlobalTemplateMembers.CommonHeadFootTemplate head
            , GlobalTemplateMembers.CommonHeadFootTemplate foot
            , InviteSerialStatTemplate item)
        {
            if (pageSize <= 0)
            {
                pageSize = Consts.DefaultPageSize;
            }

            InviteSerialStatus         orderType = InviteSerialStatus.All;
            InviteSerialStatCollection Stats;


            if (!string.IsNullOrEmpty(sortBy))
            {
                sortBy = sortBy.Trim();
                if (sortBy.Equals("used", StringComparison.OrdinalIgnoreCase))
                {
                    orderType = InviteSerialStatus.Used;
                }
                else if (sortBy.Equals("unused", StringComparison.OrdinalIgnoreCase))
                {
                    orderType = InviteSerialStatus.Unused;
                }
                else if (sortBy.Equals("noreg", StringComparison.OrdinalIgnoreCase))
                {
                    orderType = InviteSerialStatus.Unused;
                }
                else if (sortBy.Equals("expiress", StringComparison.OrdinalIgnoreCase))
                {
                    orderType = InviteSerialStatus.Expires;
                }
            }

            int rowCount;

            Stats = InviteBO.Instance.GetStatList(orderType, pageSize, PageNumber, out rowCount);

            head(new GlobalTemplateMembers.CommonHeadFootTemplateParams(rowCount, pageSize));
            if (rowCount > 0)
            {
                UserBO.Instance.FillSimpleUsers(Stats);
                foreach (InviteSerialStat stat in Stats)
                {
                    item.Invoke(stat);
                }
            }
            foot(new GlobalTemplateMembers.CommonHeadFootTemplateParams(rowCount, pageSize));
        }
示例#3
0
        public void InviteSerialList(
            string filter
            , string mode
            , int pageNumber
            , InviteSerialManagerTemplate listItem
            , GlobalTemplateMembers.CommonHeadFootTemplate foot
            , GlobalTemplateMembers.CommonHeadFootTemplate head
            )
        {
            InviteSerialFilter     searchFilter = InviteSerialFilter.GetFromFilter(filter);
            InviteSerialCollection inviteSerials;

            int rowCount;

            if (searchFilter == null)
            {
                searchFilter = new InviteSerialFilter();
            }
            int?owner = null;

            if (string.IsNullOrEmpty(mode) || !mode.Equals("admin", StringComparison.OrdinalIgnoreCase))
            {
                if (searchFilter.Status == null)
                {
                    searchFilter.Status = InviteSerialStatus.Unused;
                }
                owner = User.CurrentID;
            }

            inviteSerials = InviteBO.Instance.GetInviteSerials(User.Current, owner, searchFilter, pageNumber, out rowCount);

            UserBO.Instance.FillSimpleUsers(inviteSerials, 0);

            head.Invoke(new GlobalTemplateMembers.CommonHeadFootTemplateParams(rowCount, searchFilter.Pagesize));
            foreach (InviteSerial s in inviteSerials)
            {
                listItem.Invoke(s);
            }
            foot.Invoke(new GlobalTemplateMembers.CommonHeadFootTemplateParams(rowCount, searchFilter.Pagesize));
        }