protected override void InitializeTargetObject() { base.InitializeTargetObject(); if (ContextID == null) { GoToMissingRecordPage(); } Search s = new Search(msPayment.CLASS_NAME); s.AddCriteria(Expr.Equals("ID", ContextID)); s.AddOutputColumn("LocalID"); s.AddOutputColumn("Date"); s.AddOutputColumn("Total"); s.AddOutputColumn("Owner.Name"); s.AddOutputColumn("Owner"); s.AddOutputColumn("AmountRefunded"); s.AddOutputColumn("BillingAddress"); var sr = APIExtensions.GetSearchResult(s, 0, 1); if (sr.TotalRowCount == 0) { GoToMissingRecordPage(); } targetPayment = sr.Table.Rows[0]; if (string.IsNullOrWhiteSpace(LeaderOfId)) { return; } var leaderOf = APIExtensions.LoadObjectFromAPI(LeaderOfId); switch (leaderOf.ClassType) { case msChapter.CLASS_NAME: targetChapter = leaderOf.ConvertTo <msChapter>(); break; case msSection.CLASS_NAME: targetSection = leaderOf.ConvertTo <msSection>(); break; case msOrganizationalLayer.CLASS_NAME: targetOrganizationalLayer = leaderOf.ConvertTo <msOrganizationalLayer>(); break; default: QueueBannerError(string.Format("Invalid leader object type specified '{0}'", leaderOf.ClassType)); GoHome(); return; } }
protected void loadEventOwners() { 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(); targetChapter = LoadObjectFromAPI <msChapter>(ContextID); if (targetChapter == null) { GoToMissingRecordPage(); return; } }
protected void btnSave_Click(object sender, EventArgs e) { if (!IsValid) { return; } unbindObjectFromPage(); using (IConciergeAPIService serviceProxy = GetServiceAPIProxy()) { targetChapter = serviceProxy.Save(targetChapter).ResultValue.ConvertTo <msChapter>(); } GoTo(string.Format("~/chapters/ManageChapterLeaders.aspx?contextID={0}", ContextID)); }
/// <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); } }
protected void loadCommitteeOwners() { if (!string.IsNullOrWhiteSpace(targetCommittee.Chapter)) { targetChapter = LoadObjectFromAPI <msChapter>(targetCommittee.Chapter); } if (!string.IsNullOrWhiteSpace(targetCommittee.Section)) { targetSection = LoadObjectFromAPI <msSection>(targetCommittee.Section); } if (!string.IsNullOrWhiteSpace(targetCommittee.OrganizationalLayer)) { targetOrganizationalLayer = LoadObjectFromAPI <msOrganizationalLayer>(targetCommittee.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(); targetChapter = LoadObjectFromAPI <msChapter>(ContextID); if (targetChapter == null) { GoToMissingRecordPage(); return; } if (!string.IsNullOrWhiteSpace(targetChapter.LinkedOrganization)) { linkedOrganization = LoadObjectFromAPI <msOrganization>(targetChapter.LinkedOrganization); } }
protected void loadEventOwners(IConciergeAPIService proxy) { if (!string.IsNullOrWhiteSpace(targetEvent.Chapter)) { targetChapter = proxy.LoadObjectFromAPI <msChapter>(targetEvent.Chapter); } if (!string.IsNullOrWhiteSpace(targetEvent.Section)) { targetSection = proxy.LoadObjectFromAPI <msSection>(targetEvent.Section); } if (!string.IsNullOrWhiteSpace(targetEvent.OrganizationalLayer)) { targetOrganizationalLayer = proxy.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(); //Load the chapter and individual from the context id in the query string targetChapter = LoadObjectFromAPI <msChapter>(ContextID); if (targetChapter == null) { GoToMissingRecordPage(); return; } if (targetChapter.Leaders == null) { targetChapter.Leaders = new List <msMembershipLeader>(); } if (string.IsNullOrWhiteSpace(IndividualID)) { targetLeader = new msMembershipLeader(); } else { //Check the individual ID - if it's specified then this is an edit command and load the individual targetIndividual = LoadObjectFromAPI <msIndividual>(IndividualID); targetLeader = targetChapter.Leaders.Where(x => x.Individual == IndividualID).SingleOrDefault(); if (targetIndividual == null) { GoToMissingRecordPage(); return; } IsInEditMode = true; } if (targetLeader == null) { GoToMissingRecordPage(); return; } currentLeader = targetChapter.Leaders.Find(x => x.Individual == CurrentEntity.ID); }
protected void gvLeaders_RowCommand(object sender, GridViewCommandEventArgs e) { switch (e.CommandName.ToLower()) { case "deleteleader": targetChapter.Leaders.RemoveAll( x => x.Individual == e.CommandArgument.ToString()); using (IConciergeAPIService serviceProxy = GetServiceAPIProxy()) { targetChapter = serviceProxy.Save(targetChapter).ResultValue.ConvertTo <msChapter>(); } loadAndBindLeaders(); break; case "editleader": string nextUrl = string.Format("~/chapters/CreateEditChapterLeader.aspx?contextID={0}&individualID={1}", ContextID, e.CommandArgument); GoTo(nextUrl); break; } }
protected void btnSave_Click(object sender, EventArgs e) { if (!IsValid) { return; } unbindObjectFromPage(); targetChapter = SaveObject(targetChapter).ConvertTo <msChapter>(); if (linkedOrganization != null) { linkedOrganization = SaveObject(linkedOrganization).ConvertTo <msOrganization>(); } QueueBannerMessage("Chapter information was updated successfully."); GoTo(string.Format("~/chapters/ViewChapter.aspx?contextID={0}", ContextID)); }
/// <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) ? ConciergeAPI.CurrentEntity : LoadObjectFromAPI <msEntity>(ContextID); if (targetEntity == null) { GoToMissingRecordPage(); return; } if (string.IsNullOrWhiteSpace(LeaderOfId)) { return; } var leaderOf = APIExtensions.LoadObjectFromAPI(LeaderOfId); switch (leaderOf.ClassType) { case msChapter.CLASS_NAME: targetChapter = leaderOf.ConvertTo <msChapter>(); break; case msSection.CLASS_NAME: targetSection = leaderOf.ConvertTo <msSection>(); break; case msOrganizationalLayer.CLASS_NAME: targetOrganizationalLayer = leaderOf.ConvertTo <msOrganizationalLayer>(); break; default: QueueBannerError(string.Format("Invalid leader object type specified '{0}'", leaderOf.ClassType)); GoHome(); return; } }
/// <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(); if (MultiStepWizards.ViewChapterMembers.SearchManifest == null || MultiStepWizards.ViewChapterMembers.SearchBuilder == null) { GoTo(string.Format("~/chapters/ViewChapterMembers_SelectFields.aspx?contextID={0}", ContextID)); return; } targetChapter = LoadObjectFromAPI <msChapter>(ContextID); if (targetChapter == null) { GoToMissingRecordPage(); } targetSearch = getSearch(); //Has to be in the InitializeTargetObject to have the leader before running the CheckSecurity getLeader(); }
/// <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); } }
/// <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(); targetChapter = LoadObjectFromAPI <msChapter>(ContextID); if (targetChapter == null) { GoToMissingRecordPage(); return; } targetMembershipOrganization = LoadObjectFromAPI <msMembershipOrganization>(targetChapter.MembershipOrganization); if (targetMembershipOrganization == null) { GoToMissingRecordPage(); return; } targetSearchManifest = MultiStepWizards.ViewChapterMembers.SearchManifest; if (targetSearchManifest == null || targetSearchManifest.DefaultSelectedFields.Count == 0) { targetSearchManifest = buildSearchManifest(); MultiStepWizards.ViewChapterMembers.SearchManifest = targetSearchManifest; } using (IConciergeAPIService proxy = GetConciegeAPIProxy()) { List <string> availableFields = defaultFieldFullPaths; //If the Membership Organization has defined criteria fields available to leaders use them but prefix with "Membership." because the settings are based on the Membership search //while this is a chapter membership search if (targetMembershipOrganization.LeaderSearchFields != null) { availableFields = (from field in targetMembershipOrganization.LeaderSearchFields select "Membership." + field).ToList(); } targetCriteriaFields = proxy.GetSearchFieldMetadataFromFullPath(msChapterMembership.CLASS_NAME, null, availableFields).ResultValue; } foreach (var f in targetCriteriaFields) { var labelOverride = PortalConfiguration.GetOverrideFor( Request.Url.LocalPath, ColumnHeaderOverridePrefix + f.Name, "Text"); if (labelOverride != null) { f.Label = labelOverride.Value; } } foreach (var f in targetSearchManifest.Fields) { var labelOverride = PortalConfiguration.GetOverrideFor( Request.Url.LocalPath, ColumnHeaderOverridePrefix + f.Name, "Text"); if (labelOverride != null) { f.Label = labelOverride.Value; } } //Has to be in the InitializeTargetObject to have the leader before running the CheckSecurity loadDataFromConcierge(); }