Esempio n. 1
0
        private void LoadRunNumber(Driver oDriver)
        {
            const string ErrorKey = "LoadRunNumber";

            try
            {
                var oLogDispatchRestApiClient = new LogDispatchRestApiClient();

                string sRun = oLogDispatchRestApiClient.GetRun(oDriver);

                JObject oRunJObject = JObject.Parse(sRun);

                oDriver.CurrentRun = new Run(oRunJObject);
            }
            catch (RestApiException oRestApiException)
            {
                if (oRestApiException.StatusCode == HttpStatusCode.NotFound)
                {
                    return;
                }

                this.ModelState.AddModelError(ErrorKey, oRestApiException.Message);
            }
            catch (Exception oException)
            {
                this.ModelState.AddModelError(ErrorKey, oException.Message);
            }
        }