Esempio n. 1
0
        public WorkTeam Copy()
        {
            Server.Application.WorkTeam serverWorkTeam = (Server.Application.WorkTeam)ToServerObject();

            WorkTeam copiedWorkTeam = new WorkTeam(application, serverWorkTeam);

            return(copiedWorkTeam);
        }
Esempio n. 2
0
        public Boolean IsEqual(WorkTeam compareWorkTeam)
        {
            Boolean isEqual = base.IsEqual((CoreConfigurationObject)compareWorkTeam);


            isEqual &= (workTeamType == compareWorkTeam.WorkTeamType);

            isEqual &= (membership.Count == compareWorkTeam.Membership.Count);


            if (isEqual)
            {
                // CYCLE THROUGH ALL MEMBERSHIP, COMPARING ASSIGNED PERMISSIONS

                foreach (Server.Application.WorkTeamMembership currentMembership in membership)
                {
                    if (compareWorkTeam.ContainsMembership(currentMembership.SecurityAuthorityId, currentMembership.UserAccountId))
                    {
                        Server.Application.WorkTeamMembership compareMembership = compareWorkTeam.MembershipGet(currentMembership.SecurityAuthorityId, currentMembership.UserAccountId);

                        if (compareMembership == null)
                        {
                            isEqual = false; break;
                        }


                        isEqual &= (currentMembership.WorkTeamRole == compareMembership.WorkTeamRole);

                        if (!isEqual)
                        {
                            break;
                        }
                    }

                    else
                    {
                        isEqual = false; break;
                    }
                }
            }


            return(isEqual);
        }