protected void btnSave_Click(object sender, EventArgs e) { if (!IsValid) { return; } if (targetCredit == null) { targetCredit = new msCEUCredit(); } targetCredit.Type = ddlType.SelectedValue; targetCredit.Quantity = decimal.Parse(tbQuantity.Text); targetCredit.Notes = tbNotes.Text; targetCredit.CreditDate = dpDate.SelectedDate.Value; targetCredit.Verified = false; targetCredit.SelfReported = true; targetCredit.Owner = ConciergeAPI.CurrentEntity.ID; // save the credit SaveObject(targetCredit); GoTo("ViewCEUCreditHistory.aspx", "Your CEU credits were recorded successfully."); }
protected override void InitializeTargetObject() { base.InitializeTargetObject(); if (ContextID != null) { targetCredit = LoadObjectFromAPI <msCEUCredit>(ContextID); } }
protected void wzComponent_OnFinishButtonClick(object sender, WizardNavigationEventArgs e) { if (!IsValid) { e.Cancel = true; return; } msCertificationComponentRegistration r = CreateNewObject <msCertificationComponentRegistration>(); r["StartDate"] = dpDateOfAttendance.SelectedDate; r.Student = ConciergeAPI.CurrentEntity.ID; r.Component = hfComponentID.Value; r.DigitalSignature = tbDigitalSignature.Text; r.Verified = PortalConfiguration.CurrentConfig.ComponentSelfReportingMode == CertificationsSelfReportingMode.AllowVerified; r.ParticipationPercentage = 100; if (pnlAttendance.Visible && rbPartial.Checked) { r.ParticipationPercentage = int.Parse(tbPercentage.Text); } // let's figure out how many CEU credits to give // load the component first msCertificationComponent c = LoadObjectFromAPI <msCertificationComponent>(hfComponentID.Value); r = SaveObject(r); // now, save the CEU credits if (c.CEUCredits != null) { foreach (var credit in c.CEUCredits) { msCEUCredit cc = CreateNewObject <msCEUCredit>(); cc.Owner = r.Student; cc.ComponentRegistration = r.ID; cc.CreditDate = c.StartDate ?? DateTime.Today; cc.Quantity = credit.Quantity * ((decimal)r.ParticipationPercentage / 100M); cc.Type = credit.Type; cc.Verified = r.Verified; SaveObject(cc); // assign the credit } } QueueBannerMessage("Your component registration was saved successfully."); if (PortalConfiguration.CurrentConfig.ShowComponentRegistrationsInPortal) { GoTo("ViewMyComponents.aspx"); } else { GoHome(); } }