Ejemplo n.º 1
0
        private void PopulateStaticDataFields(Entities.User user)
        {
            // Populate the User Statuses
            Facade.IUser facUser      = new Facade.User();
            DataSet      dsUserStatus = facUser.GetAllUserStatus();

            cboUserStatus.DataSource     = dsUserStatus;
            cboUserStatus.DataTextField  = "Description";
            cboUserStatus.DataValueField = "UserStatusId";
            cboUserStatus.DataBind();

            // Populate the Teams
            Facade.ReferenceData facRefData = new Facade.ReferenceData();
            DataSet dsTeam = facRefData.GetAllTeams();

            cboTeam.DataSource     = dsTeam;
            cboTeam.DataTextField  = "Description";
            cboTeam.DataValueField = "IdentityId";
            cboTeam.DataBind();

            string[]         userRoleString = (((Entities.CustomPrincipal)Page.User).UserRole.Split(new char[] { ',' }));
            List <eUserRole> userRole       = new List <eUserRole>();

            for (int i = 0; i < userRoleString.Length; i++)
            {
                userRole.Add((eUserRole)int.Parse(userRoleString[i]));
            }

            if (!userRole.Contains(eUserRole.SystemAdministrator))
            {
                chkCanAccessFromAnywhere.Enabled = false;
                chkScannedLicense.Enabled        = false;
            }
        }