/// <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(); targetRegistration = LoadObjectFromAPI <msEventRegistration>(ContextID); if (targetRegistration == null) { GoToMissingRecordPage(); return; } targetEvent = LoadObjectFromAPI <msEvent>(targetRegistration.Event); targetEntity = LoadObjectFromAPI <msEntity>(targetRegistration.Owner); if (targetEvent == null || targetEntity == null) { GoToMissingRecordPage(); return; } if (!targetEvent.AllowRegistrantsToChangeSessions || (targetEvent.DeadlineForChangingSessions.HasValue && targetEvent.DeadlineForChangingSessions < DateTime.Now) || !EventLogic.HasSessions(targetEvent.ID)) { liChangeSessions.Visible = false; } initializeRegistrationFields(); createdBy = LoadObjectFromAPI <msUser>(targetRegistration.CreatedBy); status = getStatus(); loadEventOwners(); }
/// <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(); var target = APIExtensions.LoadObjectFromAPI(ContextID); if (target == null) { GoToMissingRecordPage(); return; } // If we are starting with a Registration, go to that setup process if (target.ClassType == msEventRegistration.CLASS_NAME) { targetRegistration = target.ConvertTo <msEventRegistration>(); LoadExistingRegistration(); return; } // If this is not a Registration or an Event, then get out of here if (target.ClassType != msEvent.CLASS_NAME) { GoToMissingRecordPage(); return; } targetEvent = target.ConvertTo <msEvent>(); targetOrder = MultiStepWizards.RegisterForEvent.Order; targetRegistrationFee = MultiStepWizards.RegisterForEvent.RegistrationFee; MultiStepWizards.RegisterForEvent.IsSessionSwap = false; if (targetOrder == null || string.IsNullOrWhiteSpace(targetOrder.BillTo) || string.IsNullOrWhiteSpace(targetOrder.ShipTo) || targetRegistrationFee == null) { GoTo(string.Format("~/events/Register_SelectFee.aspx?contextID={0}", targetEvent.ID)); return; } registrantId = targetOrder.BillTo; if (string.IsNullOrEmpty(registrantId)) { GoToMissingRecordPage(); return; } loadEventOwners(); }
/// <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(); targetEventRegistration = LoadObjectFromAPI <msEventRegistration>(ContextID); if (targetEventRegistration == null) { GoToMissingRecordPage(); return; } targetEvent = LoadObjectFromAPI <msEvent>(targetEventRegistration.Event); targetOwner = LoadObjectFromAPI <msEntity>(targetEventRegistration.Owner); if (targetOwner == null || targetEvent == null) { GoToMissingRecordPage(); return; } loadEventOwners(); }
protected void unbindAndSaveEventRegistration() { unbindEventRegistration(); targetEventRegistration = SaveObject(targetEventRegistration).ConvertTo <msEventRegistration>(); }
protected void lbCancelRegistration_Click(object sender, EventArgs e) { targetRegistration.CancellationDate = DateTime.UtcNow; targetRegistration = SaveObject(targetRegistration).ConvertTo <msEventRegistration>(); }