public IHttpActionResult GetSession001(string term) { try { using (var client = new PEApi(_peApiUri)) { var sessionDate = client.SessionDates.Get1(term, "001"); if (sessionDate == null) { return(NotFound()); } return(Ok(sessionDate)); } } catch (HttpOperationException apiEx) { Log.Logger.Warning("Failed to GET Session 001 dates! Error: {Error}", apiEx.Message); return(InternalServerError(apiEx)); } catch (Exception ex) { Log.Logger.Warning("Failed to GET Session 001 dates! Error: {Error}", ex.Message); return(InternalServerError(ex)); } }
public IHttpActionResult GetUscLocations() { try { using (var client = new PEApi(_peApiUri)) { var uscLocations = client.UscLocations.Get(); if (uscLocations == null) { return(NotFound()); } else { return(Ok(uscLocations)); } } } catch (HttpOperationException apiEx) { Log.Logger.Error("Failed to GET USC Locations! Error: {Error}", apiEx.Message); return(InternalServerError(apiEx)); } catch (Exception ex) { Log.Logger.Error("Failed to GET USC Locations! Error: {Error}", ex.Message); return(InternalServerError(ex)); } }
public IHttpActionResult GetSpecialFeeCodes(string term) { try { using (var client = new PEApi(_peApiUri)) { var feeCodes = client.SpecialFeeCodes.Get1(term); if (feeCodes == null) { return(NotFound()); } else { List <string> SFCodes = new List <string>(); foreach (var specFeeCode in feeCodes) { SFCodes.Add(specFeeCode.FtCode + " " + specFeeCode.FtDescription); } return(Ok(SFCodes)); } } } catch (HttpOperationException apiEx) { Log.Logger.Error("Failed to GET Special Fee Codes for term " + term + "! Error: {Error}", apiEx.Message); return(InternalServerError(apiEx)); } catch (Exception ex) { Log.Logger.Error("Failed to GET Special Fee Codes for " + term + "! Error: {Error}", ex.Message); return(InternalServerError(ex)); } }
public IHttpActionResult GetSessionCodes() { try { using (var client = new PEApi(_peApiUri)) { var sessionCodes = client.SessionCodes.Get(); if (sessionCodes == null) { return(NotFound()); } return(Ok(new { sessionCodes })); } } catch (Exception ex) { Log.Logger.Error("Failed to GET Session Codes! Error: {Error}", ex.Message); return(InternalServerError(ex)); } }