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); } }
/// <summary> /// REst API - Authentication Api controller /// </summary> /// <param name="sUserID"></param> /// <param name="sPassword"></param> /// <param name="bRemember"></param> /// <returns></returns> protected string AuthenticateUser(string sUserID, string sPassword, bool bRemember) { string sContext = null; try { var oLogDispatchRestApiClient = new LogDispatchRestApiClient(); sContext = oLogDispatchRestApiClient.AuthenticateUser(sUserID, sPassword, bRemember); return(sContext); } catch (Exception oEx) { oEx.Log(); throw; } }