Exemple #1
0
        private void FillData(User user, List <UserLanguage> languages, Profile profile, List <AccessRole> roles, UserBlockVM block)
        {
            this.UserId      = user.Id;
            this.DisplayName = "";
            this.Email       = "";
            this.UserName    = "";
            this.Languages   = new List <UserLanguage>();
            this.Profile     = new Profile(user.Id);
            this.Roles       = new List <string>();
            this.Block       = block;

            if (user != null)
            {
                this.DisplayName = user.DisplayName;
                this.Email       = user.Email;
                this.UserName    = user.UserName;
            }

            if (languages != null)
            {
                this.Languages = languages;
            }

            if (profile != null)
            {
                this.Profile = profile;
            }

            if (roles != null)
            {
                foreach (AccessRole r in roles)
                {
                    this.Roles.Add(r.Name);
                }
            }
        }
Exemple #2
0
 public UserVM(User user, List <UserLanguage> languages, Profile profile, List <AccessRole> roles, UserBlockVM block)
 {
     FillData(user, languages, profile, roles, block);
 }