Example #1
0
        public IQueryable <InvolvementCurrent> DefineModelList(bool useOrgFilter)
        {
            var roles = DbUtil.Db.CurrentRoles();

            return(from om in DbUtil.Db.InvolvementCurrent(PeopleId, Util.UserId)
                   where om.Pending.Value
                   where om.LimitToRole == null || roles.Contains(om.LimitToRole)
                   where (!useOrgFilter || !OrgTypesFilter.Any() || OrgTypesFilter.Contains(om.OrgType))
                   select om);
        }
Example #2
0
        public IQueryable <OrganizationMember> DefineModelList(bool useOrgFilter)
        {
            var roles = DbUtil.Db.CurrentRoles();

            return(from o in DbUtil.Db.Organizations
                   from om in o.OrganizationMembers
                   where om.PeopleId == PeopleId && om.Pending.Value == true
                   where o.LimitToRole == null || roles.Contains(o.LimitToRole)
                   where (!useOrgFilter || !OrgTypesFilter.Any() || OrgTypesFilter.Contains(om.Organization.OrganizationType.Description))
                   select om);
        }
Example #3
0
        public IQueryable <InvolvementPreviou> DefineModelList(bool useOrgFilter)
        {
            var limitvisibility = Util2.OrgLeadersOnly || !HttpContext.Current.User.IsInRole("Access");
            var roles           = DbUtil.Db.CurrentRoles();

            return(from etd in DbUtil.Db.InvolvementPrevious(PeopleId, Util.UserId)
                   where etd.TransactionStatus == false
                   where etd.PeopleId == PeopleId
                   where etd.TransactionTypeId >= 4
                   where !(limitvisibility && etd.SecurityTypeId == 3)
                   where etd.LimitToRole == null || roles.Contains(etd.LimitToRole)
                   where (!useOrgFilter || !OrgTypesFilter.Any() || OrgTypesFilter.Contains(etd.OrgType))
                   select etd);
        }
Example #4
0
        public IQueryable <EnrollmentTransaction> DefineModelList(bool useOrgFilter)
        {
            var limitvisibility = Util2.OrgLeadersOnly || !HttpContext.Current.User.IsInRole("Access");
            var roles           = DbUtil.Db.CurrentRoles();

            return(from etd in DbUtil.Db.EnrollmentTransactions
                   let org = etd.Organization
                             where etd.TransactionStatus == false
                             where etd.PeopleId == PeopleId
                             where etd.TransactionTypeId >= 4
                             where !(limitvisibility && etd.Organization.SecurityTypeId == 3)
                             where org.LimitToRole == null || roles.Contains(org.LimitToRole)
                             where (!useOrgFilter || !OrgTypesFilter.Any() || OrgTypesFilter.Contains(org.OrganizationType.Description))
                             select etd);
        }
Example #5
0
        public IQueryable <InvolvementCurrent> DefineModelList(bool useOrgFilter)
        {
            var limitvisibility = Util2.OrgLeadersOnly || !HttpContext.Current.User.IsInRole("Access");
            var oids            = new int[0];

            if (Util2.OrgLeadersOnly)
            {
                oids = DbUtil.Db.GetLeaderOrgIds(Util.UserPeopleId);
            }
            var roles = DbUtil.Db.CurrentRoles();

            return(from om in DbUtil.Db.InvolvementCurrent(PeopleId, Util.UserId)
                   where (om.Pending ?? false) == false
                   where oids.Contains(om.OrganizationId) || !(limitvisibility && om.SecurityTypeId == 3)
                   where om.LimitToRole == null || roles.Contains(om.LimitToRole)
                   where (!useOrgFilter || !OrgTypesFilter.Any() || OrgTypesFilter.Contains(om.OrgType))
                   select om);
        }
Example #6
0
        public IQueryable <OrganizationMember> DefineModelList(bool useOrgFilter)
        {
            var limitvisibility = Util2.OrgLeadersOnly || !HttpContext.Current.User.IsInRole("Access");
            var oids            = new int[0];

            if (Util2.OrgLeadersOnly)
            {
                oids = DbUtil.Db.GetLeaderOrgIds(Util.UserPeopleId);
            }
            var roles = DbUtil.Db.CurrentRoles();

            var modelList = from om in DbUtil.Db.OrganizationMembers
                            let org = om.Organization
                                      where om.PeopleId == PeopleId
                                      where (om.Pending ?? false) == false
                                      where oids.Contains(om.OrganizationId) || !(limitvisibility && om.Organization.SecurityTypeId == 3)
                                      where org.LimitToRole == null || roles.Contains(org.LimitToRole)
                                      where (!useOrgFilter || !OrgTypesFilter.Any() || OrgTypesFilter.Contains(om.Organization.OrganizationType.Description))
                                      select om;

            return(modelList);
        }