Exemplo n.º 1
0
        /// <summary>
        /// 加载数据
        /// </summary>
        private void LoadData()
        {
            StringBuilder strWhere = new StringBuilder();

            strWhere.AppendFormat("UserID = '{0}'", this.bllMember.UserID);

            //构造筛选条件
            if (this.wucMemberGroup.SelectValue.Count > 0)
            {
                strWhere.AppendFormat("AND GroupID IN ({0})", Common.StringHelper.ListToStr <string>(this.wucMemberGroup.SelectValue, "'", ","));
            }

            this.ViewState["strWhere"] = strWhere;

            //设置总数
            this.AspNetPager1.RecordCount = bllMember.GetCount <MemberInfo>(strWhere.ToString());

            this.grvData.DataSource = bllMember.GetLit <MemberInfo>(this.AspNetPager1.PageSize, this.AspNetPager1.CurrentPageIndex, strWhere.ToString());
            this.grvData.DataBind();

            //设置分页显示
            this.AspNetPager1.CustomInfoHTML = string.Format("当前第{0}/{1}页 共{2}条记录 每页{3}条", this.AspNetPager1.CurrentPageIndex, this.AspNetPager1.PageCount, this.AspNetPager1.RecordCount, this.AspNetPager1.PageSize);

            //加载分组
            this.ddlGroup.Items.Clear();
            this.ddlGroup.Items.Add(new ListItem("无分组", "0"));
            foreach (ZentCloud.BLLJIMP.Model.MemberGroupInfo item in bllMember.GetList <ZentCloud.BLLJIMP.Model.MemberGroupInfo>(string.Format(" UserID = '{0}' AND GroupType = 1 ", Comm.DataLoadTool.GetCurrUserID())))
            {
                this.ddlGroup.Items.Add(new ListItem(item.GroupName, item.GroupID.ToString()));
            }
        }