CmsWeb.Areas.OnlineReg.Models.ManagePledgesModel.Confirm C# (CSharp) Method

Confirm() public method

public Confirm ( ) : void
return void
        public void Confirm()
        {
            var staff = DbUtil.Db.StaffPeopleForOrg(orgid);

            var desc = $"{person.Name}; {person.PrimaryAddress}; {person.PrimaryCity}, {person.PrimaryState} {person.PrimaryZip}";

            person.PostUnattendedContribution(DbUtil.Db,
                pledge ?? 0,
                Setting.DonationFundId,
                desc, pledge: true);

            var pi = GetPledgeInfo();
            var body = Setting.Body ?? "no confirmation body found";
            body = body.Replace("{amt}", pi.Pledged.ToString("N2"), ignoreCase: true)
                .Replace("{org}", Organization.OrganizationName, ignoreCase: true)
                .Replace("{first}", person.PreferredName, ignoreCase: true);
            DbUtil.Db.EmailRedacted(staff[0].FromEmail, person, Setting.Subject, body);

            DbUtil.Db.Email(person.FromEmail, staff, "Online Pledge",
                $@"{person.Name} made a pledge to {Organization.OrganizationName}");

            ThankYouMessage = GetThankYouMessage(@"
              <h2>Confirmation</h2>
              <p>
            Thank you {first}, for making your pledge to {org}<br/>
            You should receive a confirmation email shortly.
              </p>
            ");
        }

Usage Example

示例#1
0
		public ActionResult ConfirmPledge(ManagePledgesModel m)
		{
            m.Confirm();
	        SetHeaders(m.orgid);
	        OnlineRegModel.LogOutOfOnlineReg();

            m.Log("Confirm");
			return View("ManagePledge/Confirm", m);
		}