예제 #1
0
        public IEnumerable <ReportGroup> GetAllReportGroupsForUser(MCUser user)
        {
            var result = (from rg in _objectSet
                          select new
            {
                rg,
                urg = (
                    from urg in rg.UserReportGroups
                    where
                    urg.UserCode == user.Code
                    select urg)
            }).AsEnumerable();

            return(result.Select(rg => rg.rg));
        }
        private void FixupUser(MCUser previousValue)
        {
            if (previousValue != null && previousValue.UserRoles.Contains(this))
            {
                previousValue.UserRoles.Remove(this);
            }

            if (User != null)
            {
                if (!User.UserRoles.Contains(this))
                {
                    User.UserRoles.Add(this);
                }
                if (UserCode != User.Code)
                {
                    UserCode = User.Code;
                }
            }
        }