コード例 #1
0
    public string GetSampleResponse()
    {
        string un = this.User.Identity.Name;

        Response r = new Response();

        r.Header = new ResponseHeader("1", "Records Return Successfully");

        Member m1 = new Member();

        r.Members.Add(m1);

        m1.Keywords.Add(new Keyword("FirstName", "Johnny"));
        m1.Keywords.Add(new Keyword("MiddleName", "Q"));
        m1.Keywords.Add(new Keyword("LastName", "Northwoods"));
        m1.Keywords.Add(new Keyword("NameSuffix", "Jr."));

        m1.Keywords.Add(new Keyword("SSN", "111111111"));
        m1.Keywords.Add(new Keyword("ExternalSystemID", "MN786545746"));
        m1.Keywords.Add(new Keyword("Sex", "M"));
        m1.Keywords.Add(new Keyword("BirthDate", "01/27/1963"));

        m1.Keywords.Add(new Keyword("PhysicalStreet1", "123 High St"));
        m1.Keywords.Add(new Keyword("PhysicalStreet2", "Apt 4"));
        m1.Keywords.Add(new Keyword("PhysicalStreet3", string.Empty));
        m1.Keywords.Add(new Keyword("PhysicalCity", "Dublin"));
        m1.Keywords.Add(new Keyword("PhysicalState", "OH"));
        m1.Keywords.Add(new Keyword("PhysicalZip", "43017"));
        m1.Keywords.Add(new Keyword("PhysicalZipPlus4", "1234"));

        m1.Keywords.Add(new Keyword("MailingStreet1", "456 Broad Rd."));
        m1.Keywords.Add(new Keyword("MailingStreet2", string.Empty));
        m1.Keywords.Add(new Keyword("MailingStreet3", string.Empty));
        m1.Keywords.Add(new Keyword("MailingCity", "Columbus"));
        m1.Keywords.Add(new Keyword("MailingState", "HO"));
        m1.Keywords.Add(new Keyword("MailingZip", "43016"));
        m1.Keywords.Add(new Keyword("MailingZipPlus4", "5678"));

        m1.Keywords.Add(new Keyword("HomePhone", "0123456"));
        m1.Keywords.Add(new Keyword("CellPhone", "9876543"));

        m1.Keywords.Add(new Keyword("StateCaseNumber", "020478922"));
        m1.Keywords.Add(new Keyword("LocalCaseNumber", "037450943"));
        m1.Keywords.Add(new Keyword("CaseManagerUserName", "Northwoods"));
        m1.Keywords.Add(new Keyword("CaseManagerName", "North Woods"));

        m1.Keywords.Add(new Keyword("CompassNumber", "OH1230000000001"));
        m1.Keywords.Add(new Keyword("UserName", "CompassServiceUser"));

        m1.Keywords.Add(new Keyword("xxxBatch #", "01234567890123456789"));
        m1.Keywords.Add(new Keyword("xxxCheck Consecutive #", "012345678"));

        return(MySerializer.ToXml(r));
    }
コード例 #2
0
    public string Search(string sRequest)
    {
        Response resp    = null;
        Request  request = (Request)MySerializer.FromXml(sRequest, typeof(Request));

        if (request != null)
        {
            string requestUserName = request.UserName;

            string   firstName         = string.Empty;
            string   lastName          = string.Empty;
            string   sSN               = string.Empty;
            DateTime?birthDate         = null;
            string   sISNumber         = string.Empty;
            string   stateIssuedNumber = string.Empty;
            string   nineChar          = string.Empty;
            string   twentyChar        = string.Empty;

            foreach (Keyword kw in request.Keywords)
            {
                if (kw.Name.Equals(Constants.FIRSTNAME, StringComparison.CurrentCultureIgnoreCase))
                {
                    firstName = kw.Value;
                }
                else if (kw.Name.Equals(Constants.LASTNAME, StringComparison.CurrentCultureIgnoreCase))
                {
                    lastName = kw.Value;
                }
                else if (kw.Name.Equals(Constants.SSN, StringComparison.CurrentCultureIgnoreCase))
                {
                    sSN = kw.Value.Replace("-", string.Empty);
                }
                else if (kw.Name.Equals(Constants.BIRTHDATE, StringComparison.CurrentCultureIgnoreCase))
                {
                    birthDate = DateTime.Parse(kw.Value, CultureInfo.InvariantCulture);
                }
                else if (kw.Name.Equals(Constants.SISNUMBER, StringComparison.CurrentCultureIgnoreCase))
                {
                    sISNumber = kw.Value;
                }
                else if (kw.Name.Equals(Constants.STATEISSUEDNUMBER, StringComparison.CurrentCultureIgnoreCase))
                {
                    stateIssuedNumber = kw.Value;
                }
                else if (kw.Name.Equals(Constants.NINECHAR, StringComparison.CurrentCultureIgnoreCase))
                {
                    nineChar = kw.Value;
                }
                else if (kw.Name.Equals(Constants.TWENTYCHAR, StringComparison.CurrentCultureIgnoreCase))
                {
                    twentyChar = kw.Value;
                }
            }

            DataSet dsResult = MakeSQLCall(firstName, lastName, sSN, birthDate, sISNumber, stateIssuedNumber, requestUserName, nineChar, twentyChar);

            resp = new Response();
            int rowCount = 0;

            if (dsResult != null && dsResult.Tables.Count > 0)
            {
                rowCount = dsResult.Tables[0].Rows.Count;

                foreach (DataRow dr in dsResult.Tables[0].Rows)
                {
                    resp.Members.Add(GetMemberFromDataRow(dr));
                }
            }

            resp.Header = new ResponseHeader(rowCount.ToString(CultureInfo.InvariantCulture), "Records Return Successfully");
        }

        return(MySerializer.ToXml(resp));
    }