Esempio n. 1
0
        public static string Bonuses(int periodTypeID, int bonusID, CommonResourceFormat format = CommonResourceFormat.Default)
        {
            var resourceKeyPrefix = "Bonus";
            var padding           = 3;

            // Build our resource key
            var resourceKey = "{0}_{1}_{2}".FormatWith(resourceKeyPrefix, periodTypeID, bonusID.ToString().PadLeft(padding, '0'));

            if (format != CommonResourceFormat.Default)
            {
                resourceKey += "_{0}".FormatWith(format.ToString());
            }

            // Get the resource
            var resource = GetGlobalResource("Common", resourceKey, "{0} {1} {2}".FormatWith(resourceKeyPrefix, periodTypeID, bonusID));

            // If the resource is null and we asked for a specific format, get the default format instead.
            if (resource.IsNullOrEmpty() && format != CommonResourceFormat.Default)
            {
                return(Bonuses(periodTypeID, bonusID, CommonResourceFormat.Default));
            }
            else
            {
                return(resource);
            }
        }
        public static string Bonuses(int periodTypeID, int bonusID, CommonResourceFormat format = CommonResourceFormat.Default)
        {
            var resourceKeyPrefix = "Bonus";
            var padding = 3;

            // Build our resource key
            var resourceKey = "{0}_{1}_{2}".FormatWith(resourceKeyPrefix, periodTypeID, bonusID.ToString().PadLeft(padding, '0'));
            if (format != CommonResourceFormat.Default) resourceKey += "_{0}".FormatWith(format.ToString());

            // Get the resource
            var resource = GetGlobalResource("Common", resourceKey, "{0} {1} {2}".FormatWith(resourceKeyPrefix, periodTypeID, bonusID));

            // If the resource is null and we asked for a specific format, get the default format instead.
            if (resource.IsNullOrEmpty() && format != CommonResourceFormat.Default)
            {
                return Bonuses(periodTypeID, bonusID, CommonResourceFormat.Default);
            }
            else
            {
                return resource;
            }
        }
Esempio n. 3
0
 public static string OrderStatuses(int orderStatusID, CommonResourceFormat format = CommonResourceFormat.Default)
 {
     return(GetCommonResource(orderStatusID, 2, "OrderStatus", "OrderStatuses", format));
 }
Esempio n. 4
0
 public static string Languages(int languageID, CommonResourceFormat format = CommonResourceFormat.Default)
 {
     return(GetCommonResource(languageID, 3, "Language", "Languages", format));
 }
Esempio n. 5
0
        private static string GetCommonResource(int id, int padding, string resourceKeyPrefix, string classKey, CommonResourceFormat format = CommonResourceFormat.Default)
        {
            // Build our resource key
            var resourceKey = "{0}_{1}".FormatWith(resourceKeyPrefix, id.ToString().PadLeft(padding, '0'));

            if (format != CommonResourceFormat.Default)
            {
                resourceKey += "_{0}".FormatWith(format.ToString());
            }

            // Get the resource
            var resource = GetGlobalResource("Common", resourceKey, "{0} {1}".FormatWith(resourceKeyPrefix, id));

            // If the resource is null and we asked for a specific format, get the default format instead.
            if (resource.IsNullOrEmpty() && format != CommonResourceFormat.Default)
            {
                return(GetCommonResource(id, padding, resourceKeyPrefix, "Common"));
            }
            else
            {
                return(resource);
            }
        }
 public static string Countries(string countryCode, CommonResourceFormat format = CommonResourceFormat.Default)
 {
     return(GetCommonResource(countryCode, 2, "Country", "Countries", format));
 }
Esempio n. 7
0
 public static string VolumeDescriptions(int volumeID, CommonResourceFormat format = CommonResourceFormat.Default)
 {
     return(GetCommonResource(volumeID, 3, "Volume_Description", "Volume_Description", format));
 }
Esempio n. 8
0
 public static string Subscriptions(int subscriptionID, CommonResourceFormat format = CommonResourceFormat.Default)
 {
     return(GetCommonResource(subscriptionID, 2, "Subscription", "Subscriptions", format));
 }
 public static string OrderStatuses(int orderStatusID, CommonResourceFormat format = CommonResourceFormat.Default)
 {
     return GetCommonResource(orderStatusID, 2, "OrderStatus", "OrderStatuses", format);
 }
 public static string Languages(int languageID, CommonResourceFormat format = CommonResourceFormat.Default)
 {
     return GetCommonResource(languageID, 3, "Language", "Languages", format);
 }
 public static string FrequencyTypes(int frequencyTypeID, CommonResourceFormat format = CommonResourceFormat.Default)
 {
     return GetCommonResource(frequencyTypeID, 2, "FrequencyType", "FrequencyTypes", format);
 }
 public static string CustomerTypes(int customerTypeID, CommonResourceFormat format = CommonResourceFormat.Default)
 {
     return GetCommonResource(customerTypeID, 2, "CustomerType", "CustomerTypes", format);
 }
 public static string CreditCardTypes(int creditCardTypeID, CommonResourceFormat format = CommonResourceFormat.Default)
 {
     return GetCommonResource(creditCardTypeID, 2, "CreditCardType", "CreditCardTypes", format);
 }
        private static string GetCommonResource(int id, int padding, string resourceKeyPrefix, string classKey, CommonResourceFormat format = CommonResourceFormat.Default)
        {
            // Build our resource key
            var resourceKey = "{0}_{1}".FormatWith(resourceKeyPrefix, id.ToString().PadLeft(padding, '0'));
            if (format != CommonResourceFormat.Default) resourceKey += "_{0}".FormatWith(format.ToString());

            // Get the resource
            var resource = GetGlobalResource("Common", resourceKey, "{0} {1}".FormatWith(resourceKeyPrefix, id));

            // If the resource is null and we asked for a specific format, get the default format instead.
            if (resource.IsNullOrEmpty() && format != CommonResourceFormat.Default)
            {
                return GetCommonResource(id, padding, resourceKeyPrefix, "Common");
            }
            else
            {
                return resource;
            }
        }
Esempio n. 15
0
 public static string FrequencyTypes(int frequencyTypeID, CommonResourceFormat format = CommonResourceFormat.Default)
 {
     return(GetCommonResource(frequencyTypeID, 2, "FrequencyType", "FrequencyTypes", format));
 }
 public static string PaymentTypes(int paymentTypeID, CommonResourceFormat format = CommonResourceFormat.Default)
 {
     return GetCommonResource(paymentTypeID, 2, "PaymentType", "PaymentTypes", format);
 }
Esempio n. 17
0
 public static string PeriodTypes(int periodTypeID, CommonResourceFormat format = CommonResourceFormat.Default)
 {
     return(GetCommonResource(periodTypeID, 3, "PeriodType", "PeriodTypes", format));
 }
 public static string PeriodTypes(int periodTypeID, CommonResourceFormat format = CommonResourceFormat.Default)
 {
     return GetCommonResource(periodTypeID, 3, "PeriodType", "PeriodTypes", format);
 }
 public static string Volumes(int volumeID, CommonResourceFormat format = CommonResourceFormat.Default)
 {
     return GetCommonResource(volumeID, 3, "Volume", "Volumes", format);
 }
 public static string PointAccounts(int pointAccountID, CommonResourceFormat format = CommonResourceFormat.Default)
 {
     return GetCommonResource(pointAccountID, 2, "PointAccount", "PointAccounts", format);
 }
        private static string GetCommonResource(object id, int padding, string resourceKeyPrefix, string classKey, CommonResourceFormat format = CommonResourceFormat.Default, string defaultDescription = "")
        {
            if (id == null)
            {
                id = string.Empty;
            }

            // Build our resource key
            var resourceKey = "{0}_{1}".FormatWith(resourceKeyPrefix, id.ToString().PadLeft(padding, '0'));

            if (format != CommonResourceFormat.Default)
            {
                resourceKey += "_{0}".FormatWith(format.ToString());
            }

            // Get the resource
            var fallback = (!defaultDescription.IsNullOrEmpty()) ? defaultDescription : (format == CommonResourceFormat.Default) ? "{0} {1}".FormatWith(resourceKeyPrefix, id) : string.Empty;
            var resource = GetGlobalResource("Common", resourceKey, fallback);

            // If the resource is null and we asked for a specific format, get the default format instead.
            if (resource.IsNullOrEmpty() && format != CommonResourceFormat.Default)
            {
                return(GetCommonResource(id, padding, resourceKeyPrefix, "Common"));
            }
            else
            {
                return(resource);
            }
        }
 public static string Ranks(int rankID, CommonResourceFormat format = CommonResourceFormat.Default)
 {
     return GetCommonResource(rankID, 2, "Rank", "Ranks", format);
 }
 public static string Ranks(int rankID, CommonResourceFormat format = CommonResourceFormat.Default, string defaultDescription = "")
 {
     return(GetCommonResource(rankID, 2, "Rank", "Ranks", format, defaultDescription));
 }
 public static string GetCountryTaxCode(string CountryCode, CommonResourceFormat format = CommonResourceFormat.Default)
 {
     return GetCommonResource(CountryCode, 2, "TaxCode", "TaxCodes", format);
 }
Esempio n. 25
0
 public static string CreditCardTypes(int creditCardTypeID, CommonResourceFormat format = CommonResourceFormat.Default)
 {
     return(GetCommonResource(creditCardTypeID, 2, "CreditCardType", "CreditCardTypes", format));
 }
 public static string DepositAccountType(int accountTypeID, CommonResourceFormat format = CommonResourceFormat.Default)
 {
     return GetCommonResource(accountTypeID, 2, "DepositAccountType", "DepositAccountTypes", format);
 }
Esempio n. 27
0
 public static string CustomerStatuses(int customerStatusID, CommonResourceFormat format = CommonResourceFormat.Default)
 {
     return(GetCommonResource(customerStatusID, 2, "CustomerStatus", "CustomerStatuses", format));
 }
 public static string ResourceTypes(string ResourceDescription, CommonResourceFormat format = CommonResourceFormat.Default)
 {
     var key = ResourceDescription.Replace("&", "").Replace(" ", "").ToLower();
     return GetGlobalResource("Common", "ResourceType_" + key, ResourceDescription);
 }
Esempio n. 29
0
 public static string Ranks(int rankID, CommonResourceFormat format = CommonResourceFormat.Default)
 {
     return(GetCommonResource(rankID, 2, "Rank", "Ranks", format));
 }
 public static string Categories(string categorydescription, CommonResourceFormat format = CommonResourceFormat.Default)
 {
     return GetCommonResource(categorydescription, 2, "Category", "Categories", format);
 }
Esempio n. 31
0
 public static string Volumes(int volumeID, CommonResourceFormat format = CommonResourceFormat.Default)
 {
     return(GetCommonResource(volumeID, 3, "Volume", "Volumes", format));
 }
 public static string CustomerTypeFilters(int customerTypeID, CommonResourceFormat format = CommonResourceFormat.Default)
 {
     return GetCommonResource(customerTypeID, 2, "CustomerTypeFilter", "CustomerTypeFilter", format);
 }
Esempio n. 33
0
 public static string PayableTypes(int payableTypeID, CommonResourceFormat format = CommonResourceFormat.Default)
 {
     return(GetCommonResource(payableTypeID, 2, "PayableType", "PayableTypes", format));
 }
 public static string CustomerStatuses(int customerStatusID, string key, CommonResourceFormat format = CommonResourceFormat.Default)
 {
     return GetCommonResource(customerStatusID, 2, key, key, format);
 }
Esempio n. 35
0
 public static string PointAccounts(int pointAccountID, CommonResourceFormat format = CommonResourceFormat.Default)
 {
     return(GetCommonResource(pointAccountID, 2, "PointAccount", "PointAccounts", format));
 }
Esempio n. 36
0
        public static string ResourceTypes(string resourceDescription, CommonResourceFormat format = CommonResourceFormat.Default)
        {
            var key = resourceDescription.Replace("&", "").Replace(" ", "").Replace("/", "").ToLower();

            return(GetCommonResource(key, 2, "ResourceType", "ResourceTypes", format, resourceDescription));
        }
Esempio n. 37
0
 public static string GetWebCategory(int CategoryID, CommonResourceFormat format = CommonResourceFormat.Default)
 {
     return(GetCommonResource(CategoryID, 2, "WebCategory", "WebCategory", format));
 }
 public static string Subscriptions(int subscriptionID, CommonResourceFormat format = CommonResourceFormat.Default)
 {
     return GetCommonResource(subscriptionID, 2, "Subscription", "Subscriptions", format);
 }