public static List <CAddress> GetAddressList(int intUserId) { try { CDatabase db = new CDatabase(); List <CAddress> Addresses = db.GetAddressList(intUserId); return(Addresses); } catch (Exception) { return(null); } }
public int DoesAddressExist(CAddress NewAddress) { try { CDatabase db = new CDatabase(); List <CAddress> AddressList = db.GetAddressList(); foreach (CAddress Address in AddressList) { if (NewAddress.intStateID == Address.intStateID && NewAddress.strAddress == Address.strAddress && NewAddress.strCity == Address.strCity && NewAddress.strZipCode == Address.strZipCode) { return(Address.intAddressID); // match found } } return(0); // No match found } catch (Exception) { return(-1); // Failure } }