private Party ProcessProvider() { Party party = new Party(); party.PopulateFrom(_provider); party.party_type_cd_id.Value = GSC(SystemCodeType.PARTY_TYPE, "business"); party.Variable = new SqlVariable("buid_" + _provider.Code); _sqlEntities.Add(party); Business_unit bu = new Business_unit(); bu.PopulateFrom(_provider); bu.party_id.Value = party.Variable; _sqlEntities.Add(bu); if (_provider.Extra != null) { Business_unit_property bup = new Business_unit_property(); bup.PopulateFrom(_provider.Extra); _sqlEntities.Add(bup); } foreach (var id in _provider.AuthMethods) { Business_unit_product_id_auth_method bupiam = new Business_unit_product_id_auth_method(); bupiam.PopulateFrom(id); bupiam.business_unit_party_id.Value = party.Variable; _sqlEntities.Add(bupiam); } if (_provider.ExpediteFees.Count > 0) { Business_unit_product expediteFeeBUP = new Business_unit_product(); expediteFeeBUP.GenVariable(); expediteFeeBUP.end_date.Value = _provider.DisableDate; expediteFeeBUP.is_expedited.Value = false; expediteFeeBUP.party_id.Value = party.Variable; expediteFeeBUP.product_display_name.Value = Constants.EXPEDITE_FEE_DISPLAY_NAME; expediteFeeBUP.product_id.Value = GetBaseProduct(Constants.EXPEDITE_FEE_BASE_PRODUCT); expediteFeeBUP.product_internal_name.Value = Constants.EXPEDITE_FEE_INTERNAL_NAME; expediteFeeBUP.product_rule_cd_id.Value = null; expediteFeeBUP.settlement_action_cd_id.Value = null; expediteFeeBUP.start_date.Value = _provider.EnableDate; _sqlEntities.Add(expediteFeeBUP); AttachFeeCollection(_provider.ExpediteFees, expediteFeeBUP, "agency expedite"); } // // Set up the vc fee "product". // Business_unit_product vcFeeBUP = new Business_unit_product(); Service vcfeeService = new Service(null); vcFeeBUP.PopulateFrom(vcfeeService); vcFeeBUP.GenVariable(); vcFeeBUP.end_date.Value = _provider.DisableDate; vcFeeBUP.is_expedited.Value = false; vcFeeBUP.party_id.Value = party.Variable; vcFeeBUP.product_display_name.Value = Constants.VCFEE_DISPLAY_NAME; vcFeeBUP.product_id.Value = GetBaseProduct(Constants.VCFEE_BASE_PRODUCT); vcFeeBUP.product_internal_name.Value = Constants.VCFEE_INTERNAL_NAME; vcFeeBUP.product_rule_cd_id.Value = null; vcFeeBUP.settlement_action_cd_id.Value = null; vcFeeBUP.start_date.Value = _provider.EnableDate; _sqlEntities.Add(vcFeeBUP); AttachFeeCollection(_provider.AgencyFees, vcFeeBUP, "vitalchek processing"); foreach (var pc in _provider.PcpidConfigs) { Procheck_config config = new Procheck_config(); config.PopulateFrom(pc); config.business_unit_party_id.Value = party.Variable; _sqlEntities.Add(config); } foreach (var a in _provider.Addresses) { SqlRendering.Entities.Address address = new SqlRendering.Entities.Address(); address.PopulateFrom(a); address.party_id.Value = party.Variable; _sqlEntities.Add(address); } foreach (var x in _provider.Phones) { Phone_number phone = new Phone_number(); phone.PopulateFrom(x); phone.party_id.Value = party.Variable; _sqlEntities.Add(phone); } // // Say it with me: shipping is not a product. It is a service. // foreach (var x in _provider.ShippingServices) { Business_unit_product bup = new Business_unit_product(); bup.PopulateFrom(x); bup.party_id.Value = party.Variable; bup.product_id.Value = GetBaseProduct(x.BaseProduct); bup.Variable = new SqlVariable(x.BaseProduct + "_BUPID"); _services.Add(x, bup.Variable); _sqlEntities.Add(bup); AttachFeeCollection(x.Fees, bup, "delivery"); } foreach (var term in _provider.Terminals) { Business_unit_merchant_number bumn = new Business_unit_merchant_number(); bumn.PopulateFrom(term); bumn.business_unit_party_id.Value = party.Variable; bumn.provider_id.Value = _provider.Code; bumn.GenVariable(); _sqlEntities.Add(bumn); Terminal_id ti = new Terminal_id(); ti.PopulateFrom(term); ti.business_unit_merchant_number_id.Value = bumn.Variable; ti.GenVariable(); _sqlEntities.Add(ti); } foreach (var c in _provider.Contents) { Template t = new Template(); t.PopulateFrom(c); t.template_text.Value = _contentTexts[c.Text]; SqlVariable templateVariable = AddUniqueSqlEntity(t); Content_assignment ca = new Content_assignment(); ca.PopulateFrom(c); ca.attached_to_type_cd_id.Value = GSC(SystemCodeType.SYSTEM_OBJECT_TYPE, "business unit"); ca.template_id.Value = templateVariable; ca.attached_to_id.Value = party.Variable; _sqlEntities.Add(ca); } return party; }
public void PopulateFrom(ProviderExtra pe) { Business_unit_property bup = new Business_unit_property(); //bup.close_report_email_format_cd_id bup.is_adl_available_at_agency.Value = pe.IsAdlAvailablAtAgency; bup.is_adl_available_in_call_center.Value = pe.IsAdlAvailablInCallCenter; bup.is_adl_available_on_web.Value = pe.IsAdlAvailableOnWeb; bup.is_allow_upload_images_on_web.Value = pe.IsAllowUploadImagesOnWeb; bup.is_call_center_can_process.Value = pe.IsCallCenterCanProcess; bup.is_can_ocr_images.Value = pe.IsCanOcrImages; bup.is_saturday_delivery_restricted.Value = pe.IsSaturdayDeliveryRestricted; bup.is_settlement_export_allowed.Value = pe.IsSettlementReportAllowed; bup.is_shipping_notification_realtime.Value = pe.IsShippingNotificationRealtime; bup.is_show_all_last_names.Value = pe.IsShowAllLastNames; bup.is_staffed_every_day.Value = pe.IsStaffedEveryDay; bup.is_ups_upgrade.Value = pe.IsUpsUpgrade; bup.is_validate_address_at_agency.Value = pe.IsValidateAddressAtAgency; bup.is_validate_address_in_call_center.Value = pe.IsValidationAddressInCallCenter; bup.is_validate_address_on_web.Value = pe.IsValidateAddressOnWeb; bup.is_vps_web.Value = pe.IsVpsWeb; bup.is_walk_up_card_not_present.Value = pe.IsWalkupCardNotPresent; bup.num_order_archive_months.Value = pe.NumOrderArchiveMonths; bup.place_name.Value = pe.PlaceName; }