private void RefreshFields(CustomerCustomerDemo tmp)
 {
     _CustomerCustomerDemoInfoExtension.Refresh(this);
     _MyCustomer            = null;
     _MyCustomerDemographic = null;
     OnChange();            // raise an event
 }
        public static void Refresh(CustomerCustomerDemo tmp)
        {
            CustomerCustomerDemoInfo tmpInfo = GetExistingByPrimaryKey(tmp.CustomerID, tmp.CustomerTypeID);

            if (tmpInfo == null)
            {
                return;
            }
            tmpInfo.RefreshFields(tmp);
        }
        internal void Update(CustomerDemographic myCustomerDemographic)
        {
            // if we're not dirty then don't update the database
            if (!this.IsDirty)
            {
                return;
            }
            SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"];

            CustomerCustomerDemo.Update(cn, _MyCustomer, myCustomerDemographic);
            MarkOld();
        }
        internal void DeleteSelf(CustomerDemographic myCustomerDemographic)
        {
            // if we're not dirty then don't update the database
            if (!this.IsDirty)
            {
                return;
            }
            // if we're new then don't update the database
            if (this.IsNew)
            {
                return;
            }
            SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"];

            CustomerCustomerDemo.Remove(cn, _CustomerID, myCustomerDemographic.CustomerTypeID);
            MarkNew();
        }
 public virtual CustomerCustomerDemo Get()
 {
     return(_Editable = CustomerCustomerDemo.Get(_CustomerID, _CustomerTypeID));
 }