Ejemplo n.º 1
0
        public DataBuilder CreateDummyUserWithRole(RoleEnum roleEnum)
        {
            this.userBuilder = new UserBuilder(1111111, "dummyUser", "123456", "dummyUser", "dummySirName", "*****@*****.**", "123456", true, UserStateEnum.Active);
            this.user        = userBuilder.Build(contextBuilder.GetContext());

            this.termBuilder = new TermBuilder("testTerm", "testTerm", DateTime.Now.Year, 1);
            this.term        = termBuilder.Build(contextBuilder.GetContext());

            this.organizationBuilder = new OrganizationBuilder("testOrganization", 0, Miterya.Domain.Common.Enums.StudentTypeEnum.ElementarySchool, 12);
            organizationBuilder.SetType(OrganTypeEnum.Organization);
            this.organization = organizationBuilder.Build(contextBuilder.GetContext());

            userBuilder.SetRole(contextBuilder.GetContext(), roleEnum, term, organization);
            return(this);
        }
Ejemplo n.º 2
0
        public List <User> CreateListDummyUserInRangeWithRoleToOrganization(Organization organization, RoleEnum roleEnum, int count)
        {
            List <User> users = new List <User>();

            for (int i = 0; i < count; i++)
            {
                this.userBuilder = new UserBuilder
                                   (
                    10000000000 + GenerateNationalID(),                                                 // National Id
                    (/*organization.Level.ToString() +*/ roleEnum.ToString() + GenerateUserID()).Trim() // Username
                                   );
                this.user = userBuilder.Build(contextBuilder.GetContext());
                users.Add(this.user);

                userBuilder.SetRole(contextBuilder.GetContext(), roleEnum, term, organization);
            }
            return(users);
        }
Ejemplo n.º 3
0
        public List <User> CreateListDummyUserWithRoleToRangeOrganization(List <Organization> organizations, RoleEnum roleEnum)
        {
            List <User> users = new List <User>();

            foreach (var item in organizations)
            {
                this.userBuilder = new UserBuilder
                                   (
                    10000000000 + GenerateNationalID(),                                                  // National Id, //national Id
                    (/*organization.Level.ToString() + */ roleEnum.ToString() + GenerateUserID()).Trim() // Username
                                   );
                this.user = userBuilder.Build(contextBuilder.GetContext());
                this.users.Add(this.user);

                userBuilder.SetRole(contextBuilder.GetContext(), roleEnum, term, item);
            }

            return(users);
        }
Ejemplo n.º 4
0
        public DataBuilder CreateDummyUserWithRoleToOrganization(RoleEnum roleEnum)
        {
            this.userBuilder = new UserBuilder
                               (
                10000000000 + GenerateNationalID(),              // National Id
                (roleEnum.ToString() + GenerateUserID()).Trim(), // Username
                "123456",                                        //pass
                "dummyUser",                                     //name
                "dummySirName",                                  //surname
                "*****@*****.**",                    //email
                "123456",                                        //phone
                true,                                            //sex
                UserStateEnum.Active
                               );

            this.user = userBuilder.Build(contextBuilder.GetContext());
            this.users.Add(this.user);

            userBuilder.SetRole(contextBuilder.GetContext(), roleEnum, term, organization);

            return(this);
        }
Ejemplo n.º 5
0
        public List <User> CreateListDummyUserWithRoleToOrganization(Organization organizations, RoleEnum roleEnum)
        {
            List <User> users      = new List <User>();
            int         userRandId = new Random().Next(10000, 99999);

            this.userBuilder = new UserBuilder
                               (
                10000000000 + GenerateNationalID(),              // National Id
                (roleEnum.ToString() + GenerateUserID()).Trim(), // Username
                "123456",                                        //pass
                "testerName" + userRandId.ToString(),            //name
                "testerSurname",                                 //surname
                "*****@*****.**",                         //email
                "+905001234567",                                 // phone number
                true,                                            // gender
                UserStateEnum.Active
                               );
            this.user = userBuilder.Build(contextBuilder.GetContext());
            this.users.Add(this.user);

            userBuilder.SetRole(contextBuilder.GetContext(), roleEnum, term, organizations);

            return(users);
        }
Ejemplo n.º 6
0
 public DataBuilder SetRol(RoleEnum roleEnum)
 {
     userBuilder.SetRole(contextBuilder.GetContext(), roleEnum, this.term, this.organization);
     return(this);
 }