/// <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(); targetRegistrationFee = MultiStepWizards.RegisterForEvent.RegistrationFee; targetAdditionalItems = MultiStepWizards.RegisterForEvent.AdditionalLineItems; if (MultiStepWizards.RegisterForEvent.Order == null || targetRegistrationFee == null) { Restart(); return; } targetEvent = LoadObjectFromAPI <msEvent>(targetRegistrationFee.Event); //Clone the order held in the session initializeClonedOrder(); if (string.IsNullOrWhiteSpace(targetOrder.BillTo) || string.IsNullOrWhiteSpace(targetOrder.ShipTo)) { GoTo(string.Format("~/events/Register_SelectFee.aspx?contextID={0}", ContextID)); return; } initializeRegistrationFields(); }
public static bool IsGroupRegistrationOpen(msEvent targetEvent) { if (targetEvent.AllowGroupRegistrationsFrom != null) { if (targetEvent.AllowGroupRegistrationsFrom > DateTime.Today) { return(false); } } else if (targetEvent.RegistrationOpenDate != null) { if (targetEvent.RegistrationOpenDate > DateTime.Today) { return(false); } } if (targetEvent.AllowGroupRegistrationsUntil != null) { if (targetEvent.AllowGroupRegistrationsUntil < DateTime.Today) { return(false); } } else if (targetEvent.RegistrationCloseDate != null && targetEvent.RegistrationCloseDate < DateTime.Today) { return(false); } return(targetEvent.EndDate > DateTime.Today); }
static void Main(string[] args) { MemberSuiteAPI msAPI = new MemberSuiteAPI("https://rest-blue-internal.financial.membersuite.com", "hj2", "Password1!", "77vb3ihs1lrpoee0fc0q415iub", "27969"); msOrganization a = msAPI.GraphQLQueries.RunGetOrganization("8902ce52-0007-cb23-a2a8-0b39828645e9"); msEvent b = msAPI.GraphQLQueries.RunGetEvent("8902ce52-0078-c450-0978-0b3f2d50b2e2", "8902ce52-0006-c741-3888-0b3f474d7ca2"); msIndividual c = msAPI.GraphQLQueries.RunGetIndividual("8902ce52-0006-c741-3888-0b3f474d7ca2"); msMerchandisesearch d = msAPI.GraphQLQueries.RunGetMerchandise("21", "0", "2019-02-11T13:55:44.703Z", "2019-02-11T13:55:44.703Z", "8902ce52-0006-c255-d1de-0b3f327d1b78"); msEventregistrationforuser e = msAPI.GraphQLQueries.RunGetEventRegistrationForUser("8902ce52-0006-c255-d1de-0b3f327d1b78"); }
/// <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(); targetEvent = LoadObjectFromAPI <msEvent>(ContextID); if (targetEvent == null) { GoToMissingRecordPage(); } }
/// <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(); targetEvent = LoadObjectFromAPI <msEvent>(ContextID); if (targetEvent == null) { GoToMissingRecordPage(); return; } targetEntity = ConciergeAPI.CurrentEntity; }
/// <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(); targetHistoricalTransaction = LoadObjectFromAPI <msHistoricalTransaction>(ContextID); targetEvent = LoadObjectFromAPI <msEvent>(EventId); if (targetHistoricalTransaction == null || targetEvent == null) { GoToMissingRecordPage(); } 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(); //Describe a Historical Transaction. We will need this metadata to bind to the acceptable values for certain fields and for creating a new event using (IConciergeAPIService proxy = GetConciegeAPIProxy()) { historicalTransactionClassMetadata = proxy.DescribeObject(msHistoricalTransaction.CLASS_NAME).ResultValue; historicalTransactionFieldMetadata = historicalTransactionClassMetadata.GenerateFieldDictionary(); } var contextObject = APIExtensions.LoadObjectFromAPI(ContextID); if (contextObject == null) { GoToMissingRecordPage(); return; } switch (contextObject.ClassType) { case msOrder.CLASS_NAME: targetOrder = contextObject.ConvertTo <msOrder>(); targetHistoricalTransaction = msHistoricalTransaction.FromClassMetadata(historicalTransactionClassMetadata); targetHistoricalTransaction.Type = HistoricalTransactionType.Payment; break; case msHistoricalTransaction.CLASS_NAME: targetHistoricalTransaction = contextObject.ConvertTo <msHistoricalTransaction>(); targetOrder = LoadObjectFromAPI <msOrder>(targetHistoricalTransaction.Order); break; default: QueueBannerError(string.Format("Unknown context object type supplied '{0}'.", contextObject.ClassType)); GoHome(); return; } targetEvent = LoadObjectFromAPI <msEvent>(EventId); if (targetOrder == null || targetHistoricalTransaction == null || targetEvent == null) { GoToMissingRecordPage(); return; } loadEventOwners(); }
public static void NavigateBackToGroupRegistrationIfApplicable(string eventID) { var o = Group; if (o == null || string.IsNullOrWhiteSpace(o.ID)) { return; } Order = null; Group = null; Event = null; HttpContext.Current.Response.Redirect(string.Format("ManageGroupRegistration.aspx?contextID={0}&organizationID={1}", eventID, o.ID)); }
/// <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(); targetEvent = LoadObjectFromAPI <msEvent>(ContextID); if (targetEvent == null) { GoToMissingRecordPage(); return; } buildSearchManifest(); 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(); targetEvent = LoadObjectFromAPI <msEvent>(ContextID); if (targetEvent == null) { GoToMissingRecordPage(); return; } onlyShowGuestSpouseRegistrations = Request.QueryString["guestOnly"] == "true"; targetOrder = new msOrder(); if (!string.IsNullOrWhiteSpace(EntityId)) { targetEntity = LoadObjectFromAPI <msEntity>(EntityId); if (targetEntity == null) { GoToMissingRecordPage(); return; } } else { targetEntity = ConciergeAPI.CurrentEntity; } targetOrder.BillTo = targetOrder.ShipTo = targetEntity.ID; if (!string.IsNullOrWhiteSpace(targetEvent.Chapter)) { targetChapter = LoadObjectFromAPI <msChapter>(targetEvent.Chapter); } if (!string.IsNullOrWhiteSpace(targetEvent.Section)) { targetSection = LoadObjectFromAPI <msSection>(targetEvent.Section); } if (!string.IsNullOrWhiteSpace(targetEvent.OrganizationalLayer)) { targetOrganizationalLayer = LoadObjectFromAPI <msOrganizationalLayer>(targetEvent.OrganizationalLayer); } }
/// <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(); //Describe an Event Discount Code. We will need this metadata to bind to the acceptable values for certain fields and for creating a new Discount / Promo Code using (IConciergeAPIService proxy = GetConciegeAPIProxy()) { emailTemplateContainerClassMetadata = proxy.DescribeObject(msEmailTemplateContainer.CLASS_NAME).ResultValue; emailTemplateContainerFieldMetadata = emailTemplateContainerClassMetadata.GenerateFieldDictionary(); } var contextObject = APIExtensions.LoadObjectFromAPI(ContextID); if (contextObject.ClassType == msEvent.CLASS_NAME) { targetEvent = contextObject.ConvertTo <msEvent>(); targetEmailTemplateContainer = msEmailTemplateContainer.FromClassMetadata(emailTemplateContainerClassMetadata); targetEmailTemplateContainer.Template = new EmailTemplate { SearchType = "EventRegistration" }; lblTitleAction.Text = "Create"; } else { targetEmailTemplateContainer = contextObject.ConvertTo <msEmailTemplateContainer>(); targetEvent = LoadObjectFromAPI <msEvent>(targetEmailTemplateContainer.Context); if (targetEmailTemplateContainer.Template == null) { targetEmailTemplateContainer.Template = new EmailTemplate { SearchType = "EventRegistration" } } ; lblTitleAction.Text = "Edit"; } if (targetEvent == null || targetEmailTemplateContainer == null) { GoToMissingRecordPage(); return; } targetEmailTemplateContainer.Context = targetEmailTemplateContainer.Template.SearchContext = targetEvent.ID; 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(); targetEvent = LoadObjectFromAPI <msEvent>(ContextID); if (targetEvent == null) { GoToMissingRecordPage(); } targetOrganization = LoadObjectFromAPI <msOrganization>(Request.QueryString["organizationID"]); if (targetOrganization == null) { GoToMissingRecordPage(); } }
/// <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(); //Describe an Event Discount Code. We will need this metadata to bind to the acceptable values for certain fields and for creating a new Discount / Promo Code using (IConciergeAPIService proxy = GetConciegeAPIProxy()) { customFieldClassMetadata = proxy.DescribeObject(msCustomField.CLASS_NAME).ResultValue; customFieldFieldMetadata = customFieldClassMetadata.GenerateFieldDictionary(); } var contextObject = APIExtensions.LoadObjectFromAPI(ContextID); if (contextObject.ClassType == msEvent.CLASS_NAME) { targetEvent = contextObject.ConvertTo <msEvent>(); targetCustomField = msCustomField.FromClassMetadata(customFieldClassMetadata); targetCustomField.FieldDefinition = new FieldMetadata(); lblTitleAction.Text = "Create"; isInEditMode = false; } else { targetCustomField = contextObject.ConvertTo <msCustomField>(); targetEvent = LoadObjectFromAPI <msEvent>(targetCustomField.Event); if (targetCustomField.FieldDefinition == null) { targetCustomField.FieldDefinition = new FieldMetadata(); } lblTitleAction.Text = "Edit"; isInEditMode = true; } if (targetEvent == null || targetCustomField == null) { GoToMissingRecordPage(); return; } targetCustomField.Event = targetEvent.ID; targetCustomField.ApplicableType = "DEMOGRAPHIC"; targetCustomField.Type = CustomFieldType.EventRegistration; loadEventOwners(); }
protected void loadDataFromConcierge(IConciergeAPIService serviceProxy) { targetEvent = serviceProxy.LoadObjectFromAPI <msEvent>(ContextID); loadEventOwners(serviceProxy); var searches = new List <Search>(); // Event information links related to current event var sEventLinks = new Search { Type = msEventInformationLink.CLASS_NAME }; sEventLinks.AddOutputColumn("ID"); sEventLinks.AddOutputColumn("Name"); sEventLinks.AddCriteria(Expr.Equals("IsActive", 1)); sEventLinks.AddCriteria(Expr.Equals("Event.ID", ContextID)); sEventLinks.AddSortColumn("DisplayOrder"); searches.Add(sEventLinks); //If we're logged in search for event registrations for the current entity if (ConciergeAPI.CurrentEntity != null) { Search sRegistrations = new Search { Type = msEventRegistration.CLASS_NAME, ID = "Registrations" }; sRegistrations.AddOutputColumn("ID"); sRegistrations.AddOutputColumn("Name"); sRegistrations.AddOutputColumn("Fee.Name"); sRegistrations.AddOutputColumn("Fee.IsGuestRegistration"); sRegistrations.AddOutputColumn("CreatedDate"); sRegistrations.AddCriteria(Expr.Equals("Owner.ID", ConciergeAPI.CurrentEntity.ID)); sRegistrations.AddCriteria(Expr.Equals("Event.ID", ContextID)); sRegistrations.AddCriteria(Expr.IsBlank(msRegistrationBase.FIELDS.CancellationDate)); searches.Add(sRegistrations); } var searchResults = APIExtensions.GetMultipleSearchResults(searches, 0, null); dvEventLinks = new DataView(searchResults[0].Table); if (searchResults.Exists(x => x.ID == "Registrations")) { dvRegistrations = new DataView(searchResults.Single(x => x.ID == "Registrations").Table); } }
/// <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(); targetWaivedRegistrationList = LoadObjectFromAPI <msWaivedRegistrationList>(ContextID); if (targetWaivedRegistrationList == null) { GoToMissingRecordPage(); return; } targetEvent = LoadObjectFromAPI <msEvent>(targetWaivedRegistrationList.Event); if (targetEvent == null) { 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(); var contextObject = APIExtensions.LoadObjectFromAPI(ContextID); switch (contextObject.ClassType) { case msEvent.CLASS_NAME: targetEvent = LoadObjectFromAPI <msEvent>(ContextID); targetAbstract = new msAbstract { Owner = ConciergeAPI.CurrentEntity.ID, Event = targetEvent.ID }; break; case msAbstract.CLASS_NAME: targetAbstract = LoadObjectFromAPI <msAbstract>(ContextID); if (targetAbstract == null) { GoToMissingRecordPage(); return; } targetEvent = LoadObjectFromAPI <msEvent>(targetAbstract.Event); break; default: QueueBannerError("Invalid context supplied."); GoHome(); return; } if (targetEvent == null) { GoToMissingRecordPage(); return; } }
public static bool IsRegistrationClosed(msEvent targetEvent) { if (targetEvent.IsClosed) { return(true); } if (targetEvent.RegistrationMode == EventRegistrationMode.Disabled) { return(true); } if (targetEvent.RegistrationCloseDate == null) { return(false); } TimeZoneInfo tzi; try { tzi = TimeZoneInfo.FindSystemTimeZoneById(targetEvent.TimeZone); } catch { tzi = TimeZoneInfo.Local; } // MS-4745 - let's take the current time and convert it to the time of the event DateTime eventCurrentDate = TimeZoneInfo.ConvertTime(DateTime.UtcNow, tzi); // now, compare it if (eventCurrentDate > targetEvent.RegistrationCloseDate) { return(true); } return(false); }
/// <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(); }
/// <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(); targetSearch = MultiStepWizards.SearchEventRegistrations.SearchBuilder.Search.Clone(); if (targetSearch == null) { GoTo(string.Format("~/events/SearchEventRegistrations_Criteria.aspx?contextID={0}", ContextID)); return; } targetEvent = LoadObjectFromAPI <msEvent>(ContextID); if (targetEvent == null) { GoToMissingRecordPage(); return; } addRequiredSearchParameters(); 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(); //Describe an Event Information Link. We will need this metadata to bind to the acceptable values for certain fields and for creating a new Information link using (IConciergeAPIService proxy = GetConciegeAPIProxy()) { eventInformationLinkClassMetadata = proxy.DescribeObject(msEventInformationLink.CLASS_NAME).ResultValue; eventInformationLinkFieldMetadata = eventInformationLinkClassMetadata.GenerateFieldDictionary(); } var contextObject = APIExtensions.LoadObjectFromAPI(ContextID); if (contextObject.ClassType == msEvent.CLASS_NAME) { targetEvent = contextObject.ConvertTo <msEvent>(); targetEventInformationLink = msEventInformationLink.FromClassMetadata(eventInformationLinkClassMetadata); lblTitleAction.Text = "Create"; } else { targetEventInformationLink = contextObject.ConvertTo <msEventInformationLink>(); targetEvent = LoadObjectFromAPI <msEvent>(targetEventInformationLink.Event); lblTitleAction.Text = "Edit"; } if (targetEvent == null || targetEventInformationLink == null) { GoToMissingRecordPage(); return; } targetEventInformationLink.Event = targetEvent.ID; loadEventOwners(); }
protected void loadDataFromConcierge(IConciergeAPIService serviceProxy) { targetEvent = serviceProxy.LoadObjectFromAPI <msEvent>(ContextID); targetEventInformationLink = serviceProxy.LoadObjectFromAPI <msEventInformationLink>(EventInformationLinkID); }
private void initializePendingRegistrations() { var group = MultiStepWizards.GroupRegistration.Group; msEvent ev = MultiStepWizards.GroupRegistration.Event; var order = MultiStepWizards.GroupRegistration.Order; if (group == null || group.ID != targetOrganization.ID) // no group, or wrong group { return; } if (ev == null || ev.ID != targetEvent.ID) // no event or wrong event { return; } if (order == null || order.LineItems == null || order.LineItems.Count == 0) { return; } var api = GetConciegeAPIProxy(); // now, process the order to get prices order = api.PreProcessOrder(order).ResultValue.FinalizedOrder.ConvertTo <msOrder>(); DataTable dt = new DataTable(); dt.Columns.Add("ID"); dt.Columns.Add("LocalID"); dt.Columns.Add("Name"); dt.Columns.Add("Fee"); dt.Columns.Add("Cost", typeof(decimal)); DataRow currentRow = null; foreach (msOrderLineItem li in order.LineItems) { // now, do we have an override specified - or, is it duped? msIndividual i = LoadObjectFromAPI <msIndividual>(li.OverrideShipTo); if (i == null) { continue; } // this code assumes the registration fee is first if (currentRow == null || Convert.ToString(currentRow["ID"]) != i.ID) // new row { currentRow = dt.NewRow(); dt.Rows.Add(currentRow); currentRow["LocalID"] = i.LocalID; currentRow["Name"] = i.Name; var productName = api.GetName(li.Product).ResultValue; currentRow["Fee"] = productName; currentRow["Cost"] = li.Total; currentRow["ID"] = i.ID; } else { currentRow["Cost"] = (decimal)currentRow["Cost"] + li.Total; // increment the fee } } gvPendingRegistrations.DataSource = dt; gvPendingRegistrations.DataBind(); btnCompleteGroup.Visible = true; pnlPending.Visible = true; lblTotalPending.Text = order.LineItems.Sum(x => x.Total).ToString("C"); }
protected void unbindAndSaveEvent() { unbindEvent(); targetEvent = SaveObject(targetEvent).ConvertTo <msEvent>(); }
/// <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(); //Describe an event. We will need this metadata to bind to the acceptable values for certain fields and for creating a new event using (IConciergeAPIService proxy = GetConciegeAPIProxy()) { eventClassMetadata = proxy.DescribeObject(msEvent.CLASS_NAME).ResultValue; eventFieldMetadata = eventClassMetadata.GenerateFieldDictionary(); } targetEvent = msEvent.FromClassMetadata(eventClassMetadata); if (!string.IsNullOrWhiteSpace(ContextID)) { //Load the context object and determine the owner from the class type var contextobject = APIExtensions.LoadObjectFromAPI(ContextID); if (contextobject == null) { GoToMissingRecordPage(); return; } switch (contextobject.ClassType) { case msChapter.CLASS_NAME: targetChapter = contextobject.ConvertTo <msChapter>(); targetEvent.Chapter = ContextID; break; case msSection.CLASS_NAME: targetSection = contextobject.ConvertTo <msSection>(); targetEvent.Section = ContextID; break; case msOrganizationalLayer.CLASS_NAME: targetOrganizationalLayer = contextobject.ConvertTo <msOrganizationalLayer>(); targetEvent.OrganizationalLayer = ContextID; break; case msEvent.CLASS_NAME: targetEvent = LoadObjectFromAPI <msEvent>(ContextID); IsInEditMode = true; if (targetEvent == null) { GoToMissingRecordPage(); return; } break; default: QueueBannerError(string.Format("Invalid context object type specified '{0}'", contextobject.ClassType)); GoHome(); return; } } if (!string.IsNullOrWhiteSpace(targetEvent.Chapter)) { targetChapter = LoadObjectFromAPI <msChapter>(targetEvent.Chapter); } if (!string.IsNullOrWhiteSpace(targetEvent.Section)) { targetSection = LoadObjectFromAPI <msSection>(targetEvent.Section); } if (!string.IsNullOrWhiteSpace(targetEvent.OrganizationalLayer)) { targetOrganizationalLayer = LoadObjectFromAPI <msOrganizationalLayer>(targetEvent.OrganizationalLayer); } }
public static List <string> GetEntitiesEligibleForGroupRegistration(msEvent targetEvent, msEntity currentEntity, IConciergeAPIService api) { if (targetEvent == null) { throw new ArgumentNullException("targetEvent"); } if (api == null) { throw new ArgumentNullException("api"); } List <string> applicableRelationshipTypes = targetEvent.SafeGetValue <List <string> >("GroupRegistrationRelationshipTypes"); if (applicableRelationshipTypes == null || applicableRelationshipTypes.Count == 0) { return(null); // there are no registration types enabled } if (currentEntity == null) { return(null); } List <string> entities = new List <string>(); if (currentEntity.ClassType == msOrganization.CLASS_NAME) // an organization can always manage themselves { entities.Add(currentEntity.ID); return(entities); } // OK, let's see if this person is linked to any companies Search s = new Search("RelationshipsForARecord"); s.Context = currentEntity.ID; s.AddCriteria(Expr.Equals("IsLeftSide", false)); // the right side of the relationship is the individual // MSIV-5 Indivdiuals with expired relationships should not be eligible for Event Group Registration var sog1 = new SearchOperationGroup { GroupType = SearchOperationGroupType.Or }; sog1.Criteria.Add(Expr.Equals(msRelationship.FIELDS.StartDate, null)); sog1.Criteria.Add(Expr.IsLessThanOrEqual(msRelationship.FIELDS.StartDate, DateTime.Today.Date)); s.AddCriteria(sog1); var sog2 = new SearchOperationGroup { GroupType = SearchOperationGroupType.Or }; sog2.Criteria.Add(Expr.Equals(msRelationship.FIELDS.EndDate, null)); sog2.Criteria.Add(Expr.IsGreaterThan(msRelationship.FIELDS.EndDate, DateTime.Today.Date)); s.AddCriteria(sog2); // now, we do an is one of the follow for relationship types IsOneOfTheFollowing isTypes = new IsOneOfTheFollowing { FieldName = "Type_ID" }; isTypes.ValuesToOperateOn = new List <object>(applicableRelationshipTypes); s.AddCriteria(isTypes); s.AddOutputColumn("Target_ID"); var values = api.GetSearchResult(s, 0, null).Table; foreach (DataRow dr in values.Rows) { entities.Add(Convert.ToString(dr["Target_ID"])); } // keep in mind we may have orphaned relationships, so we have to make sure each org ID exists! return(entities.Distinct().ToList()); }
private void LoadExistingRegistration() { targetEvent = LoadObjectFromAPI <msEvent>(targetRegistration.Event); targetRegistrationFee = LoadObjectFromAPI <msRegistrationFee>(targetRegistration.Fee); registrantId = targetRegistration.Owner; if (targetEvent == null || targetRegistrationFee == null || string.IsNullOrEmpty(registrantId)) { GoToMissingRecordPage(); } if (targetRegistrationFee.IsGuestRegistration) { QueueBannerError("Cannot set sessions on Guest Registration."); GoTo(ReturnToEventURL()); } var sessionSearch = new Search { Type = msSessionRegistration.CLASS_NAME }; sessionSearch.AddOutputColumn("Event"); sessionSearch.AddOutputColumn("Fee"); sessionSearch.AddOutputColumn("Event.RegistrationMode"); sessionSearch.AddOutputColumn("OrderLineItemID"); sessionSearch.AddCriteria(Expr.Equals("Owner", registrantId)); sessionSearch.AddCriteria(Expr.Equals("Event.ParentEvent", targetEvent.ID)); sessionSearch.AddCriteria(Expr.IsBlank("CancellationDate")); var sessionResult = APIExtensions.GetSearchResult(sessionSearch, 0, null); currentSessions = sessionResult.Table; currentSessions.Columns.Add(new DataColumn("Price", typeof(decimal))); var orderLineItemIDs = currentSessions.Rows.Cast <DataRow>() .Select(currentSession => Convert.ToString(currentSession["OrderLineItemID"])) .Where(itemId => !string.IsNullOrEmpty(itemId)).ToList(); if (orderLineItemIDs.Count > 0) { var orderLineItemSearch = new Search { Type = msOrderLineItem.CLASS_NAME }; orderLineItemSearch.AddOutputColumn("OrderLineItemID"); orderLineItemSearch.AddOutputColumn("Total"); orderLineItemSearch.AddCriteria(Expr.IsOneOfTheFollowing("OrderLineItemID", orderLineItemIDs)); orderLineItemSearch.AddSortColumn("ID"); var orderLineItemResult = APIExtensions.GetSearchResult(orderLineItemSearch, 0, null); if (orderLineItemResult != null) { foreach (DataRow dr in orderLineItemResult.Table.Rows) { var sessionRow = currentSessions.Select(string.Format("OrderLineItemID = '{0}'", dr["OrderLineItemID"])); if (sessionRow.Length > 0) { sessionRow[0]["Price"] = dr["Total"]; } } } } loadEventOwners(); }