Ejemplo n.º 1
0
        public ActionResult <CmsValidation> Login([FromBody] CmsLogin 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 RequestLogin(data).XML);

            if (xmlRet == null)
            {
                return(Ok("Got empty response string from the service"));
            }
            CmsValidation ret = new CmsValidation(xmlRet);

            Utils.DatabaseAdapter.saveBureauResponse(ret, reqId);

            return(Ok(ret));
        }
Ejemplo n.º 2
0
        public static int saveBureauResponse(CmsValidation res, int reqId)
        {
            BureauResponse resObj = new BureauResponse(reqId, RES_LOGIN_ID_VALID, Newtonsoft.Json.JsonConvert.SerializeObject(res), "", DateTime.Now);

            return(saveBureauResponse(resObj));
        }