private static ListOutputRow[] Search(string lastName, string firstName)
        {
            // Set credentials
            NetworkCredential credentials = new NetworkCredential
            {
                Domain   = "<domain>",
                UserName = "******",
                Password = "******"
            };

            // Initialize web service
            AppFxWebService service = new AppFxWebService
            {
                Url         = "http://<web_server>/<virtual_directory>/AppFxWebService.asmx",
                Credentials = credentials
            };

            // Define filters for the search list
            DataFormFieldValueSet fieldValueSet = new DataFormFieldValueSet()
            {
                new DataFormFieldValue("KEYNAME", lastName),
                new DataFormFieldValue("FIRSTNAME", firstName)
            };

            // Create request
            SearchListLoadRequest request = new SearchListLoadRequest
            {
                SearchListID  = new Guid("fdf9d631-5277-4300-80b3-fdf5fb8850ec"), // ConstituentByNameOrLookupId.Search.xml
                ClientAppInfo = new ClientAppInfoHeader
                {
                    ClientAppName   = "Sample Application",
                    REDatabaseToUse = "<database>"
                },
                Filter = new DataFormItem
                {
                    Values = fieldValueSet
                }
            };

            // Run search
            SearchListLoadReply reply = service.SearchListLoad(request);

            if (reply != null && reply.Output != null && reply.Output.Rows != null)
            {
                return(reply.Output.Rows);
            }
            else
            {
                return(null);
            }
        }
示例#2
0
        private Guid findConstituent()
        {
            Guid id = Guid.Empty;

            if (BBWebPrincipal.Current.User == null)
            {
                SearchListLoadRequest request = Const.SearchLists.Constituent.ConstituentSearch.CreateRequest(this.API.AppFxWebServiceProvider);
                request.SearchListID = new Guid("23c5c603-d7d8-4106-aecc-65392b563887");

                Const.SearchLists.Constituent.ConstituentSearchFilterData data = new Const.SearchLists.Constituent.ConstituentSearchFilterData();
                data.CONSTITUENTTYPE = 1;

                Guid stateID = GetStateID(cmbState.Text);

                if (this.radIsSponsor.SelectedValue == "")
                {
                    data.LOOKUPID = this.txtSponsorId.Text;
                }
                else
                {
                    data.FIRSTNAME    = this.txtFirstName.Text;
                    data.KEYNAME      = this.txtLastName.Text;
                    data.CITY         = this.txtCity.Text;
                    data.POSTCODE     = this.txtZip.Text;
                    data.ADDRESSBLOCK = this.txtAddress.Text;
                }

                string[] ids = Const.SearchLists.Constituent.ConstituentSearch.GetIDs(this.API.AppFxWebServiceProvider, data);

                if (ids.Length > 0)
                {
                    Guid.TryParse(ids[0], out id);
                }
                else
                {
                    id = this.createConsitutent(stateID);
                }
            }
            else
            {
                var constit = new Blackbaud.Web.Content.Core.Data.ShelbyConstituent(BBWebPrincipal.Current.User);
                id = new Guid(Blackbaud.Web.Content.Core.Data.ShelbyConstituent.get_GetConstituentsGuid(constit.RecordID));
            }

            return(id);
        }
        private Guid findConstituent()
        {
            SearchListLoadRequest request = ConstituentSearch.CreateRequest(this.API.AppFxWebServiceProvider);

            request.SearchListID = new Guid("23c5c603-d7d8-4106-aecc-65392b563887");

            ConstituentSearchFilterData data = new ConstituentSearchFilterData();

            data.CONSTITUENTTYPE = 1;
            data.EXACTMATCHONLY  = true;

            // CSM - Modified to only use the lookup id if it is non-blank
            //if ((this.radIsSponsor.SelectedValue == "Yes") && (this.txtSponsorId.Text.Trim() != ""))
            //{
            //    data.LOOKUPID = this.txtSponsorId.Text;
            //    data.KEYNAME = this.txtLastName.Text;
            //    data.CITY = this.txtCity.Text;
            //    data.POSTCODE = this.txtZip.Text;
            //}
            //else
            //{
            data.FIRSTNAME    = this.txtFirstName.Text;
            data.KEYNAME      = this.txtLastName.Text;
            data.CITY         = this.txtCity.Text;
            data.POSTCODE     = this.txtZip.Text;
            data.ADDRESSBLOCK = this.txtAddress.Text;
            //}


            string[] ids = ConstituentSearch.GetIDs(this.API.AppFxWebServiceProvider, data);
            if (ids.Length > 0)
            {
                if (ids.Length > 1)
                {
                    return(new Guid(ids[0]));
                }
                else
                {
                    return(new Guid(ids[0]));
                }
            }

            return(Guid.Empty);
        }
示例#4
0
        private Guid findConstituent()
        {
            SearchListLoadRequest request = ConstituentSearch.CreateRequest(this.API.AppFxWebServiceProvider);

            request.SearchListID = new Guid("23c5c603-d7d8-4106-aecc-65392b563887");

            ConstituentSearchFilterData data = new ConstituentSearchFilterData();

            data.CONSTITUENTTYPE = 1;

            if (this.radIsSponsor.SelectedValue == "")
            {
                data.LOOKUPID = this.txtSponsorId.Text;
            }
            else
            {
                data.FIRSTNAME    = this.txtFirstName.Text;
                data.KEYNAME      = this.txtLastName.Text;
                data.CITY         = this.txtCity.Text;
                data.POSTCODE     = this.txtZip.Text;
                data.ADDRESSBLOCK = this.txtAddress.Text;
            }


            string[] ids = ConstituentSearch.GetIDs(this.API.AppFxWebServiceProvider, data);
            if (ids.Length > 0)
            {
                if (ids.Length > 1)
                {
                    return(new Guid(ids[0]));
                }
                else
                {
                    return(new Guid(ids[0]));
                }
            }

            return(Guid.Empty);
        }
        /// <summary>
        /// Find the Constituent ID for the lookup id entered in txtSponsorId
        /// The Last Name entered in txtReversalResponseLastName must also match
        /// </summary>
        /// <returns>ConstituentID</returns>
        private Guid findConstituent()
        {
            SearchListLoadRequest request = ConstituentSearch.CreateRequest(this.API.AppFxWebServiceProvider);

            request.SearchListID = new Guid("23c5c603-d7d8-4106-aecc-65392b563887");

            ConstituentSearchFilterData data = new ConstituentSearchFilterData();

            data.CONSTITUENTTYPE = 1;
            data.EXACTMATCHONLY  = true;

            data.LOOKUPID = this.txtSponsorId.Text.Trim();
            data.KEYNAME  = this.txtReversalResponseLastName.Text.Trim();

            string[] ids = ConstituentSearch.GetIDs(this.API.AppFxWebServiceProvider, data);
            if (ids.Length > 0)
            {
                return(new Guid(ids[0]));
            }

            return(Guid.Empty);
        }