public void AddUserRoleTest()
        {
            //void AddUserRole(int roleId, int userId)
            AccountFacade facade = new AccountFacade();
            int UserID = facade.Users()[0].UserID;

            PortalRole role = new PortalRole();
            role.PortalID = 0;
            role.RoleName = "role" + DateTime.Now.Ticks;

            int RoleID = facade.AddRole(role);
            facade.AddUserRole(RoleID, UserID);
        }
        //*******************************************************
        //
        // The BindData helper method is used to bind the list of
        // security roles for this portal to an asp:datalist server control
        //
        //*******************************************************
        private void BindData()
        {
            // unhide the Windows Authentication UI, if application
            if (User.Identity.AuthenticationType != "Forms")
            {
                windowsUserName.Visible = true;
                addNew.Visible = true;
            }

            // add the role name to the title
            if (roleName != "")
            {
                title.InnerText = "��ɫ��ϵ: " + roleName;
            }

            IAccountFacade facade = new AccountFacade();
            // Get the portal's roles from the database
            // bind users in role to DataList
            usersInRole.DataSource = facade.RoleMembers(roleId);
            usersInRole.DataBind();

            // bind all portal users to dropdownlist
            allUsers.DataSource = facade.Users();
            allUsers.DataBind();
        }
 public void UsersTest()
 {
     //IList<PortalUser> GetUsers()
     AccountFacade facade = new AccountFacade();
     facade.Users();
 }
Esempio n. 4
0
        //*******************************************************
        //
        // The BindData helper method is used to bind the list of
        // users for this portal to an asp:DropDownList server control
        //
        //*******************************************************
        private void BindData()
        {
            // change the message between Windows and Forms authentication
            if (Context.User.Identity.AuthenticationType != "Forms")
                Message.Text =
                    "�û�����ע����ܲ鿴��ȫ���ݡ�����ͨ��ע�Ṧ������û�������Ա����ʹ�����ϵİ�ȫ��ɫ����ָ���û���ɫ��";
            else
                Message.Text =
                    "�û�����ע����ܲ鿴��ȫ���ݡ�����ͨ��ע�Ṧ������û�������Ա����ʹ�����ϵİ�ȫ��ɫ����ָ���û���ɫ��";

            // Get the list of registered users from the database
            // bind all portal users to dropdownlist
            IAccountFacade facade = new AccountFacade();
            allUsers.DataSource = facade.Users();
            allUsers.DataBind();
        }