Example #1
0
        } // !FromString()

        public static string EnumToString(this BuyerProductIdTypes c)
        {
            switch (c)
            {
            case BuyerProductIdTypes.BuyerSpecific: return("buyer_specific");

            case BuyerProductIdTypes.EAN: return("ean");

            case BuyerProductIdTypes.GTIN: return("gtin");

            case BuyerProductIdTypes.UPC: return("upc");

            default: return("");
            }
        } // !ToString()
Example #2
0
        public static BuyerProductIdTypes FromString(this BuyerProductIdTypes _, string s)
        {
            s = s.ToLower().Trim();
            switch (s)
            {
            case "buyer_specific": return(BuyerProductIdTypes.BuyerSpecific);

            case "ean": return(BuyerProductIdTypes.EAN);

            case "gtin": return(BuyerProductIdTypes.GTIN);

            case "upc": return(BuyerProductIdTypes.UPC);

            default: return(BuyerProductIdTypes.Unknown);
            }
        } // !FromString()