Exemple #1
0
 public override void ShowStateDescription()
 {
     Console.WriteLine("State: Started and in progress!");
     Console.WriteLine("Started on: " + StartedAt.ToString("dd/MM/yyyy hh:mm:ss"));
     Console.WriteLine("Is Approved? " + (Approved ? "Yes" : "No"));
     Console.WriteLine("Allocated Employee: " + AllocatedEmployee);
 }
        public String ToJSON(Boolean iFinish,
                             HttpStatusCode iStatusCode,
                             IJSONSerialisable iReturnValue,
                             Newtonsoft.Json.Formatting iFormatting)
        {
            if (iFinish)
            {
                Finish();
            }
            JObject pJOtJSON       = new JObject();
            JObject pJOtStatistics = new JObject();

            pJOtStatistics.Add("StartedAt", new JValue(StartedAt.ToString(EnvironmentHelpers.GetEnvironmentVariable("DateTimeFormat"))));
            pJOtStatistics.Add("FinishedAt", new JValue(StartedAt.ToString(EnvironmentHelpers.GetEnvironmentVariable("DateTimeFormat"))));
            pJOtStatistics.Add("Ellapsed", new JValue(Ellapsed.ToString()));
            pJOtJSON.Add("Statistics", pJOtStatistics);
            JObject pJOtResponse = new JObject();

            pJOtResponse.Add("StatusCode", new JValue((Int32)iStatusCode));
            pJOtResponse.Add("ReturnValue", iReturnValue.ToJObject());
            pJOtJSON.Add("Response", pJOtResponse);
            return(pJOtJSON.ToString(iFormatting));
        }
 public override string ToString()
 {
     return($"{Id.ToString()}@{StartedAt.ToString(CultureInfo.InvariantCulture)}");
 }