Esempio n. 1
0
        /// <summary>
        /// This method demonstrates searching in the API using OData.
        /// </summary>
        public IEnumerable <EventsModel> SearchingWithOData(string OrgCode)
        {
            //For more info on searching in the Ungerboeck API, see this article:
            //https://supportcenter.ungerboeck.com/hc/en-us/articles/115010610608-Searching-Using-the-API

            SearchMetadataModel       searchMetadata = null;
            IEnumerable <EventsModel> eventsList;

            //Here's examples of searches using OData.

            //Get all events with a description equal to a string
            eventsList = APIUtil.GetSearchList <EventsModel>(USISDKClient, ref searchMetadata, OrgCode, "Description eq 'Convention Name'");

            //Get all events with a description containing a substring
            eventsList = APIUtil.GetSearchList <EventsModel>(USISDKClient, ref searchMetadata, OrgCode, "substringof('Convention', Description)");

            //Get all events with a description starting with a substring
            eventsList = APIUtil.GetSearchList <EventsModel>(USISDKClient, ref searchMetadata, OrgCode, "startswith('Convention', Description)");

            //Get all events with a description ending with a substring
            eventsList = APIUtil.GetSearchList <EventsModel>(USISDKClient, ref searchMetadata, OrgCode, "endswith('Convention', Description)");

            //Get all events with a description equal to either of two strings
            eventsList = APIUtil.GetSearchList <EventsModel>(USISDKClient, ref searchMetadata, OrgCode, "Description eq 'Convention Name' or Description eq 'Conference Name'");

            //Get all events changed in 2010
            eventsList = APIUtil.GetSearchList <EventsModel>(USISDKClient, ref searchMetadata, OrgCode, "ChangedOn gt DateTime'2010-01-01' AND ChangedOn lt DateTime'2011-01-01'");


            return(eventsList);
        }
Esempio n. 2
0
        /// <summary>
        /// This method demonstrates searching in the API and navigation abilities.
        /// </summary>
        public IEnumerable <EventsModel> Search(string orgCode)
        {
            //For more info on searching in the Ungerboeck API, see this article:
            //https://supportcenter.ungerboeck.com/hc/en-us/articles/115010610608-Searching-Using-the-API

            SearchMetadataModel searchMetadata = null;
            const string        orderBy        = "EnteredBy"; //The results will bring back the list sorted on this property
            const int           pageSize       = 10;          //This will be the amount of items brought back by the search.  Further results will be accessible through paging.


            //Here's a search that gets all events after this date
            IEnumerable <EventsModel> eventsList = APIUtil.GetSearchList <EventsModel>(USISDKClient, ref searchMetadata, orgCode, "ChangedOn gt DateTime'2017-09-28'", orderBy, pageSize);

            //eventsList now contains the first 10 entries in this query.
            //searchMetadata is now populated with paging information

            //This will get the next 10 entries
            eventsList = APIUtil.NavigateSearchList <EventsModel>(USISDKClient, ref searchMetadata, searchMetadata.Links.Next);

            //eventsList now contains entries 11-20 of the query.

            //This will get the last page
            eventsList = APIUtil.NavigateSearchList <EventsModel>(USISDKClient, ref searchMetadata, searchMetadata.Links.Last);

            //Notice that searchMetadata.Links.Next is null, since it's the last page.

            return(eventsList);
        }
Esempio n. 3
0
        /// <summary>
        /// Examples showing how to search using UserFields
        /// </summary>
        /// <param name="orgCode">Organization Code where the search will take place.  User fields are organization-based.</param>
        /// <returns></returns>
        public IEnumerable <AllAccountsModel> SearchForUserFields(string orgCode)
        {
            SearchMetadataModel searchMetadata = null;

            List <AllAccountsModel> accounts = new List <AllAccountsModel>();

            //For account user fields, the format is [Account User Field Header flag (O ([organizaion], P [individual], M [membership])]|[User field Class]|[User field Type]|[Organization Code]|[User field property name]"
            //This will only work for active User Fields in your organization.
            //Note for multi-value UDFs, it will convert to a CONTAINS search.

            //This is searching for Individual Account User fields of Issue Class = C (event sales), Issue Type code = 85, organization code = 10, and User Number 01 (AMT_01).  It will return accounts where the value is 12
            accounts.AddRange(APIUtil.GetSearchList <AllAccountsModel>(USISDKClient, ref searchMetadata, orgCode, "P|C|CK|10|UserNumber01 eq 11"));

            //You can mix it in with other filter conditions as well.  This is searching for Postal Code = '77777' with an Organization User Field set
            accounts.AddRange(APIUtil.GetSearchList <AllAccountsModel>(USISDKClient, ref searchMetadata, orgCode, "PostalCode eq '77777' and O|C|04|10|UserText01 eq '01'"));

            //You can search for date user fields.  This is looking for a Registration class User field date of type '3T'
            accounts.AddRange(APIUtil.GetSearchList <AllAccountsModel>(USISDKClient, ref searchMetadata, orgCode, "P|R|3T|10|UserDateTime01 eq datetime'1979-10-27'"));

            ////You can search for membership user fields stored on accounts.
            //accounts.AddRange(APIUtil.GetSearchList<AllAccountsModel>(USISDKClient, ref searchMetadata, orgCode, "M|M|01|10|UserText04 eq 'CHECK'"));

            //This also works for searching for null values or non-null values
            accounts.AddRange(APIUtil.GetSearchList <AllAccountsModel>(USISDKClient, ref searchMetadata, orgCode, "P|C|CK|10|UserNumber01 ne null"));

            return(accounts);
        }
        /// <summary>
        /// You can retrieve registration configuration attached to public languages by utilizing the Select ability of the odata string.
        /// Be sure to include the [], as this denotes it's a nested model.
        /// </summary>
        public IEnumerable <RegistrationConfigurationsModel> GetWithPublicLanguagesAndPreferenceTypes(string orgCode, string configurationCode)
        {
            SearchMetadataModel searchMetadata = null;

            return(APIUtil.GetSearchList <RegistrationConfigurationsModel>(USISDKClient, ref searchMetadata, orgCode, $"ConfigurationCode eq '{configurationCode}'", "", 10000, 10000, new List <string> {
                "[PublicLanguages],[RegistrationPreferenceTypes]"
            }));
        }
Esempio n. 5
0
        /// <summary>
        /// You can retrieve orders attached to order items by utilizing the Select ability of the odata string.  Be sure to include the [], as this denotes it's a nested model.
        /// </summary>
        public IEnumerable <RegistrationOrdersModel> GetWithOrderItems(string orgCode, int orderNumber)
        {
            SearchMetadataModel searchMetadata = null;

            return(APIUtil.GetSearchList <RegistrationOrdersModel>(USISDKClient, ref searchMetadata, orgCode, $"OrderNumber eq {orderNumber}", "", 10000, 10000, new List <string> {
                "[RegistrationOrderItems]"
            }));
        }
Esempio n. 6
0
        /// <summary>
        /// You can retrieve journal entries attached to journal entries items by utilizing the Select ability of the odata string.
        /// Be sure to include the [], as this denotes it's a nested model.
        /// </summary>
        public IEnumerable <JournalEntriesModel> GetWithJournalEntryDetails(string orgCode, int year, int period, string source, string entryNumber)
        {
            SearchMetadataModel searchMetadata = null;

            return(APIUtil.GetSearchList <JournalEntriesModel>(USISDKClient, ref searchMetadata, orgCode, $"Year eq {year} and Period eq {period} and Source eq {source} and EntryNumber eq {entryNumber}", "", 10000, 10000, new List <string> {
                "[JournalEntryDetails]"
            }));
        }
Esempio n. 7
0
        /// <summary>
        /// Examples showing how to search using UserFields
        /// </summary>
        /// <param name="orgCode">Organization Code where the search will take place.  User fields are organization-based.</param>
        /// <returns></returns>
        public IEnumerable <SessionProposalsModel> SearchForUserFields(string orgCode)
        {
            SearchMetadataModel searchMetadata = null;

            //For non-account user fields, the format is [User field Class]|[User field Type]|[User field property name]"
            //This will only work for active User Fields in your organization.
            //Note for multi-value UDFs, it will convert to a CONTAINS search.

            //This is searching for Session Proposal user fields of Issue Class = B, Issue Type code = KB, organization code = 10, and User Text 02 (Text02).  It will return session proposal where the address is 'UPI test address'
            return(APIUtil.GetSearchList <SessionProposalsModel>(USISDKClient, ref searchMetadata, orgCode, "B|KB|10|UserText02 eq 'SilverLight Garbage 2018'"));
        }
Esempio n. 8
0
        /// <summary>
        /// Examples showing how to search using UserFields
        /// </summary>
        /// <param name="orgCode">Organization Code where the search will take place.  User fields are organization-based.</param>
        /// <returns></returns>
        public IEnumerable <OpportunitiesModel> SearchForUserFields(string orgCode)
        {
            SearchMetadataModel searchMetadata = null;

            //For non-account user fields, the format is [User field Class]|[User field Type]|[User field property name]"
            //This will only work for active User Fields in your organization.
            //Note for multi-value UDFs, it will convert to a CONTAINS search.

            //This is searching for Opportunity user fields of Issue Class = C (event sales), Issue Type code = 13, organization code = 10, and User Text 09 (TXT_09).  It will return opportunities where the value is 'N'
            return(APIUtil.GetSearchList <OpportunitiesModel>(USISDKClient, ref searchMetadata, orgCode, "C|13|10|UserText09 eq 'N'"));
        }
Esempio n. 9
0
        /// <summary>
        /// Examples showing how to search using UserFields
        /// </summary>
        /// <param name="orgCode">Organization Code where the search will take place.  User fields are organization-based.</param>
        /// <returns></returns>
        public IEnumerable <RegistrationOrdersModel> SearchForUserFields(string orgCode)
        {
            SearchMetadataModel searchMetadata = null;

            //For non-account user fields, the format is [User field Class]|[User field Type]|[User field property name]"
            //This will only work for active User Fields in your organization.
            //Note for multi-value UDFs, it will convert to a CONTAINS search.

            //This is searching for order user fields of Issue Class = R (registration), Issue Type code = 10, organization code = 10, and User Text 04 (TXT_04).  It will return orders where the value is "65OVER"
            return(APIUtil.GetSearchList <RegistrationOrdersModel>(USISDKClient, ref searchMetadata, orgCode, "R|10|10|UserText04 eq '65OVER'"));
        }
Esempio n. 10
0
        /// <summary>
        /// Examples showing how to search using UserFields
        /// </summary>
        /// <param name="orgCode">Organization Code where the search will take place.  User fields are organization-based.</param>
        /// <returns></returns>
        public IEnumerable <MembershipOrdersModel> SearchForUserFields(string orgCode)
        {
            SearchMetadataModel searchMetadata = null;

            //For non-account user fields, the format is [User field Class]|[User field Type]|[User field property name]"
            //This will only work for active User Fields in your organization.
            //Note for multi-value UDFs, it will convert to a CONTAINS search.

            //This is searching for Order user fields of Issue Class = M (membership), Issue Type code = OR, organization code = 10, and User Number 01 (AMT_01).  It will return orders where the value is 300000
            return(APIUtil.GetSearchList <MembershipOrdersModel>(USISDKClient, ref searchMetadata, orgCode, "M|OR|10|UserNumber01 eq 300000"));
        }
Esempio n. 11
0
        /// <summary>
        /// This method demonstrates searching for empty values or finding all entries that aren't empty
        /// </summary>
        public IEnumerable <AllAccountsModel> SearchingForNotNull(string OrgCode)
        {
            //For more info on searching in the Ungerboeck API, see this article:
            //https://supportcenter.ungerboeck.com/hc/en-us/articles/115010610608-Searching-Using-the-API

            SearchMetadataModel            searchMetadata = null;
            IEnumerable <AllAccountsModel> accountsList;

            //Get all accounts with certain first name and has a filled SynchronizedOrganization property
            accountsList = APIUtil.GetSearchList <AllAccountsModel>(USISDKClient, ref searchMetadata, OrgCode, "startswith('Jones', FirstName) and TaxRegistrationStatus ne null");

            return(accountsList);
        }
Esempio n. 12
0
        /// <summary>
        /// Retrieve a booth by Booth name. Event and function are required
        /// </summary>
        public BoothsModel GetByName(string orgCode, int eventID, int functionID, string boothName)
        {
            SearchMetadataModel searchMetadata = null;
            BoothsModel         returnBooth    = null;

            var boothsResult = APIUtil.GetSearchList <BoothsModel>(USISDKClient, ref searchMetadata, orgCode, $"Function eq {functionID} and Event eq {eventID} and Booth eq '{boothName}'");

            if (boothsResult?.Count() == 1)
            {
                returnBooth = boothsResult.First();
            }

            return(returnBooth);
        }
Esempio n. 13
0
        /// <summary>
        /// Examples showing how to search using UserFields
        /// </summary>
        /// <param name="orgCode">Organization Code where the search will take place.  User fields are organization-based.</param>
        /// <returns></returns>
        public IEnumerable <BoothsModel> SearchForUserFields(string orgCode)
        {
            SearchMetadataModel searchMetadata = null;

            List <BoothsModel> booths = new List <BoothsModel>();

            //For non-account user fields, the format is [User field Class]|[User field Type]|[User field property name]"
            //This will only work for active User Fields in your organization.
            //Note for multi-value UDFs, it will convert to a CONTAINS search.

            //This is searching for Booth User fields of Issue Class = A (booths), Issue Type code = RN, organization code = 10, and User Number 01 (AMT_01).  It will return accounts where the value is 31
            booths.AddRange(APIUtil.GetSearchList <BoothsModel>(USISDKClient, ref searchMetadata, orgCode, "A|RN|10|UserNumber01 eq 31"));

            return(booths);
        }
Esempio n. 14
0
        /// <summary>
        /// This method demonstrates searching in the API and retrieving specific properties using the Select parameter.
        /// </summary>
        public IEnumerable <object> SearchingForSpecificPropertiesWithSelect(string OrgCode)
        {
            SearchMetadataModel searchMetadata = null;
            JArray        eventsList; //Represents a custom object.
            List <string> modelProperties = new List <string> {
                "Description", "StartDate"
            };
            //Get all events and only return specific properties in the model
            var events = APIUtil.GetSearchList <EventsModel>(USISDKClient, ref searchMetadata, OrgCode, "ChangedOn gt DateTime'2017-01-01'", "", 10, 100000, modelProperties);

            eventsList = JArray.FromObject(events, new Newtonsoft.Json.JsonSerializer {
                NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore
            });                                                                                                                                    //Remove the excess properties from the stock model object.  Those properties are never filled in this process.

            return(eventsList);
        }
Esempio n. 15
0
        /// <summary>
        /// This method demonstrates searching and pulling back User Fields using the Select parameter.
        /// </summary>
        public IEnumerable <object> RetrieveUserFieldsDuringSearchWithSelect(string OrgCode)
        {
            //This uses Functions as an example, but all non-account user fields work the same.  See the Accounts example code for an account example.

            SearchMetadataModel searchMetadata = null;
            JArray        functionsList; //Represents a custom object.
            List <string> modelProperties = new List <string> {
                "BU|UserDateTime02"
            };                                                                 //For non-account user fields, the format is [User field Type]|[User field property name]

            var functions = APIUtil.GetSearchList <FunctionsModel>(USISDKClient, ref searchMetadata, OrgCode, "EventID eq 13082", "", 1000, 100000, modelProperties);

            functionsList = JArray.FromObject(functions, new Newtonsoft.Json.JsonSerializer {
                NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore
            });                                                                                                                                          //Remove the excess properties from the stock model object.  Those properties are never filled in this process.

            return(functionsList);
        }
Esempio n. 16
0
        /// <summary>
        /// You can return User Fields while searching by requesting the fields on custom objects
        /// </summary>
        /// <param name="orgCode">Organization Code where the search will take place.  User fields are organization-based.</param>
        /// <returns>Accounts with a user field</returns>
        public IEnumerable <AllAccountsModel> ReturningUserFieldsDuringSearch(string orgCode)
        {
            SearchMetadataModel searchMetadata = null;

            //By using the $Select ability to make a custom return object, you can retrieve user fields on searching, with
            //minimal performance cost.

            //For account user fields, the format is [User field Class]|[User field Type]|[User field property name]
            //This will only work for active User Fields in your organization.

            //This will return Account User fields of Issue Class = C (event sales), Issue Type code = 04, and User Number 01 (AMT_01).  It will return accounts where the Account Rep code is 0002410
            List <string> returnedFields = new List <string> {
                "C|04|UserText01", "LastName"
            };

            IEnumerable <AllAccountsModel> accounts = APIUtil.GetSearchList <AllAccountsModel>(USISDKClient, ref searchMetadata, orgCode, "AccountRep eq '0002410'", "", 1000, 100000, returnedFields);

            return(accounts);
        }
Esempio n. 17
0
        /// <summary>
        /// How to retrieve all.  For high volume, we recommend using a specific query when searching, shown in the General class.
        /// </summary>
        public IEnumerable <EventServicesModel> RetrieveAll(string orgCode)
        {
            SearchMetadataModel searchMetadata = null;

            return(APIUtil.GetSearchList <EventServicesModel>(USISDKClient, ref searchMetadata, orgCode, "All"));
        }
Esempio n. 18
0
        /// <summary>
        /// How to retrieve all.  For high volume, we recommend using a specific query when searching, shown in the General class.
        /// </summary>
        public IEnumerable <PaymentPlanHeadersModel> RetrieveAll(string orgCode)
        {
            SearchMetadataModel searchMetadata = null;

            return(APIUtil.GetSearchList <PaymentPlanHeadersModel>(USISDKClient, ref searchMetadata, orgCode, "All"));
        }
Esempio n. 19
0
        /// <summary>
        /// A retrieve all.  We recommend using a specific query when searching, shown in the General class.
        /// </summary>
        public IEnumerable <BulletinApprovalModel> RetrieveAll(string orgCode)
        {
            SearchMetadataModel searchMetadata = null;

            return(APIUtil.GetSearchList <BulletinApprovalModel>(USISDKClient, ref searchMetadata, orgCode, "All"));
        }
Esempio n. 20
0
        /// <summary>
        /// A retrieve by odata query.  We recommend using a specific query when searching, shown in the General class.
        /// </summary>
        public IEnumerable <RegistrationPreferenceTypesModel> RetrieveByOData(string oData)
        {
            SearchMetadataModel searchMetadata = null;

            return(APIUtil.GetSearchList <RegistrationPreferenceTypesModel>(USISDKClient, ref searchMetadata, string.Empty, oData));
        }
Esempio n. 21
0
        /// <summary>
        /// How to retrieve all.  For high volume, we recommend using a specific query when searching, shown in the General class.
        /// </summary>
        public IEnumerable <OrganizationParametersModel> RetrieveAll(string orgCode)
        {
            SearchMetadataModel searchMetadata = null;

            return(APIUtil.GetSearchList <OrganizationParametersModel>(USISDKClient, ref searchMetadata, orgCode, "All"));
        }
Esempio n. 22
0
        /// <summary>
        /// A retrieve all booths on a function.
        /// </summary>
        public IEnumerable <BoothsModel> GetByEventFunction(string orgCode, int eventID, int functionID)
        {
            SearchMetadataModel searchMetadata = null;

            return(APIUtil.GetSearchList <BoothsModel>(USISDKClient, ref searchMetadata, orgCode, $"Function eq {functionID} and Event eq {eventID}"));
        }
Esempio n. 23
0
        /// <summary>
        /// How to retrieve all.  For high volume, we recommend using a specific query when searching, shown in the General class.
        /// </summary>
        public IEnumerable <FunctionCheckInsModel> RetrieveAll()
        {
            SearchMetadataModel searchMetadata = null;

            return(APIUtil.GetSearchList <FunctionCheckInsModel>(USISDKClient, ref searchMetadata, string.Empty, "All"));
        }
Esempio n. 24
0
        /// <summary>
        /// A retrieve all by organization code
        /// </summary>
        /// <param name="orgCode">The organization code of the function seating chart.</param>
        public IEnumerable <FunctionSeatingChartsModel> RetrieveAll(string orgCode)
        {
            SearchMetadataModel searchMetadata = null;

            return(APIUtil.GetSearchList <FunctionSeatingChartsModel>(USISDKClient, ref searchMetadata, orgCode, "All"));
        }
Esempio n. 25
0
        public IEnumerable <FunctionCheckInsModel> Retrieve(string searchOData, string orderBy)
        {
            SearchMetadataModel searchMetadata = null;

            return(APIUtil.GetSearchList <FunctionCheckInsModel>(USISDKClient, ref searchMetadata, string.Empty, searchOData, orderBy));
        }
Esempio n. 26
0
        public IEnumerable <JournalEntryDetailsModel> RetrieveByOData(string orgCode, string oData)
        {
            SearchMetadataModel searchMetadata = null;

            return(APIUtil.GetSearchList <JournalEntryDetailsModel>(USISDKClient, ref searchMetadata, orgCode, oData));
        }
Esempio n. 27
0
        /// <summary>
        /// A retrieve by odata query.  We recommend using a specific query when searching, shown in the General class.
        /// </summary>
        public IEnumerable <SessionProposalsModel> RetrieveByOData(string orgCode, string oData)
        {
            SearchMetadataModel searchMetadata = null;

            return(APIUtil.GetSearchList <SessionProposalsModel>(USISDKClient, ref searchMetadata, orgCode, oData));
        }
Esempio n. 28
0
        /// <summary>
        /// A retrieve all.  We recommend using a specific query when searching, shown in the General class.
        /// </summary>
        /// <param name="orgCode">Registration Assignments Organization Code.</param>
        public IEnumerable <RegistrationAssignmentsModel> RetrieveAll(string orgCode)
        {
            SearchMetadataModel searchMetadata = null;

            return(APIUtil.GetSearchList <RegistrationAssignmentsModel>(USISDKClient, ref searchMetadata, orgCode, "All"));
        }
Esempio n. 29
0
        /// <summary>
        /// How to retrieve all.  For high volume, we recommend using a specific query when searching, shown in the General class.
        /// </summary>
        public IEnumerable <UserDefinedFieldsModel> RetrieveAll(string orgCode)
        {
            SearchMetadataModel searchMetadata = null;

            return(APIUtil.GetSearchList <UserDefinedFieldsModel>(USISDKClient, ref searchMetadata, orgCode, "All"));
        }
        /// <summary>
        /// A retrieve by odata query.  We recommend using a specific query when searching, shown in the General class.
        /// </summary>
        public IEnumerable <SessionProposalEvaluationCriteriaResponsesModel> RetrieveByOData(string oData)
        {
            SearchMetadataModel searchMetadata = null;

            return(APIUtil.GetSearchList <SessionProposalEvaluationCriteriaResponsesModel>(USISDKClient, ref searchMetadata, string.Empty, oData));
        }