Esempio n. 1
0
 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());
     }
 }
Esempio n. 2
0
        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));
 }
Esempio n. 4
0
 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();
     }
 }
Esempio n. 5
0
 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);
 }
Esempio n. 10
0
 private void detach_Contributions(Contribution entity)
 {
     this.SendPropertyChanging();
     entity.ContributionStatus = null;
 }
Esempio n. 11
0
 private void detach_Contributions(Contribution entity)
 {
     this.SendPropertyChanging();
     entity.ContributionStatus = null;
 }
Esempio n. 12
0
 private void attach_Contributions(Contribution entity)
 {
     this.SendPropertyChanging();
     entity.ContributionType = this;
 }
Esempio n. 13
0
 private void attach_Contributions(Contribution entity)
 {
     this.SendPropertyChanging();
     entity.ContributionFund = this;
 }
Esempio n. 14
0
 public BundleHeader GetBundleHeader(DateTime date, DateTime now, int?btid = null)
 {
     return(Contribution.GetBundleHeader(db, date, now, btid));
 }
Esempio n. 15
0
 private void detach_Contributions(Contribution entity)
 {
     this.SendPropertyChanging();
     entity.ExtraDatum = null;
 }
Esempio n. 16
0
 private void detach_Contributions(Contribution entity)
 {
     this.SendPropertyChanging();
     entity.ExtraDatum = null;
 }