static void ParseResponse(string returnValue, UniqueProvider p) { try { int smartcounter = 0; dynamic stuff = JsonConvert.DeserializeObject(returnValue); int personcount = stuff.business.Count; int i = 0; if (personcount > 0) { foundcount++; } else { notfoundcount++; } for (i = 0; i < personcount; i++) { string name = stuff.business[i].name; int phonescount = stuff.business[i].phones.Count; int j = 0; string firstphonenumber = String.Empty; string secondphonenumber = String.Empty; for (j = 0; j < phonescount; j++) { string phonenumber = stuff.business[i].phones[j].phone_number; string linetype = stuff.business[i].phones[j].line_type; if (phonenumber.Length > 0) { smartcounter++; p.PhoneNumbers.Add(phonenumber); p.LineTypes.Add(linetype); } } } } catch (Exception ex) { exceptiontype += "*Error occured on Record #" + recordcount.ToString() + "/" + ex.Message + "-" + ex.StackTrace; errorcount++; } }
static void OutputDatabaseSingle(UniqueProvider p, string simpleurl) { SQLDataActions sqlDA = new SQLDataActions(); if (p.PhoneNumbers.Count == 0) { sqlDA.InsertAPIReturnedData(p.DOB, p.Name, p.Address, p.Address2, p.City, p.State, p.PostalCode, "", "", p.JSON, simpleurl, sessionid, p.NPI); } else { for (int i = 0; i < p.PhoneNumbers.Count; i++) { sqlDA.InsertAPIReturnedData(p.DOB, p.Name, p.Address, p.Address2, p.City, p.State, p.PostalCode, p.PhoneNumbers[i], p.LineTypes[i], p.JSON, simpleurl, sessionid, p.NPI); } } }
public bool Equals(UniqueProvider other) { return(this.Name == other.Name && this.Address == other.Address); }