コード例 #1
0
 public static string ToString(CarePlanActivityStatus value)
 {
     if (value == CarePlanActivityStatus.NotStarted)
     {
         return("not started");
     }
     else if (value == CarePlanActivityStatus.Scheduled)
     {
         return("scheduled");
     }
     else if (value == CarePlanActivityStatus.Ongoing)
     {
         return("ongoing");
     }
     else if (value == CarePlanActivityStatus.OnHold)
     {
         return("on hold");
     }
     else if (value == CarePlanActivityStatus.Completed)
     {
         return("completed");
     }
     else if (value == CarePlanActivityStatus.Discontinued)
     {
         return("discontinued");
     }
     else
     {
         throw new ArgumentException("Unrecognized CarePlanActivityStatus value: " + value.ToString());
     }
 }
コード例 #2
0
            public static bool TryParse(string value, out CarePlanActivityStatus result)
            {
                result = default(CarePlanActivityStatus);

                if (value == "not started")
                {
                    result = CarePlanActivityStatus.NotStarted;
                }
                else if (value == "scheduled")
                {
                    result = CarePlanActivityStatus.Scheduled;
                }
                else if (value == "ongoing")
                {
                    result = CarePlanActivityStatus.Ongoing;
                }
                else if (value == "on hold")
                {
                    result = CarePlanActivityStatus.OnHold;
                }
                else if (value == "completed")
                {
                    result = CarePlanActivityStatus.Completed;
                }
                else if (value == "discontinued")
                {
                    result = CarePlanActivityStatus.Discontinued;
                }
                else
                {
                    return(false);
                }

                return(true);
            }