public IActionResult GetDocuments(int reqId, string docType) { SPOLDocUtility objUtil = new SPOLDocUtility(this.configuration); List <DocRepositoryBO> objDocs = new List <DocRepositoryBO>(); try { objDocs = objUtil.GetDocuments("TestLibrary", reqId, docType); if (objDocs == null) { return(NotFound()); } } catch (Exception ex) { return(BadRequest(ex.Message)); } return(Ok(objDocs)); }
public IActionResult Put([FromBody] DocRepositoryBO document) { SPOLDocUtility objUtil = new SPOLDocUtility(this.configuration); string result; try { result = objUtil.UpdateDocument(document); if (result.Contains("Error:")) { return(BadRequest(result)); } } catch (Exception ex) { return(BadRequest(ex.Message)); } return(Ok(result)); }
public IActionResult Delete(int docId) { SPOLDocUtility objUtil = new SPOLDocUtility(this.configuration); string result; try { result = objUtil.DeleteDocument("TestLibrary", docId.ToString()); if (result.Contains("Error:")) { return(BadRequest(result)); } } catch (Exception ex) { return(BadRequest(ex.Message)); } return(Ok(result)); }