public bool Add() { if (IsObjectValid) { Proxies.AppDataClient DataClient = new Proxies.AppDataClient(); DataClient.Open(); DataClient.AddNewVendor(this); DataClient.Close(); OnVendorCreated(); return(true); } else { return(false); } }
public void Add(skAddresses AddressObject) { Proxies.AppDataClient DataClient = new Proxies.AppDataClient(); try { if (IsObjectValid) { DataClient.Open(); DataClient.AddNewVendor(this, AddressObject); } else { throw new Stocky.Exceptions.InvalidObjectException(this.PropertyList); } } finally { DataClient.Close(); } }