protected void processRefund() { using (var api = GetServiceAPIProxy()) { targetRefund = api.ProcessRefund(targetRefund).ResultValue.ConvertTo <msRefund>(); // now, send a confirmation email api.SendEmail(EmailTemplates.Financial.RefundRequest, new List <string> { targetRefund.ID }, ConciergeAPI.CurrentUser.EmailAddress); } }
/// <summary> /// Initializes the target object for the page /// </summary> /// <remarks>Many pages have "target" objects that the page operates on. For instance, when viewing /// an event, the target object is an event. When looking up a directory, that's the target /// object. This method is intended to be overriden to initialize the target object for /// each page that needs it.</remarks> protected override void InitializeTargetObject() { base.InitializeTargetObject(); targetEntity = string.IsNullOrWhiteSpace(ContextID) ? CurrentEntity : LoadObjectFromAPI <msEntity>(ContextID); if (targetEntity == null) { GoToMissingRecordPage(); return; } targetRefund = CreateNewObject <msRefund>(); targetRefund.RefundTo = targetEntity.ID; targetRefund.Date = DateTime.UtcNow; }