Beispiel #1
0
        public IEnumerable <GetTotalContributionsRange> TotalsByRange()
        {
            var customFundIds     = APIContributionSearchModel.GetCustomFundSetList(DbUtil.Db, FundSet);
            var authorizedFundIds = DbUtil.Db.ContributionFunds.ScopedByRoleMembership(DbUtil.Db).Select(f => f.FundId).ToList();

            string fundIds = string.Empty;

            if (customFundIds?.Count > 0)
            {
                fundIds = authorizedFundIds.Where(f => customFundIds.Contains(f)).JoinInts(",");
            }
            else
            {
                fundIds = authorizedFundIds.JoinInts(",");
            }

            var list = (from r in DbUtil.Db.GetTotalContributionsRange(Dt1, Dt2, CampusId, NonTaxDeductible ? (bool?)true : false, IncUnclosedBundles, fundIds)
                        orderby r.Range
                        select r).ToList();

            RangeTotal = new GetTotalContributionsRange
            {
                Count = list.Sum(t => t.Count),
                Total = list.Sum(t => t.Total),
            };

            return(list);
        }
Beispiel #2
0
        public IEnumerable <GetTotalContributionsRange> TotalsByRange()
        {
            var list = (from r in DbUtil.Db.GetTotalContributionsRange(Dt1, Dt2, CampusId, NonTaxDeductible ? (bool?)null : false, IncUnclosedBundles)
                        orderby r.Range
                        select r).ToList();

            RangeTotal = new GetTotalContributionsRange
            {
                Count = list.Sum(t => t.Count),
                Total = list.Sum(t => t.Total),
            };
            return(list);
        }
Beispiel #3
0
        public IEnumerable <GetTotalContributionsRange> TotalsByRange()
        {
            var fundids = APIContributionSearchModel.GetCustomFundSetList(FundSet).JoinInts(",");
            var list    = (from r in DbUtil.Db.GetTotalContributionsRange(Dt1, Dt2, CampusId, NonTaxDeductible ? (bool?)null : false, IncUnclosedBundles, fundids)
                           orderby r.Range
                           select r).ToList();

            RangeTotal = new GetTotalContributionsRange
            {
                Count = list.Sum(t => t.Count),
                Total = list.Sum(t => t.Total),
            };
            return(list);
        }