Exemplo n.º 1
0
        public UserModel MapToUserModel(AM.Account account, SubUserResponse subUserResponse)
        {
            UserModel userModel = new UserModel
            {
                Id        = account.Id,
                UserName  = account.Username,
                RoleId    = account.RoleId,
                RoleName  = account.Role.Name,
                Firstname = account.Firstname,
                Lastname  = account.LastName
            };

            return(userModel);
        }
Exemplo n.º 2
0
        public AM.Account MapFromRegisterModel(RegisterModel registerModel)
        {
            AM.Account account = new AM.Account();

            account.Username         = registerModel.EmailAddress;
            account.Firstname        = registerModel.FirstName;
            account.LastName         = registerModel.LastName;
            account.EmailAddress     = registerModel.EmailAddress;
            account.CountryId        = registerModel.CountryId;
            account.CreateDate       = DateTime.Now;
            account.IsFirstTimeLogin = true;
            account.PasswordSalt     = GeneratePassword.PasswordSalt();
            account.Password         = GeneratePassword.HashedPassword(registerModel.Password, account.PasswordSalt);

            return(account);
        }
Exemplo n.º 3
0
        public AccountModel MapToAccountModel(AM.Account account)
        {
            AccountModel accountModel = new AccountModel();

            return(accountModel);
        }