コード例 #1
0
        static void OutputDatabaseSingle(UniquePerson p, string simpleurl)
        {
            SQLDataActions sqlDA = new SQLDataActions();

            sqlDA.InsertAPIReturnedData(p.PMDPatientID, p.PMDClientID, p.DOB, p.Name, p.Address, p.Address2, p.City, p.State, p.PostalCode, p.PhoneNumber, p.LineType, p.JSON, simpleurl, p.ContractNumber, sessionid);

            if (p.PhoneNumber2.Length > 0)
            {
                sqlDA.InsertAPIReturnedData(p.PMDPatientID, p.PMDClientID, p.DOB, p.Name, p.Address, p.Address2, p.City, p.State, p.PostalCode, p.PhoneNumber2, p.LineType2, p.JSON, simpleurl, p.ContractNumber, sessionid);
            }

            if (p.PhoneNumber3.Length > 0)
            {
                sqlDA.InsertAPIReturnedData(p.PMDPatientID, p.PMDClientID, p.DOB, p.Name, p.Address, p.Address2, p.City, p.State, p.PostalCode, p.PhoneNumber3, p.LineType3, p.JSON, simpleurl, p.ContractNumber, sessionid);
            }
        }
コード例 #2
0
 public bool Equals(UniquePerson other)
 {
     return(this.Name == other.Name && this.PhoneNumber == other.PhoneNumber);
 }
コード例 #3
0
        //static void ParseResponse(string returnValue, Person p)
        static void ParseResponse(string returnValue, UniquePerson p)
        {
            try
            {
                int smartcounter = 0;

                dynamic stuff = JsonConvert.DeserializeObject(returnValue);

                int personcount = stuff.person.Count;
                int i           = 0;

                if (personcount > 0)
                {
                    foundcount++;
                }
                else
                {
                    notfoundcount++;
                }

                for (i = 0; i < personcount; i++)
                {
                    string name = stuff.person[i].name;

                    int phonescount = stuff.person[i].phones.Count;

                    int j = 0;


                    string firstphonenumber  = String.Empty;
                    string secondphonenumber = String.Empty;

                    for (j = 0; j < phonescount; j++)
                    {
                        string phonenumber = stuff.person[i].phones[j].phone_number;
                        string linetype    = stuff.person[i].phones[j].line_type;


                        if (phonenumber.Length > 0)
                        {
                            smartcounter++;

                            if (smartcounter == 3)
                            {
                                p.PhoneNumber3 = phonenumber;

                                if (linetype.Length > 0)
                                {
                                    p.LineType3 = linetype;
                                }
                            }
                            else if (smartcounter == 2)
                            {
                                p.PhoneNumber2 = phonenumber;

                                if (linetype.Length > 0)
                                {
                                    p.LineType2 = linetype;
                                }
                            }
                            else if (smartcounter == 1)
                            {
                                p.PhoneNumber = phonenumber;

                                if (linetype.Length > 0)
                                {
                                    p.LineType = linetype;
                                }
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                exceptiontype += "*Error occured on Record #" + recordcount.ToString() + "/" + ex.Message + "-" + ex.StackTrace;
                errorcount++;
            }
        }