Пример #1
0
        public static UserModel GetModelFromUser(User user)
        {
            if (user == null)
            {
                return(null);
            }

            var roles      = user.Roles.ToList().GetRoleModelsFromRoles();
            var ministries = user.Ministries.ToList().GetMinstryModelsFromMinistries();

            return(new UserModel
            {
                FirstName = user.FirstName,
                LastName = user.LastName,
                ScreenName = user.ScreenName,
                Email = user.Email,
                Link = user.Link,
                AccessToken = user.AccessToken,
                FacebookId = user.FacebookId,
                UserStatus = user.UserStatusEnum,
                LastAcecssed = user.LastAccessed,
                Created = user.Created,
                Id = user.Id,
                IdKey = user.IdKey,
                Roles = roles,
                MultiSelectRoleList = ManageRoleModelHelper.GetMultiSelectedRoles(roles),
                Ministries = ministries,
                MultiSelectMinistryList = ManageMinistryModelHelper.GetMultiSelectedMinistries(ministries),
            });
        }
Пример #2
0
        /// <summary>
        /// Updates the model for the Manage.UserController.Add post action
        /// </summary>
        /// <returns></returns>
        public static void UpdateUserModelForAdd(this UserModel model)
        {
            Guid userIdKey = ManageUserModelHelper.GetFormsAuthenticationTicket().IdKey();

            model.PageTitle = "Holy Angels Add New System User";
            model.SubTitle  = "New System User";
            model.UserIdKey = userIdKey;

            model.MultiSelectRoleList     = ManageRoleModelHelper.GetMultiSelectedRoles();
            model.MultiSelectMinistryList = ManageMinistryModelHelper.GetMultiSelectedMinistries();

            model.MetaDescription = "";
            model.MetaKeywords    = "";
            model.MetaSubject     = "";
        }