예제 #1
0
        public void AddNew(skAddresses AddressObject)
        {
            Proxies.AppDataClient DataClient = new Proxies.AppDataClient();
            try
            {
                if (IsObjectValid)
                {
                    if (AddressObject.IsObjectValid)
                    {
                        DataClient.Open();
                        DataClient.AddNewPerson(this, AddressObject);

                        OnPersonCreated();
                    }
                    else
                    {
                        throw new Stocky.Exceptions.InvalidObjectException(AddressObject.PropertyList);
                    }
                }
                else
                {
                    throw new Stocky.Exceptions.InvalidObjectException(this.PropertyList);
                }
            }
            finally
            {
                DataClient.Close();
            }
        }