public IHttpActionResult GetHelpDocWithID([FromUri] int HelpDocID, [FromUri] string lang = "en", [FromUri] string extra = "") { using (CSSPDBContext db = new CSSPDBContext(DatabaseType)) { HelpDocService helpDocService = new HelpDocService(new Query() { Language = (lang == "fr" ? LanguageEnum.fr : LanguageEnum.en) }, db, ContactID); helpDocService.Query = helpDocService.FillQuery(typeof(HelpDoc), lang, 0, 1, "", "", extra); if (helpDocService.Query.Extra == "A") { HelpDocExtraA helpDocExtraA = new HelpDocExtraA(); helpDocExtraA = helpDocService.GetHelpDocExtraAWithHelpDocID(HelpDocID); if (helpDocExtraA == null) { return(NotFound()); } return(Ok(helpDocExtraA)); } else if (helpDocService.Query.Extra == "B") { HelpDocExtraB helpDocExtraB = new HelpDocExtraB(); helpDocExtraB = helpDocService.GetHelpDocExtraBWithHelpDocID(HelpDocID); if (helpDocExtraB == null) { return(NotFound()); } return(Ok(helpDocExtraB)); } else { HelpDoc helpDoc = new HelpDoc(); helpDoc = helpDocService.GetHelpDocWithHelpDocID(HelpDocID); if (helpDoc == null) { return(NotFound()); } return(Ok(helpDoc)); } } }
public HelpDocTest() { helpDoc = new HelpDoc(); helpDocExtraA = new HelpDocExtraA(); helpDocExtraB = new HelpDocExtraB(); }