Example #1
0
        private void Populate()
        {
            if (dopopulate)
            {
                dopopulate = false;
                if (!OrgId.HasValue || !PeopleId.HasValue)
                {
                    return;
                }
            }
            var i = (from mm in DbUtil.Db.OrganizationMembers
                     where mm.OrganizationId == OrgId && mm.PeopleId == PeopleId
                     select new
            {
                mm,
                mm.Person.Name,
                mm.Organization.OrganizationName,
                mm.Organization,
                mm.OrgMemMemTags,
                mm.Organization.IsMissionTrip,
                ts = DbUtil.Db.ViewTransactionSummaries.SingleOrDefault(tt => tt.RegId == mm.TranId && tt.PeopleId == PeopleId && tt.OrganizationId == OrgId)
            }).SingleOrDefault();

            if (i == null)
            {
                throw new Exception($"missing OrgMember at oid={OrgId}, pid={PeopleId}");
            }
            om = i.mm;
            TransactionSummary = i.ts;
            this.CopyPropertiesFrom(om);
            Name = i.Name;

            IsMissionTrip = i.IsMissionTrip ?? false;
            AmtFee        = i.ts?.IndPaid + i.ts?.IndDue;
            AmtDonation   = i.ts?.IndAmt - AmtFee;
            AmtPaid       = om.AmountPaidTransactions(DbUtil.Db);
            AmtDue        = om.AmountDueTransactions(DbUtil.Db);

            OrgName       = i.OrganizationName;
            Organization  = i.Organization;
            OrgMemMemTags = i.OrgMemMemTags.ToList();
            Setting       = DbUtil.Db.CreateRegistrationSettings(OrgId ?? 0);
        }
Example #2
0
        private void Populate()
        {
            if (dopopulate)
            {
                dopopulate = false;
                if (!OrgId.HasValue || !PeopleId.HasValue)
                    return;
            }
            var i = (from mm in DbUtil.Db.OrganizationMembers
                     where mm.OrganizationId == OrgId && mm.PeopleId == PeopleId
                     select new
                     {
                         mm,
                         mm.Person.Name,
                         mm.Organization.OrganizationName,
                         mm.Organization,
                         mm.OrgMemMemTags,
                         mm.Organization.IsMissionTrip,
                         ts = DbUtil.Db.ViewTransactionSummaries.SingleOrDefault(tt => tt.RegId == mm.TranId && tt.PeopleId == PeopleId && tt.OrganizationId == OrgId)
                     }).SingleOrDefault();
            if (i == null)
                throw new Exception($"missing OrgMember at oid={OrgId}, pid={PeopleId}");
            OrgMember = i.mm;
            TransactionSummary = i.ts;
            this.CopyPropertiesFrom(OrgMember);
            Name = i.Name;

            IsMissionTrip = i.IsMissionTrip ?? false;
            AmtFee = i.ts?.IndPaid + i.ts?.IndDue;
            AmtDonation = i.ts?.IndAmt - AmtFee;
            AmtCoupon = i.ts?.TotCoupon;
            AmtPaid = OrgMember.AmountPaidTransactions(DbUtil.Db);
            AmtDue = OrgMember.AmountDueTransactions(DbUtil.Db);

            OrgName = i.OrganizationName;
            Organization = i.Organization;
            OrgMemMemTags = i.OrgMemMemTags.ToList();
            Setting = DbUtil.Db.CreateRegistrationSettings(OrgId ?? 0);
        }
 public TransactionSummary TransactionSummary(CMSDataContext db)
 {
     if (transactionSummaryLoaded)
         return transactionSummary;
     transactionSummary = db.ViewTransactionSummaries.SingleOrDefault(tt => tt.RegId == TranId && tt.PeopleId == PeopleId);
     transactionSummaryLoaded = true;
     return transactionSummary;
 }
        private void Populate()
        {
            if (dopopulate)
            {
                dopopulate = false;
                if (!OrgId.HasValue || !PeopleId.HasValue)
                    return;
            }
            var i = (from et in DbUtil.Db.EnrollmentTransactions
                where et.OrganizationId == OrgId && et.PeopleId == PeopleId
                where et.TransactionTypeId == 5
                orderby et.TransactionDate descending
                select new
                {
                    et,
                    et.Person.Name,
                    et.Organization.OrganizationName,
                    et.Organization,
                    et.SmallGroups,
                    ts = DbUtil.Db.ViewTransactionSummaries.SingleOrDefault(
                        ts => ts.RegId == et.TranId && ts.PeopleId == PeopleId && ts.OrganizationId == OrgId)
                }
            ).FirstOrDefault();

            if (i == null)
                throw new Exception($"missing PrevOrgMember at oid={OrgId}, pid={PeopleId}");
            PrevMember = i.et;
            TransactionSummary = i.ts;
            this.CopyPropertiesFrom(PrevMember);
            Name = i.Name;

            AmtFee = i.ts?.IndPaid + i.ts?.IndDue;
            AmtDonation = i.ts?.IndAmt - AmtFee;
            AmtCoupon = i.ts?.TotCoupon;

            OrgName = i.OrganizationName;
            Organization = i.Organization;
            OrgMemMemTags = i.SmallGroups.SplitStr("\n").ToList();
            Setting = DbUtil.Db.CreateRegistrationSettings(OrgId ?? 0);
        }
Example #5
0
 public TransactionSummary TransactionSummary()
 {
     if(transactionSummary == null)
         transactionSummary = DbUtil.Db.ViewTransactionSummaries.SingleOrDefault(tt => tt.RegId == Transaction.OriginalId && tt.PeopleId == List[0].PeopleId);
     return transactionSummary;
 }