public ListAccountsByRCNoResp ListAccountsByRCNo( [FromBody] ListAccountsByRCNoReq listAccountsByRCNoReq) { if (CBNController.ValidateToken(this.Request.Headers.GetValues("Authorization").First <string>().ToString().Substring("Bearer ".Length).Trim())) { ListAccountsByRCNoReq listAccountsByRCNoReq1 = new ListAccountsByRCNoReq() { RCNo = listAccountsByRCNoReq.RCNo }; this.logger.Info <ListAccountsByRCNoReq>("Request {@value}", listAccountsByRCNoReq1); CBNIntegration.Models.ListAccountsByRCNo[] array = this.cBNIntegrationData.ListAccountsByRCNo(listAccountsByRCNoReq1).ToArray(); int length = array.Length; ListAccountsByRCNoResp accountsByRcNoResp = new ListAccountsByRCNoResp() { Status = this.success.ResponseCode, Msg = this.success.ResponseMessage, Result = array }; this.logger.Info <ListAccountsByRCNoResp>("Response {@value}", accountsByRcNoResp); return(accountsByRcNoResp); } ListAccountsByRCNoResp accountsByRcNoResp1 = new ListAccountsByRCNoResp() { Status = this.failed.ResponseCode, Msg = this.failed.ResponseMessage }; this.logger.Info <ListAccountsByRCNoResp>("Response {@value}", accountsByRcNoResp1); return(accountsByRcNoResp1); }
public List <CBNIntegration.Models.ListAccountsByRCNo> ListAccountsByRCNo( ListAccountsByRCNoReq listAccountsByRCNoReq) { try { using (OracleConnection cnn = new OracleConnection(this.connectionString)) { cnn.Open(); string sql = string.Format(File.ReadAllText(Path.Combine(Directory.GetCurrentDirectory(), this.ListAccountsByRCNoQry), Encoding.UTF8), (object)listAccountsByRCNoReq.RCNo); List <CBNIntegration.Models.ListAccountsByRCNo> list = cnn.Query <CBNIntegration.Models.ListAccountsByRCNo>(sql).ToList <CBNIntegration.Models.ListAccountsByRCNo>(); cnn.Close(); return(list); } } catch (Exception ex) { return(new List <CBNIntegration.Models.ListAccountsByRCNo>()); } }