TotalPaid() публичный Метод

public TotalPaid ( CmsData.CMSDataContext db ) : decimal
db CmsData.CMSDataContext
Результат decimal
Пример #1
0
        private static void SummarizePayment(Transaction ti, OrganizationMember om, StringBuilder sb)
        {
            if ((ti.Amt ?? 0) == 0 || om == null)
                return;

            var ts = om.TransactionSummary(DbUtil.Db);
            if (ts != null)
                sb.AppendFormat(@"
            <tr><td colspan='2'>
            <table cellpadding=4>
            <tr>
            <td>Registrant Fee</td>
            <td>Amount Paid</td>
            <td>Amount Due</td>
            </tr>
            <tr>
            <td align='right'>{0}</td>
            <td align='right'>{1}</td>
            <td align='right'>{2}</td>
            </tr>
            </table>
            </td></tr>
            ", ts.IndAmt.ToString2("c"),
                    om.TotalPaid(DbUtil.Db).ToString("c"),
                    om.AmountDue(DbUtil.Db).ToString("c"));
        }
Пример #2
0
 private void Populate()
 {
     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.RegSetting,
                      mm.Organization,
                      mm.OrgMemMemTags,
                      mm.Organization.IsMissionTrip
                  }).SingleOrDefault();
     if (i == null)
         throw new Exception("missing OrgMember at oid={0}, pid={0}".Fmt(OrgId, PeopleId));
     om = i.mm;
     this.CopyPropertiesFrom(om);
     Name = i.Name;
     AmountPaidTransactions = om.TotalPaid(DbUtil.Db);
     OrgName = i.OrganizationName;
     Organization = i.Organization;
     OrgMemMemTags = i.OrgMemMemTags.ToList();
     IsMissionTrip = i.IsMissionTrip ?? false;
     Setting = new Settings(i.RegSetting, DbUtil.Db, OrgId.Value);
 }
Пример #3
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;
            if (TransactionSummary != null)
            {
                AmountPaidTransactions = IsMissionTrip
                    ? om.TotalPaid(DbUtil.Db)
                    : TransactionSummary.IndPaid;
                AmountDue = IsMissionTrip
                    ? om.AmountDue(DbUtil.Db)
                    : TransactionSummary.IndDue;
            }

            OrgName = i.OrganizationName;
            Organization = i.Organization;
            OrgMemMemTags = i.OrgMemMemTags.ToList();
            Setting = DbUtil.Db.CreateRegistrationSettings(OrgId ?? 0);
        }