public void Load(MujZavod.Data.Identity.ApplicationUser user, string imgSize)
        {
            Id       = user.Id;
            fullName = MujZavod.Code.Repository.ApplicationUserRepository.GetFullName(user);

            this.imgSize = imgSize;
        }
        private Identity.ApplicationUser CreateUserIfNotExists(DataDbContext context, string username, string email,
                                                               string firstName, string lastName, string password, string[] roles, DateTime birthDate, int genderId, int organizerId)
        {
            var userManager = new MujZavod.Data.Identity.ApplicationUserManager(
                new UserStore <MujZavod.Data.Identity.ApplicationUser>(context));

            var user = userManager.FindByName(username);

            if (user == null)
            {
                user = new MujZavod.Data.Identity.ApplicationUser
                {
                    UserName    = username,
                    Email       = email,
                    FirstName   = firstName,
                    LastName    = lastName,
                    BirthDate   = birthDate,
                    EGenderId   = genderId,
                    OrganizerId = organizerId
                };
                var result = userManager.Create(user, password);
                result = userManager.SetLockoutEnabled(user.Id, false);
            }


            var rolesForUser = userManager.GetRoles(user.Id);

            foreach (string role in roles)
            {
                if (!rolesForUser.Contains(role))
                {
                    var result = userManager.AddToRole(user.Id, role);
                }
            }

            return(user);
        }
 public PartialLinkedUserbasics(MujZavod.Data.Identity.ApplicationUser user, string imgSize)
 {
     Load(user, imgSize);
 }
 public PartialLinkedUserbasics(MujZavod.Data.Identity.ApplicationUser user)
 {
     Load(user, "xxs");
 }