public ActionResult <GetAliasCreditScoreResult> GetAliasCreditScore([FromBody] GetAliasCreditScoreModel data) { if (data == null) { return(BadRequest()); } int reqId = Utils.DatabaseAdapter.saveBureauRequest(data); if (reqId == 0) { return(Ok("Data not saved in DB")); } string xmlRet = Utils.Caller.sendRequestToICE(data.HTTP_GET_URL); if (xmlRet == null) { return(Ok("Got empty response string from the service")); } GetAliasCreditScoreResult ret = new GetAliasCreditScoreResult(xmlRet); Utils.DatabaseAdapter.saveBureauResponse(ret, reqId); return(Ok(ret)); }
public static int saveBureauRequest(GetAliasCreditScoreModel req) { DateTime curDateTime = DateTime.Now; BureauRequest reqObj = new BureauRequest(curDateTime, $"({req.UserID}, {req.Password})", Newtonsoft.Json.JsonConvert.SerializeObject(req), "", BUREAU_ID_ICE, curDateTime); return(saveBureauRequest(reqObj)); }