public IHttpActionResult GetAppErrLogWithID([FromUri] int AppErrLogID, [FromUri] string lang = "en", [FromUri] string extra = "") { using (CSSPDBContext db = new CSSPDBContext(DatabaseType)) { AppErrLogService appErrLogService = new AppErrLogService(new Query() { Language = (lang == "fr" ? LanguageEnum.fr : LanguageEnum.en) }, db, ContactID); appErrLogService.Query = appErrLogService.FillQuery(typeof(AppErrLog), lang, 0, 1, "", "", extra); if (appErrLogService.Query.Extra == "A") { AppErrLogExtraA appErrLogExtraA = new AppErrLogExtraA(); appErrLogExtraA = appErrLogService.GetAppErrLogExtraAWithAppErrLogID(AppErrLogID); if (appErrLogExtraA == null) { return(NotFound()); } return(Ok(appErrLogExtraA)); } else if (appErrLogService.Query.Extra == "B") { AppErrLogExtraB appErrLogExtraB = new AppErrLogExtraB(); appErrLogExtraB = appErrLogService.GetAppErrLogExtraBWithAppErrLogID(AppErrLogID); if (appErrLogExtraB == null) { return(NotFound()); } return(Ok(appErrLogExtraB)); } else if (appErrLogService.Query.Extra == "C") { AppErrLogExtraC appErrLogExtraC = new AppErrLogExtraC(); appErrLogExtraC = appErrLogService.GetAppErrLogExtraCWithAppErrLogID(AppErrLogID); if (appErrLogExtraC == null) { return(NotFound()); } return(Ok(appErrLogExtraC)); } else if (appErrLogService.Query.Extra == "D") { AppErrLogExtraD appErrLogExtraD = new AppErrLogExtraD(); appErrLogExtraD = appErrLogService.GetAppErrLogExtraDWithAppErrLogID(AppErrLogID); if (appErrLogExtraD == null) { return(NotFound()); } return(Ok(appErrLogExtraD)); } else { AppErrLog appErrLog = new AppErrLog(); appErrLog = appErrLogService.GetAppErrLogWithAppErrLogID(AppErrLogID); if (appErrLog == null) { return(NotFound()); } return(Ok(appErrLog)); } } }
public AppErrLogTest() { appErrLog = new AppErrLog(); appErrLogExtraA = new AppErrLogExtraA(); appErrLogExtraB = new AppErrLogExtraB(); }