private void PostProcessProvider()
        {
            //
            // If no auth methods were set on the provider or products, then create a default one
            // and insert it after the business unit.
            //
            bool found = _sqlEntities.Where(w => w is Business_unit_product_id_auth_method).Count() > 0;

            if (!found)
            {
                IdAuthMethod iam = new IdAuthMethod(null);
                iam.DisableDate = _provider.DisableDate;
                iam.EnableDate = _provider.EnableDate;
                iam.Method = "none required";
                Business_unit_product_id_auth_method bupiam = new Business_unit_product_id_auth_method();
                bupiam.PopulateFrom(iam);
                int position = _sqlEntities.FindIndex(w => w is Business_unit) + 1;
                _sqlEntities.Insert(position, bupiam);
            }

            //
            // Add in any system codes that we haven't already collected.  Some codes were added in the ProcessProvider / ProcessProduct steps.
            //
            foreach (var e in _sqlEntities)
            {
                var scs = e.GetSystemCodes();
                foreach (var sc in scs)
                {
                    if (!_usedCodes.Contains(sc))
                        _usedCodes.Add(sc);
                }
            }
        }
 public void PopulateFrom(IdAuthMethod iam)
 {
     this.end_date.Value = iam.DisableDate;
     this.id_auth_method_cd_id.Value = GSC(SystemCodeType.ID_AUTHENTICATION_METHOD, iam.Method);
     this.order_method_cd_id.Value = GSC(SystemCodeType.ORDER_METHOD, iam.OrderMethod);
     this.origin_location_cd_id.Value = GSC(SystemCodeType.ORDER_PLACEMENT_LOCATION, iam.OriginLocation);
     this.processing_location_cd_id.Value = GSC(SystemCodeType.ORDER_PLACEMENT_LOCATION, iam.ProcessingLocation);
     this.relationship_cd_id.Value = GSC(SystemCodeType.ENTITLEMENT_RELATIONSHIP, iam.Relationship);
     this.start_date.Value = iam.EnableDate;
 }