コード例 #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (Request.QueryString["groupId"] == null)
                {
                    throw new Exception("您访问的页面不存在");
                }

                int GroupId = 0;

                if (!int.TryParse(Request.QueryString["groupId"].ToString(), out GroupId))
                {
                    throw new Exception("您访问的页面不存在");
                }

                group = CY.UME.Core.Business.Group.Load(GroupId);

                if (group == null)
                {
                    throw new Exception("您访问的页面不存在");
                }

                int pageSize = 30;

                CY.UME.Core.PagingInfo pageInfo = new CY.UME.Core.PagingInfo();

                pageInfo.CurrentPage = 1;
                pageInfo.PageSize = pageSize;

                CY.UME.Core.Business.AccountGroup ag = new CY.UME.Core.Business.AccountGroup();

                managerList = ag.GetAccountGroupByGroupIdAndRoleAndAccountId(group, -1, 1, null, new CY.UME.Core.PagingInfo {CurrentPage=1,PageSize=int.MaxValue });
                memberList = ag.GetAccountGroupByGroupIdAndRoleAndAccountId(group, -1,0, null, pageInfo);
                Count = ag.GetAccountCountByRole(group, 0).ToString();

                uc_GroupInfo.group = group;
                uc_NewestTopices.group = group;

                gm_HiddenGroupId.Value = GroupId.ToString();
                gm_HiddenPageSize.Value = pageSize.ToString();
                gm_HiddenTotalRecords.Value = Count;
                gm_HiddenSiteUrl.Value = SiteUrl;

                SetTitle(group.Name + "的成员列表");
            }
        }
コード例 #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                int groupId = 0;
                int role = 0;

                if (Request.QueryString["groupId"] == null || Request.QueryString["role"] == null)
                {
                    throw new Exception("您所访问的页面不存在");
                }
                if (!int.TryParse(Request.QueryString["groupId"].ToString(), out groupId) || !int.TryParse(Request.QueryString["role"].ToString(), out role))
                {
                    throw new Exception("您所访问的页面不存在");
                }

                CY.UME.Core.Business.Group group = CY.UME.Core.Business.Group.Load(groupId);

                if (group == null)
                {
                    throw new Exception("您所访问的页面不存在");
                }

                int pageSize = 10;

                CY.UME.Core.PagingInfo pageInfo = new CY.UME.Core.PagingInfo();

                pageInfo.CurrentPage = 1;
                pageInfo.PageSize = pageSize;

                CY.UME.Core.Business.AccountGroup ag = new CY.UME.Core.Business.AccountGroup();

                accountList = ag.GetAccountGroupByGroupIdAndRoleAndAccountId(group, -1 , -1, null, pageInfo);
                string Count = ag.GetAccountCountByRole(group, role).ToString();

                gml_HiddenGroupId.Value = groupId.ToString();
                gml_HiddenPageSize.Value = pageSize.ToString();
                gml_HiddenTotalRecords.Value = Count;
                gml_HiddenRole.Value = role.ToString();

                LblSearchNum.Text = "共" + Count + "个成员";
                LitTitle.Text = "群组成员";

                SetTitle("群组成员");
            }
        }
コード例 #3
0
        protected void BindData(CY.UME.Core.Business.Group group)
        {
            int role = 0, pageSize = 30, pageNum = 1;

            if (!int.TryParse(DDLRole.SelectedValue, out role))
            {
                throw new Exception("参数错误");
            }

            CY.UME.Core.PagingInfo pageInfo = new CY.UME.Core.PagingInfo();
            pageInfo.PageSize = pageSize;
            pageInfo.CurrentPage = pageNum;

            CY.UME.Core.Business.AccountGroup ag = new CY.UME.Core.Business.AccountGroup();
            agList = ag.GetAccountGroupByGroupIdAndRoleAndAccountId(group,-1, role, null, pageInfo);

            foreach (CY.UME.Core.Business.AccountGroup agroup in agList)
            {
                if (agroup.AccountId == CurrentAccount.Id)
                {
                    agList.Remove(agroup);

                    break;
                }
            }

            int Count = ag.GetAccountCountByRole(group, role);

            if (Count > pageSize)
            {
                IsDisPaged = true;
            }

            OperationDDL_Bind(DDLRole.SelectedValue);

            mm_HiddenPageSize.Value = pageSize.ToString();
            mm_HiddenSiteUrl.Value = SiteUrl;
            mm_HiddenRecordCount.Value = Count.ToString();
            mm_HiddenGroupId.Value = group.Id.ToString();
        }