예제 #1
0
        public override void DoEdit(bool updateAllFields = false)
        {
            if (SelectedUserRolesIDs == null || SelectedUserRolesIDs.Count == 0)
            {
                FC.Add("Entity.SelectedUserRolesIDs.DONOTUSECLEAR", "true");
            }
            else
            {
                Entity.UserRoles = new List <FrameworkUserRole>();
                SelectedUserRolesIDs.ForEach(x => Entity.UserRoles.Add(new FrameworkUserRole {
                    ID = Guid.NewGuid(), RoleId = x
                }));
            }

            if (SelectedUserGroupsIDs == null || SelectedUserGroupsIDs.Count == 0)
            {
                FC.Add("Entity.SelectedUserGroupsIDs.DONOTUSECLEAR", "true");
            }
            else
            {
                Entity.UserGroups = new List <FrameworkUserGroup>();
                SelectedUserGroupsIDs.ForEach(x => Entity.UserGroups.Add(new FrameworkUserGroup {
                    ID = Guid.NewGuid(), GroupId = x
                }));
            }

            base.DoEdit(updateAllFields);
        }
예제 #2
0
파일: AdminVM.cs 프로젝트: 401175209/YG
        public override void DoEdit(bool updateAllFields = false)
        {
            Entity.UserRoles = new List <FrameworkUserRole>();
            if (SelectedUserRolesIDs != null)
            {
                SelectedUserRolesIDs.ForEach(x => Entity.UserRoles.Add(new FrameworkUserRole {
                    ID = Guid.NewGuid(), RoleId = x
                }));
            }

            Entity.UserGroups = new List <FrameworkUserGroup>();
            if (SelectedUserGroupsIDs != null)
            {
                SelectedUserGroupsIDs.ForEach(x => Entity.UserGroups.Add(new FrameworkUserGroup {
                    ID = Guid.NewGuid(), GroupId = x
                }));
            }

            base.DoEdit(updateAllFields);
        }