Esempio n. 1
0
    /// <summary>
    /// Return a list of shipping methods that use a ShippingProvider that implements
    /// the GetFilteredRates(Collection&lt;ShippingGroup&gt; g, ShippingMethod m) method.
    /// </summary>
    private ListItem[] GetShippingMethods()
    {
        List <ListItem> methods = new List <ListItem>();

        methods.Add(new ListItem("-n/a-", ""));
        foreach (ShippingMethod method in ShippingMethod.FindAll())
        {
            if (String.Compare(method.Bvin, ((BVShippingModule)NamingContainer).ShippingMethod.Bvin, true) == 0)
            {
                continue;
            }

            ShippingProvider provider = AvailableProviders.FindProviderById(method.ShippingProviderId);
            if (provider == null || !provider.ProviderId.Equals(method.ShippingProviderId, StringComparison.InvariantCultureIgnoreCase))
            {
                continue;
            }
            if (hiddenOrderProviders.IsMatch(provider.ProviderId))
            {
                continue;
            }

            methods.Add(new ListItem(method.Name, method.Bvin));
        }
        return(methods.ToArray());
    }
Esempio n. 2
0
    private ListItem[] GetShippingProviderServiceCodes()
    {
        List <ListItem>  codes    = new List <ListItem>();
        ShippingProvider provider = AvailableProviders.FindProviderById(ShippingProviderField.SelectedValue);

        if (String.Compare(provider.ProviderId, ShippingProviderField.SelectedValue, true) == 0)
        {
            foreach (ListItem item in provider.ListServiceCodes())
            {
                codes.Add(item);
            }
        }
        return(codes.ToArray());
    }