public void AddNewSale(skPerson PersonObject, skAddresses AddressObject, int UserID) { Stocky.Proxies.AppDataClient DataClient = new Proxies.AppDataClient(); try { if (IsObjectValid) { DataClient.Open(); DataClient.AddNewSale(AddressObject, PersonObject, this, UserID); OnSaleCreated(); } else { throw new Stocky.Exceptions.InvalidObjectException(this.PropertyList); } } finally { DataClient.Close(); } }
public bool AddNewSale(int UserID) { Proxies.AppDataClient DataClient = new Proxies.AppDataClient(); try { if (IsObjectValid) { DataClient.Open(); DataClient.AddNewSale(this, UserID); OnSaleCreated(); return(true); } else { return(false); } } finally { DataClient.Close(); } }