public void SaveAsExcel() { var api = new APIContributionSearchModel(DbUtil.Db) { model = { StartDate = Dt1, EndDate = Dt2, IncludeUnclosedBundles = IncUnclosedBundles, TaxNonTax = TaxDedNonTax, CampusId = CampusId, Status = ContributionStatusCode.Recorded, Online = Online, FilterByActiveTag = FilterByActiveTag, } }; var x = api.FetchContributions(); var list = x.Select(xx => new ContributionIdItem { ContributionId = xx.ContributionId }).ToList(); var dt = ExcelExportModel.ToDataTable(list); dt.SaveAs("D:\\cids.xlsx"); }
public Expression IsFamilyGiverFunds() { var tf = CodeIds == "1"; var fundcsv = APIContributionSearchModel.GetCustomFundSetList(db, Quarters); if (fundcsv == null) { return(AlwaysFalse()); } var fundlist = string.Join(",", fundcsv); var td = Util.Now; var fd = td.AddDays(Days == 0 ? -365 : -Days).Date; Tag tag = null; if (op == CompareType.Equal ^ tf) { var q = db.FamilyGiverFunds(fd, td, fundlist).Where(vv => vv.FamGive == false); tag = db.PopulateTemporaryTag(q.Select(pp => pp.PeopleId)); } else { var q = db.FamilyGiverFunds(fd, td, fundlist).Where(vv => vv.FamGive == true); tag = db.PopulateTemporaryTag(q.Select(pp => pp.PeopleId)); } Expression <Func <Person, bool> > pred = p => p.Tags.Any(t => t.Id == tag.Id); Expression expr = Expression.Invoke(pred, parm); return(expr); }
public DynamicParameters GetDynamicParameters() { var p = new DynamicParameters(); p.Add("@StartDate", Dt1); p.Add("@EndDate", Dt2); p.Add("@CampusId", CampusId); p.Add("@Online", Online); p.Add("@TaxNonTax", TaxDedNonTax); p.Add("@IncludeUnclosedBundles", IncUnclosedBundles); var fundset = APIContributionSearchModel.GetCustomFundSetList(FundSet).JoinInts(","); p.Add("@FundSet", fundset); if (FilterByActiveTag) { var tagid = DbUtil.Db.TagCurrent().Id; p.Add("@ActiveTagFilter", tagid); } else { p.Add("@ActiveTagFilter"); } return(p); }
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); }
private DynamicParameters DonorTotalSummaryParameters(DonorTotalSummaryOptionsModel model, bool useMedianMin = false) { var queryParameters = new DynamicParameters(); queryParameters.Add("@enddt", model.StartDate); queryParameters.Add("@years", model.NumberOfYears); queryParameters.Add("@fund", model.Fund.Value.ToInt()); queryParameters.Add("@campus", model.Campus.Value.ToInt()); if (useMedianMin) { queryParameters.Add("@medianMin", model.MinimumMedianTotal); } if (model?.FundSet != null) // TODO: seems like a redundant null check, if model was null, it would have errored well before this point { var fundset = APIContributionSearchModel.GetCustomStatementsList(CurrentDatabase, model.FundSet.Value).JoinInts(","); queryParameters.Add("@fundids", fundset == "" ? null : fundset); } else { var authorizedFunds = CurrentDatabase.ContributionFunds.ScopedByRoleMembership(CurrentDatabase).Select(f => f.FundId).ToList(); var authorizedFundsCsv = string.Join(",", authorizedFunds); queryParameters.Add("@fundids", authorizedFundsCsv); } return(queryParameters); }
public IEnumerable <RangeInfo> GetTotalsByFundRange() { var fundids = APIContributionSearchModel.GetCustomFundSetList(FundSet).JoinInts(","); var list = (from r in DbUtil.Db.GetContributionsRange(Dt1, Dt2, CampusId, false, true, Pledged, FundId, fundids) orderby r.Range select r).ToList(); RangeTotal = new RangeInfo { Total = list.Sum(vv => vv.Total ?? 0), Count = list.Sum(vv => vv.Count ?? 0), DonorCount = list.Sum(vv => vv.DonorCount ?? 0), }; var list2 = from r in list select new RangeInfo { RangeId = r.Range, Total = r.Total ?? 0, Count = r.Count ?? 0, DonorCount = r.DonorCount ?? 0, PctCount = (r.Count ?? 0) / Convert.ToDecimal(RangeTotal.Count) * 100, PctTotal = (r.Total ?? 0) / RangeTotal.Total * 100, }; return(list2); }
public EpplusResult ToExcel(string type) { bool?nontaxdeductible = null; // both switch (TaxDedNonTax) { case "TaxDed": nontaxdeductible = false; break; case "NonTaxDed": nontaxdeductible = true; break; } var tagid = FilterByActiveTag ? DbUtil.Db.TagCurrent()?.Id : (int?)null; //var fundids = APIContributionSearchModel.GetCustomFundSetList(DbUtil.Db. FundSet); var customFundIds = APIContributionSearchModel.GetCustomFundSetList(DbUtil.Db, FundSet); var authorizedFundIds = DbUtil.Db.ContributionFunds.ScopedByRoleMembership().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(","); } switch (type) { case "ledgerincome": var cd = new CommandDefinition("dbo.LedgerIncomeExport", new { fd = Dt1, td = Dt2, campusid, nontaxded = nontaxdeductible, includeunclosed = IncUnclosedBundles }, commandType: CommandType.StoredProcedure); return(DbUtil.Db.Connection.ExecuteReader(cd).ToExcel("LedgerIncome.xlsx")); case "donorfundtotals": return(ExportPeople.ExcelDonorFundTotals(Dt1, Dt2, fundid, campusid, false, nontaxdeductible, IncUnclosedBundles, tagid, fundIds) .ToExcel("DonorFundTotals.xlsx")); case "donortotals": return(ExportPeople.ExcelDonorTotals(Dt1, Dt2, campusid, false, nontaxdeductible, IncUnclosedBundles, tagid, fundIds) .ToExcel("DonorTotals.xlsx")); case "donordetails": return(ExportPeople.DonorDetails(Dt1, Dt2, fundid, campusid, false, nontaxdeductible, IncUnclosedBundles, tagid, fundIds) .ToExcel("DonorDetails.xlsx")); } return(null); }
public ActionResult FundList(TotalsByFundModel m) { return(Content($@" <pre> {string.Join(",", APIContributionSearchModel.GetCustomFundSetList(DbUtil.Db, m.FundSet))} </pre> ")); }
public IEnumerable <AgeRangeInfo> GetTotalsByFundAgeRange() { var model = new BundleModel(); var fundids = APIContributionSearchModel.GetCustomFundSetList(DbUtil.Db, FundSet).JoinInts(","); var ageRangeInfos = model.TotalsByFundAgeRange(0, Dt1.GetValueOrDefault(), Dt2.GetValueOrDefault(), string.Empty, CampusId, fundids); RangeTotal = model.RangeTotal; return(ageRangeInfos); }
public static StatementSpecification GetStatementSpecification(CMSDataContext db, string name) { var standardheader = db.ContentHtml("StatementHeader", Resource1.ContributionStatementHeader); var standardnotice = db.ContentHtml("StatementNotice", Resource1.ContributionStatementNotice); if (name == null || name == "all") { return(new StatementSpecification() { Description = "All Statements", Notice = standardnotice, Header = standardheader, Funds = null }); } var standardsetlabel = db.Setting("StandardFundSetName", "Standard Statements"); if (name == standardsetlabel) { var funds = APIContributionSearchModel.GetCustomStatementsList(db, name); return(new StatementSpecification() { Description = standardsetlabel, Notice = standardnotice, Header = standardheader, Funds = funds }); } var xd = XDocument.Parse(Util.PickFirst(db.ContentOfTypeText("CustomStatements"), "<CustomStatement/>")); var ele = xd.XPathSelectElement($"//Statement[@description='{name}']"); if (ele == null) { return(null); } var desc = ele.Attribute("description")?.Value; var cs = new StatementSpecification { Description = desc }; var headerele = ele.Element("Header"); cs.Header = headerele != null ? string.Concat(headerele.Nodes().Select(x => x.ToString()).ToArray()) : standardheader; var noticeele = ele.Element("Notice"); cs.Notice = noticeele != null ? string.Concat(noticeele.Nodes().Select(x => x.ToString()).ToArray()) : standardnotice; cs.Funds = APIContributionSearchModel.GetCustomStatementsList(db, desc); return(cs); }
public void Should_APIContributionSearchModel() { using (var db = CMSDataContext.Create(DatabaseFixture.Host)) { ContributionSearchInfo SearchInfo = new ContributionSearchInfo { Name = "TestName" }; var api = new APIContributionSearchModel(db, SearchInfo); api.model.Name.ShouldBe("TestName"); } }
public static StatementSpecification GetStatementSpecification(CMSDataContext db, string name) { string nameOfChurch = db.Setting("NameOfChurch", "Name of Church"); string startAddress = db.Setting("StartAddress", "Start Address"); string churchPhone = db.Setting("ChurchPhone", "(000) 000-0000"); var standardheader = db.ContentHtml("StatementHeader", string.Format(Resource1.ContributionStatementHeader, nameOfChurch, startAddress, churchPhone)); var standardnotice = db.ContentHtml("StatementNotice", string.Format(Resource1.ContributionStatementNotice, nameOfChurch)); if (name == null || name == "all") { return(new StatementSpecification() { Notice = standardnotice, Header = standardheader, Funds = null }); } var standardsetlabel = db.Setting("StandardFundSetName", "Standard Statements"); if (name == standardsetlabel) { var funds = APIContributionSearchModel.GetCustomStatementsList(db, name); return(new StatementSpecification() { Description = standardsetlabel, Notice = standardnotice, Header = standardheader, Funds = funds }); } var xd = XDocument.Parse(Util.PickFirst(db.ContentOfTypeText("CustomStatements"), "<CustomStatement/>")); var statementSpec = xd.XPathSelectElement($"//Statement[@description='{name}']"); if (statementSpec == null) { return(null); } var desc = statementSpec.Attribute("description")?.Value; var cs = new StatementSpecification { Description = desc }; cs.Funds = APIContributionSearchModel.GetCustomStatementsList(db, desc); cs.Header = GetSectionHTML(db, "Header", statementSpec, standardheader); cs.Notice = GetSectionHTML(db, "Notice", statementSpec, standardnotice); cs.Template = GetSectionHTML(db, "Template", statementSpec); cs.TemplateBody = GetSectionHTML(db, "TemplateBody", statementSpec); cs.Footer = GetSectionHTML(db, "Footer", statementSpec); return(cs); }
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); }
public EpplusResult ToExcel(string type) { bool?nontaxdeductible = null; // both switch (TaxDedNonTax) { case "TaxDed": nontaxdeductible = false; break; case "NonTaxDed": nontaxdeductible = true; break; } var tagid = FilterByActiveTag ? DbUtil.Db.TagCurrent()?.Id : (int?)null; var fundids = APIContributionSearchModel.GetCustomFundSetList(FundSet); var funds = fundids.JoinInts(","); switch (type) { case "ledgerincome": var cd = new CommandDefinition("dbo.LedgerIncomeExport", new { fd = Dt1, td = Dt2, campusid, nontaxded = nontaxdeductible, includeunclosed = IncUnclosedBundles }, commandType: CommandType.StoredProcedure); return(DbUtil.Db.Connection.ExecuteReader(cd).ToExcel("LedgerIncome.xlsx")); case "donorfundtotals": return(ExportPeople.ExcelDonorFundTotals(Dt1, Dt2, fundid, campusid, false, nontaxdeductible, IncUnclosedBundles, tagid, funds) .ToExcel("DonorFundTotals.xlsx")); case "donortotals": return(ExportPeople.ExcelDonorTotals(Dt1, Dt2, campusid, false, nontaxdeductible, IncUnclosedBundles, tagid, funds) .ToExcel("DonorTotals.xlsx")); case "donordetails": return(ExportPeople.DonorDetails(Dt1, Dt2, fundid, campusid, false, nontaxdeductible, IncUnclosedBundles, tagid, funds) .ToExcel("DonorDetails.xlsx")); } return(null); }
public List <LineChartDTO> GetFundChartData(int[] fundIds, int?year, CMSDataContext db) { int CurrentYear = year ?? DateTime.Now.Year; var api = new APIContributionSearchModel(db); var myList = GetChartContributions(db, CurrentYear); var myList1 = GetChartContributions(db, CurrentYear - 1); if (fundIds.IsNotNull()) { if (!(fundIds.Length == 1 && fundIds[0].Equals(0))) { myList = GetChartContributions(db, CurrentYear, fundIds); myList1 = GetChartContributions(db, CurrentYear - 1, fundIds); } } return(GetFinalList(CurrentYear, myList, myList1)); }
public IEnumerable <AgeRangeInfo> GetTotalsByFundAgeRange() { var model = new BundleModel(); 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 ageRangeInfos = model.TotalsByFundAgeRange(0, Dt1.GetValueOrDefault(), Dt2.GetValueOrDefault(), string.Empty, CampusId, fundIds); RangeTotal = model.RangeTotal; return(ageRangeInfos); }
public IEnumerable <RangeInfo> GetTotalsByFundRange() { var customFundIds = APIContributionSearchModel.GetCustomFundSetList(DbUtil.Db, FundSet); var authorizedFundIds = DbUtil.Db.ContributionFunds.ScopedByRoleMembership().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.GetContributionsRange(Dt1, Dt2, CampusId, false, true, Pledged, FundId, fundIds) orderby r.Range select r).ToList(); RangeTotal = new RangeInfo { Total = list.Sum(vv => vv.Total ?? 0), Count = list.Sum(vv => vv.Count ?? 0), DonorCount = list.Sum(vv => vv.DonorCount ?? 0), }; var list2 = from r in list select new RangeInfo { RangeId = r.Range, Total = r.Total ?? 0, Count = r.Count ?? 0, DonorCount = r.DonorCount ?? 0, PctCount = (r.Count ?? 0) / Convert.ToDecimal(RangeTotal.Count) * 100, PctTotal = (r.Total ?? 0) / RangeTotal.Total * 100, }; return(list2); }
private DynamicParameters DonorTotalSummaryParameters(DonorTotalSummaryOptionsModel m, bool useMedianMin = false) { var p = new DynamicParameters(); p.Add("@enddt", m.StartDate); p.Add("@years", m.NumberOfYears); if (useMedianMin) { p.Add("@medianMin", m.MinimumMedianTotal); } p.Add("@fund", m.Fund.Value.ToInt()); p.Add("@campus", m.Campus.Value.ToInt()); if (m?.FundSet != null) { var fundset = APIContributionSearchModel.GetCustomStatementsList(m.FundSet.Value).JoinInts(","); p.Add("@fundids", fundset); } else { p.Add("@fundids", null); } return(p); }
public Expression IsRecentGiverFunds() { if (!db.FromBatch) { if (db.CurrentUser == null || db.CurrentUser.Roles.All(rr => rr != "Finance")) { return(AlwaysFalse()); } } var tf = CodeIds == "1"; var fundcsv = APIContributionSearchModel.GetCustomFundSetList(db, Quarters); if (fundcsv == null) { return(AlwaysFalse()); } //throw new Exception($"fundset '{Quarters}' was not found"); var fundlist = string.Join(",", fundcsv); var q = db.RecentGiverFunds(Days, fundlist).Select(v => v.PeopleId.Value); var tag = db.PopulateTemporaryTag(q); Expression <Func <Person, bool> > pred = null; if (op == CompareType.Equal ^ tf) { pred = p => !db.TagPeople.Where(vv => vv.Id == tag.Id).Select(vv => vv.PeopleId).Contains(p.PeopleId); } else { pred = p => db.TagPeople.Where(vv => vv.Id == tag.Id).Select(vv => vv.PeopleId).Contains(p.PeopleId); } Expression expr = Expression.Invoke(pred, parm); return(expr); }
/// <summary> /// This returns a csv string of the fundids when a church is using Custom Statements and FundSets for different statements /// The csv string can be used in SQL using dbo.SplitInts in a query to match a set of fundids. /// </summary> public string CustomStatementsFundIdList(string name) { return(string.Join(",", APIContributionSearchModel.GetCustomStatementsList(db, name))); }
public IEnumerable <FundTotalInfo> TotalsByFund() { List <FundTotalInfo> q = null; var api = new APIContributionSearchModel(DbUtil.Db) { model = { StartDate = Dt1, EndDate = Dt2, IncludeUnclosedBundles = IncUnclosedBundles, TaxNonTax = TaxDedNonTax, CampusId = CampusId, Status = ContributionStatusCode.Recorded, Online = Online, FilterByActiveTag = FilterByActiveTag, FundSet = FundSet, } }; #if DEBUG2 // for reconciliation by developer var v = from c in api.FetchContributions() orderby c.ContributionId select c.ContributionId; using (var tw = new StreamWriter("D:\\totalsbyfund.txt")) foreach (var s in v) { tw.WriteLine(s); } #endif if (IncludeBundleType) { q = (from c in api.FetchContributions() let BundleType = c.BundleDetails.First().BundleHeader.BundleHeaderType.Description let BundleTypeId = c.BundleDetails.First().BundleHeader.BundleHeaderTypeId group c by new { c.FundId, c.QBSyncID, BundleTypeId, BundleType } into g orderby g.Key.FundId, g.Key.QBSyncID, g.Key.BundleTypeId select new FundTotalInfo { BundleType = g.Key.BundleType, BundleTypeId = g.Key.BundleTypeId, FundId = g.Key.FundId, QBSynced = g.Key.QBSyncID ?? 0, FundName = g.First().ContributionFund.FundName, GeneralLedgerId = g.First().ContributionFund.FundIncomeAccount, Total = g.Sum(t => t.ContributionAmount).Value, Count = g.Count(), model = this }).ToList(); } else { q = (from c in api.FetchContributions() group c by new { c.FundId, c.QBSyncID } into g orderby g.Key.FundId, g.Key.QBSyncID select new FundTotalInfo { FundId = g.Key.FundId, QBSynced = g.Key.QBSyncID ?? 0, FundName = g.First().ContributionFund.FundName, GeneralLedgerId = g.First().ContributionFund.FundIncomeAccount, Total = g.Sum(t => t.ContributionAmount).Value, Count = g.Count(), model = this }).ToList(); } FundTotal = new FundTotalInfo { Count = q.Sum(t => t.Count), Total = q.Sum(t => t.Total), model = this }; return(q); }
public IEnumerable <FundTotalInfo> TotalsByFund() { List <FundTotalInfo> q = null; var api = new APIContributionSearchModel(DbUtil.Db) { model = { StartDate = Dt1, EndDate = Dt2, IncludeUnclosedBundles = IncUnclosedBundles, TaxNonTax = TaxDedNonTax, CampusId = CampusId, Status = ContributionStatusCode.Recorded, Online = Online, FilterByActiveTag = FilterByActiveTag, } }; if (IncludeBundleType) { q = (from c in api.FetchContributions() let BundleType = c.BundleDetails.First().BundleHeader.BundleHeaderType.Description let BundleTypeId = c.BundleDetails.First().BundleHeader.BundleHeaderTypeId group c by new { c.FundId, c.QBSyncID, BundleTypeId, BundleType } into g orderby g.Key.FundId, g.Key.QBSyncID, g.Key.BundleTypeId select new FundTotalInfo { BundleType = g.Key.BundleType, BundleTypeId = g.Key.BundleTypeId, FundId = g.Key.FundId, QBSynced = g.Key.QBSyncID ?? 0, FundName = g.First().ContributionFund.FundName, GeneralLedgerId = g.First().ContributionFund.FundIncomeAccount, Total = g.Sum(t => t.ContributionAmount).Value, Count = g.Count(), model = this }).ToList(); } else { q = (from c in api.FetchContributions() group c by new { c.FundId, c.QBSyncID } into g orderby g.Key.FundId, g.Key.QBSyncID select new FundTotalInfo { FundId = g.Key.FundId, QBSynced = g.Key.QBSyncID ?? 0, FundName = g.First().ContributionFund.FundName, GeneralLedgerId = g.First().ContributionFund.FundIncomeAccount, Total = g.Sum(t => t.ContributionAmount).Value, Count = g.Count(), model = this }).ToList(); } FundTotal = new FundTotalInfo { Count = q.Sum(t => t.Count), Total = q.Sum(t => t.Total), model = this }; return(q); }
public ContributionSearchModel(ContributionSearchInfo m) { api = new APIContributionSearchModel(DbUtil.Db, m); Setup(); }
public ContributionSearchModel() { api = new APIContributionSearchModel(DbUtil.Db); Setup(); }
public ContributionSearchModel(APIContributionSearchModel api) { this.api = api; Setup(); }
public List <LineChartDTO> GetFundChartData(int[] fundIds, int?year) { int CurrentYear = year ?? DateTime.Now.Year; var api = new APIContributionSearchModel(DbUtil.Db); List <LineChartDTO> myFinalList = new List <LineChartDTO>(); var myList = (from c in DbUtil.Db.Contributions where c.ContributionDate.Value.Year == (CurrentYear) group c by new { c.ContributionDate.Value.Month } into grp select new ChartDTO { Name = grp.First().ContributionDate.Value.ToString("MMM", CultureInfo.InvariantCulture), Count = Convert.ToInt32(grp.Sum(t => t.ContributionAmount).Value) }).ToList(); var myList1 = (from ce in DbUtil.Db.Contributions where ce.ContributionDate.Value.Year == (CurrentYear - 1) group ce by new { ce.ContributionDate.Value.Month } into grpc select new ChartDTO { Name = grpc.First().ContributionDate.Value.ToString("MMM", CultureInfo.InvariantCulture), Count = Convert.ToInt32(grpc.Sum(t => t.ContributionAmount).Value) }).ToList(); if (fundIds.IsNotNull()) { if (!(fundIds.Length == 1 && fundIds[0].Equals(0))) { myList = (from c in DbUtil.Db.Contributions where c.ContributionDate.Value.Year == (CurrentYear) && fundIds.Contains(c.FundId) group c by new { c.ContributionDate.Value.Month } into grp select new ChartDTO { Name = grp.First().ContributionDate.Value.ToString("MMM", CultureInfo.InvariantCulture), Count = Convert.ToInt32(grp.Sum(t => t.ContributionAmount).Value) }).ToList(); myList1 = (from ce in DbUtil.Db.Contributions where ce.ContributionDate.Value.Year == (CurrentYear - 1) && fundIds.Contains(ce.FundId) group ce by new { ce.ContributionDate.Value.Month } into grpc select new ChartDTO { Name = grpc.First().ContributionDate.Value.ToString("MMM", CultureInfo.InvariantCulture), Count = Convert.ToInt32(grpc.Sum(t => t.ContributionAmount).Value) }).ToList(); } } var myList3 = DateTimeFormatInfo.InvariantInfo.AbbreviatedMonthNames; var emptytableQuery = (from m in myList3 where m.HasValue() select new ChartDTO { Name = m, Count = 0 }); myFinalList = (from e in emptytableQuery join t in myList on e.Name equals t.Name into tm join s in myList1 on e.Name equals s.Name into sm from rdj in tm.DefaultIfEmpty() from sdj in sm.DefaultIfEmpty() select new LineChartDTO() { ChartName = "MONTHLY GIVING ANALYSIS", CurYear = CurrentYear, PreYear = CurrentYear - 1, Name = e.Name, Count = rdj == null? null : rdj.Count, Count2 = sdj == null ? 0 : sdj.Count }).ToList(); return(myFinalList); }
public ActionResult FundList(TotalsByFundModel model) { return(SimpleContent($@"<pre>{string.Join(",", APIContributionSearchModel.GetCustomFundSetList(CurrentDatabase, model.FundSet))}</pre>")); }