protected void btnContinue_Click(object sender, EventArgs e) { string memberId = ddlMembers.SelectedValue; string memberName = ddlMembers.SelectedItem.Text; if (!targetWaivedRegistrationList.Members.Exists(x => string.Equals(x, memberId, StringComparison.CurrentCultureIgnoreCase))) { targetWaivedRegistrationList.Members.Add(memberId); targetWaivedRegistrationList = SaveObject(targetWaivedRegistrationList).ConvertTo <msWaivedRegistrationList>(); } QueueBannerMessage(string.Format("{0} added successfully", memberName)); GoTo(string.Format("~/events/CreateEditWaivedRegistrationList.aspx?contextID={0}", targetWaivedRegistrationList.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(); targetWaivedRegistrationList = LoadObjectFromAPI <msWaivedRegistrationList>(ContextID); if (targetWaivedRegistrationList == null) { GoToMissingRecordPage(); return; } targetEvent = LoadObjectFromAPI <msEvent>(targetWaivedRegistrationList.Event); if (targetEvent == null) { GoToMissingRecordPage(); return; } loadEventOwners(); }
protected void gvMembers_RowCommand(object sender, GridViewCommandEventArgs e) { string memberId = (string)e.CommandArgument; switch (e.CommandName.ToLower()) { case "removemember": if (!targetWaivedRegistrationList.Members.Exists(x => string.Equals(x, memberId, StringComparison.CurrentCultureIgnoreCase))) { QueueBannerError("Unable to remove member."); } else { targetWaivedRegistrationList.Members.RemoveAll( x => string.Equals(x, memberId, StringComparison.CurrentCultureIgnoreCase)); targetWaivedRegistrationList = SaveObject(targetWaivedRegistrationList).ConvertTo <msWaivedRegistrationList>(); QueueBannerMessage("Member successfully removed."); } Refresh(); break; } }
/// <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()) { waivedRegistrationListClassMetadata = proxy.DescribeObject(msWaivedRegistrationList.CLASS_NAME).ResultValue; waivedRegistrationListFieldMetadata = waivedRegistrationListClassMetadata.GenerateFieldDictionary(); } var contextObject = APIExtensions.LoadObjectFromAPI(ContextID); if (contextObject.ClassType == msEvent.CLASS_NAME) { targetEvent = contextObject.ConvertTo <msEvent>(); targetWaivedRegistrationList = msWaivedRegistrationList.FromClassMetadata(waivedRegistrationListClassMetadata); lblTitleAction.Text = "Create"; } else { targetWaivedRegistrationList = contextObject.ConvertTo <msWaivedRegistrationList>(); targetEvent = LoadObjectFromAPI <msEvent>(targetWaivedRegistrationList.Event); lblTitleAction.Text = "Edit"; } if (targetEvent == null || targetWaivedRegistrationList == null) { GoToMissingRecordPage(); return; } targetWaivedRegistrationList.Event = targetEvent.ID; loadEventOwners(); }
protected void unbindAndSave() { unbindWaivedRegistrationList(); targetWaivedRegistrationList = SaveObject(targetWaivedRegistrationList).ConvertTo <msWaivedRegistrationList>(); }