コード例 #1
0
ファイル: Company.cs プロジェクト: ManigandanS/supexlms
        public void AddUser(string email, string firstName, string lastName, string password, UserTypeEnum userType, UserStatusEnum status, bool tempPassword,
                            AcquisitionEnum acquisition, List <string> groups, List <string> roles)
        {
            var user = new User(email, firstName, lastName, password, userType, status, true, acquisition);

            if (groups != null && groups.Any())
            {
                user.AddUserGroup(groups);
            }
            if (roles != null && roles.Any())
            {
                user.AddUserRole(roles);
            }

            this.CompanyAccesses.Add(new CompanyAccess {
                Company = this, User = user
            });
        }
コード例 #2
0
ファイル: User.cs プロジェクト: ManigandanS/supexlms
        public User(string email, string firstName, string lastName, string password, UserTypeEnum userType, UserStatusEnum status, bool tempPassword, AcquisitionEnum acquisition)
            : this()
        {
            logger.Debug("New Guid: " + this.Id);

            this.Email        = email;
            this.FirstName    = CryptoUtil.EncryptToBase64(firstName, this.Id);
            this.LastName     = CryptoUtil.EncryptToBase64(lastName, this.Id);
            this.Password     = CryptoUtil.EncryptToBase64(password, this.Id);
            this.UserType     = userType;
            this.UpdatedTs    = DateTime.UtcNow;
            this.Status       = status;
            this.TempPassword = tempPassword;
            this.Acquisition  = acquisition;
        }