private List <ChartDTO> GetChartContributions(CMSDataContext db, int year, int[] fundIds = null) { if (fundIds.IsNotNull()) { return((from c in Contribution.GetContributionsPerYear(db, year, fundIds) 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()); } else { return((from c in Contribution.GetContributionsPerYear(db, year) 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()); } }
public static List <Contribution> GetContributionsPerYear(CMSDataContext db, int?year, int[] fundids = null, bool includeReturnedReversed = false, bool includePledges = false) { var yearFlag = year.IsNull(); return((from c in Contribution.GetContributions(db, fundids, includeReturnedReversed, includePledges) where (!yearFlag ? c.ContributionDate.Value.Year == (year) : 1 == 1) select c).ToList()); }
public BundleHeader GetBundleHeader( DateTime date, DateTime now, int?btid = null, DateTime?depositDate = null, decimal?bundleTotal = null) { return(Contribution.GetBundleHeader(db, date, now, btid, depositDate, bundleTotal)); }
protected void ListView1_ItemCommand(object sender, ListViewCommandEventArgs e) { if (e.CommandName.StartsWith("Re")) { var id = e.CommandArgument.ToInt(); var c = DbUtil.Db.Contributions.Single(ic => ic.ContributionId == id); var now = Util.Now; var r = new Contribution { ContributionStatusId = ContributionStatusCode.Recorded, CreatedBy = Util.UserId1, CreatedDate = now, PeopleId = c.PeopleId, ContributionAmount = c.ContributionAmount, ContributionDate = now.Date, PostingDate = now, FundId = c.FundId, }; DbUtil.Db.Contributions.InsertOnSubmit(r); switch (e.CommandName) { case "Reverse": c.ContributionStatusId = ContributionStatusCode.Reversed; r.ContributionTypeId = ContributionTypeCode.Reversed; r.ContributionDesc = "Reversed Contribution Id = " + c.ContributionId; break; case "Return": c.ContributionStatusId = ContributionStatusCode.Returned; r.ContributionTypeId = ContributionTypeCode.ReturnedCheck; r.ContributionDesc = "Returned Check for Contribution Id = " + c.ContributionId; break; } DbUtil.Db.SubmitChanges(); ListView1.DataBind(); } }
private static Contribution CreateContributionRecord(Contribution c) { var now = Util.Now; var r = new Contribution { ContributionStatusId = ContributionStatusCode.Recorded, CreatedBy = Util.UserId1, CreatedDate = now, PeopleId = c.PeopleId, ContributionAmount = c.ContributionAmount, ContributionDate = now.Date, PostingDate = now, FundId = c.FundId, }; return r; }
public BundleDetail AddContributionDetail(DateTime date, int fundid, string amount, string checkno, string routing, string account, int contributionTypeId, int?pid = null, string description = null) { return(Contribution.AddContributionDetail(db, date, fundid, amount, checkno, routing, account, contributionTypeId, pid, description)); }
public BundleDetail AddContributionDetail(DateTime date, int fundid, string amount, string checkno, string routing, string account) { return(Contribution.AddContributionDetail(db, date, fundid, amount, checkno, routing, account)); }
public BundleDetail AddContribution(DateTime date, int fundid, string amount, string checkno, string description, int peopleid, int contributionTypeId) { return(Contribution.AddContribution(db, date, fundid, amount, checkno, description, peopleid, contributionTypeId)); }
public void FinishBundle(BundleHeader bh) { Contribution.FinishBundle(db, bh); }
private void detach_Contributions(Contribution entity) { this.SendPropertyChanging(); entity.ContributionStatus = null; }
private void attach_Contributions(Contribution entity) { this.SendPropertyChanging(); entity.ContributionType = this; }
private void attach_Contributions(Contribution entity) { this.SendPropertyChanging(); entity.ContributionFund = this; }
public BundleHeader GetBundleHeader(DateTime date, DateTime now, int?btid = null) { return(Contribution.GetBundleHeader(db, date, now, btid)); }
private void detach_Contributions(Contribution entity) { this.SendPropertyChanging(); entity.ExtraDatum = null; }