Пример #1
0
 public static string ToString(MedicationKind value)
 {
     if (value == MedicationKind.Product)
     {
         return("product");
     }
     else if (value == MedicationKind.Package)
     {
         return("package");
     }
     else
     {
         throw new ArgumentException("Unrecognized MedicationKind value: " + value.ToString());
     }
 }
Пример #2
0
            public static bool TryParse(string value, out MedicationKind result)
            {
                result = default(MedicationKind);

                if (value == "product")
                {
                    result = MedicationKind.Product;
                }
                else if (value == "package")
                {
                    result = MedicationKind.Package;
                }
                else
                {
                    return(false);
                }

                return(true);
            }