Ejemplo n.º 1
0
        public void ChangeRole(StudentRole role)
        {
            for (int i = 0; i < this.Roles.Length; i++)
            {
                // Find the same role in our collection since deserialization may have ommited IDs
                if (this.Roles[i].RoleText == role.RoleText && this.Roles[i].FacultyNumber == role.FacultyNumber)
                {
                    var chosenRole = this.Roles[i];
                    this.SendRequest(SusiPages.Roles, string.Format(HiddenFieldValues.FormattedRolesFormData, chosenRole.HiddenUserId, chosenRole.HiddenRoleId));
                    this.HasSelectedRole = true;
                    return;
                }
            }

            throw new ArgumentException("The user is in no such role", "role");
        }
Ejemplo n.º 2
0
        public void ChangeRole(StudentRole role)
        {
            for (int i = 0; i < this.Roles.Length; i++)
            {
                // Find the same role in our collection since deserialization may have ommited IDs
                if (this.Roles[i].RoleText == role.RoleText && this.Roles[i].FacultyNumber == role.FacultyNumber)
                {
                    var chosenRole = this.Roles[i];
                    this.SendRequest(SusiPages.Roles, string.Format(HiddenFieldValues.FormattedRolesFormData, chosenRole.HiddenUserId, chosenRole.HiddenRoleId));
                    this.HasSelectedRole = true;
                    return;
                }
            }

            throw new ArgumentException("The user is in no such role", "role");
        }