public ActionResult <CmsCRReportDetail> ReportDetail([FromBody] CmsCRReportRequest data) { if (data == null) { return(BadRequest()); } int reqId = Utils.DatabaseAdapter.saveBureauRequest(Utils.DatabaseAdapter.BUREAU_ID_NACM_National, data); if (reqId == 0) { return(Ok("Data not saved in DB")); } string xmlRet = Utils.Caller.sendRequestToNACM(Utils.Caller.API_URL_NACM, new RequestReport(data).XML); if (xmlRet == null) { return(Ok("Got empty response string from the service")); } CmsCRReportDetail ret = new CmsCRReportDetail(xmlRet); Utils.DatabaseAdapter.saveBureauResponse(ret, reqId); return(Ok(ret)); }
public static int saveBureauResponse(CmsCRReportDetail res, int reqId) { BureauResponse resObj = new BureauResponse(reqId, RES_LOGIN_ID_VALID, Newtonsoft.Json.JsonConvert.SerializeObject(res), "", DateTime.Now); return(saveBureauResponse(resObj)); }