Exemplo n.º 1
0
        public static User CreateDemoUser(Guid districtRef, Guid userId, string login)
        {
            var schoolUsers = new List <SchoolUser>();

            var school = DemoSchoolService.CreateMasterSchool(districtRef);

            var district = DemoDistrictService.CreateDemoDistrict(districtRef);

            var user = new User
            {
                ConfirmationKey = null,
                DistrictRef     = districtRef,
                Id          = userId,
                IsDeveloper = false,
                IsSysAdmin  = false,
                Login       = login,
                IsDemoUser  = true,
                District    = district,
                LoginInfo   = new UserLoginInfo
                {
                    Id = userId
                }
            };

            schoolUsers.Add(new SchoolUser
            {
                School = school,
                User   = user
            });

            user.SchoolUsers = schoolUsers;

            return(user);
        }
Exemplo n.º 2
0
        public ImportService(Guid districtId, SisConnectionInfo connectionInfo, BackgroundTaskService.BackgroundTaskLog log)
        {
            ConnectionInfo  = connectionInfo;
            Log             = log;
            this.districtId = districtId;
            var admin = new User {
                Id = Guid.Empty, Login = "******", LoginInfo = new UserLoginInfo()
            };

            sysadminCntx = new UserContext(admin, CoreRoles.SUPER_ADMIN_ROLE, null, null, null, null, null);
        }
Exemplo n.º 3
0
        public ImportService(Guid districtId, SisConnectionInfo connectionInfo, BackgroundTaskService.BackgroundTaskLog log, Guid taskId)
        {
            // TODO: obviously we don't want duplicate code here
            this.taskId     = taskId;
            ConnectionInfo  = connectionInfo;
            Log             = log;
            this.districtId = districtId;
            var admin = new User {
                Id = Guid.Empty, Login = "******", LoginInfo = new UserLoginInfo()
            };

            sysadminCntx = new UserContext(admin, CoreRoles.SUPER_ADMIN_ROLE, null, null, null, null, null);
        }