static public void Delete(System.Int32 id, esSqlAccessType sqlAccessType) { var obj = new ShippingServiceRateType(); obj.Id = id; obj.AcceptChanges(); obj.MarkAsDeleted(); obj.Save(sqlAccessType); }
public static ShippingServiceRateType Find(int shippingServiceId, string name) { var q = new ShippingServiceRateTypeQuery(); q.Where(q.ShippingServiceId == shippingServiceId, q.Name == name); ShippingServiceRateType shippingMethod = new ShippingServiceRateType(); return(shippingMethod.Load(q) ? shippingMethod : null); }
//public string Key //{ // get { return string.Format(@"{0}-{1}-{2}", this.StoreId, this.ProviderId, this.Name); } //} public static ShippingServiceRateType Get(int id) { var shippingMethod = new ShippingServiceRateType(); if (shippingMethod.LoadByPrimaryKey(id)) { return(shippingMethod); } return(null); }
private static DataModel.Store CreateInitialStoreForPortal(PortalSettings portalSettings) { //--- Create the Store for this Portal DataModel.Store newStore = new DataModel.Store(); newStore.PortalId = portalSettings.PortalId; newStore.Name = portalSettings.PortalName; newStore.Save(); //--- Set some sensible default settings newStore.UpdateSetting(StoreSettingNames.OrderCompletedEmailRecipient, portalSettings.Email); newStore.UpdateSetting(StoreSettingNames.CustomerServiceEmailAddress, portalSettings.Email); //--- Copy over the default email templates newStore.AddMissingEmailTemplates(); //--- Set the default payment processor to 'CardCaptureOnly' CardCaptureOnlyPaymentProvider cardCapturePaymentProvider = new CardCaptureOnlyPaymentProvider(newStore.GetPaymentProviderConfig(PaymentProviderName.CardCaptureOnly)); cardCapturePaymentProvider.IsEnabled = true; newStore.UpdatePaymentProviderConfig(cardCapturePaymentProvider.GetConfiguration()); //--- Add a default shipping service and rate type var newShippingService = new DataModel.ShippingService(); newShippingService.StoreId = newStore.Id.Value; newShippingService.ShippingProviderType = (short)ShippingProviderType.CustomShipping; newShippingService.Save(); Dictionary <string, string> settings = newShippingService.GetSettingsDictionary(); settings["IsEnabled"] = true.ToString(); newShippingService.UpdateSettingsDictionary(settings); var newRateType = new DataModel.ShippingServiceRateType(); newRateType.ShippingServiceId = newShippingService.Id.Value; newRateType.Name = "Standard"; newRateType.DisplayName = "Standard"; newRateType.Save(); var fedexService = new DataModel.ShippingService(); fedexService.StoreId = newStore.Id.Value; fedexService.ShippingProviderType = (short)ShippingProviderType.FedEx; fedexService.Save(); Dictionary <string, string> fedexSettings = fedexService.GetSettingsDictionary(); fedexSettings["IsEnabled"] = false.ToString(); fedexService.UpdateSettingsDictionary(fedexSettings); return(newStore); }