Example #1
0
        /// <summary>
        /// 加载角色
        /// </summary>
        void LoadRoles()
        {
            if (AdvicePager.Count < 0)
            {
                AdvicePager.PageIndex = 0;
            }
            AdvicePager.FreshMyself();
            List <Role> roleList = new List <Role>();
            string      siteID   = SiteConfigs.GetConfig().SiteGroupEnabled ? SiteConfigs.GetConfig().SiteID : string.Empty;

            AdvicePager.RecorderCount = AccountHelper.GetRoleCount(siteID, OwnerRank.All);
            roleList = AccountHelper.GetRoles(siteID, AdvicePager.Begin, AdvicePager.PageSize);
            RolesGridView.DataSource = roleList;
            RolesGridView.DataBind();
        }
Example #2
0
        private void Bind()
        {
            string        selectMemberName  = SearchTextBox.Text.Trim();
            string        selectAccountName = AccountTextBox.Text.Trim();
            bool          accountName       = false;
            List <string> ids = new List <string>();

            if (selectAccountName != null && selectAccountName != "")
            {
                Account a = AccountHelper.GetAccountByLoginName(selectAccountName);
                if (a != null)
                {
                    ids.Add(a.ID);
                }
                int i = selectAccountName.IndexOf("管理员");
                if (i >= 0)
                {
                    ids.Add("{00000000-0000-0000-0000-000000000000}");
                }
                accountName = true;
            }

            if (AdvicePager.Count < 0)
            {
                AdvicePager.PageIndex = 0;
            }
            AdvicePager.FreshMyself();
            List <AdviceType> adviceTypeList = new List <AdviceType>();

            AdvicePager.RecorderCount = AdviceTypeHelper.GetAdviceTypeCountByName(selectMemberName, ids, accountName);
            if (AdvicePager.RecorderCount < 1)
            {
                Messages.ShowMessage("您还没有添加任何反馈模型");
                DataGridView.DataSource = adviceTypeList;
                DataGridView.DataBind();
                return;
            }

            adviceTypeList = AdviceTypeHelper.SearchAdviceTypeByName(selectMemberName, ids, accountName, AdvicePager.Begin, AdvicePager.PageSize);
            if (adviceTypeList.Count < 1)
            {
                Messages.ShowMessage("您还没有添加任何反馈模型");
                return;
            }
            DataGridView.DataSource = adviceTypeList;
            DataGridView.DataBind();
        }