public TransactionDetailsResp TransactionDetails(
            [FromBody] TransactionDetailsReq transactionDetailsReq)
        {
            if (CBNController.ValidateToken(this.Request.Headers.GetValues("Authorization").First <string>().ToString().Substring("Bearer ".Length).Trim()))

            {
                TransactionDetailsReq transactionDetailsReq1 = new TransactionDetailsReq()
                {
                    StartDate = this.dateConvert(transactionDetailsReq.StartDate),
                    EndDate   = this.dateConvert(transactionDetailsReq.EndDate),
                    AccountNo = transactionDetailsReq.AccountNo
                };
                this.logger.Info <TransactionDetailsReq>("Request {@value}", transactionDetailsReq);
                CBNIntegration.Models.TransactionDetails[] array = this.cBNIntegrationData.TransactionDetails(transactionDetailsReq1).ToArray();
                int length = array.Length;
                TransactionDetailsResp transactionDetailsResp = new TransactionDetailsResp()
                {
                    Status = this.success.ResponseCode,
                    Msg    = this.success.ResponseMessage,
                    Result = array
                };
                this.logger.Info <TransactionDetailsResp>("Response {@value}", transactionDetailsResp);
                return(transactionDetailsResp);
            }
            TransactionDetailsResp transactionDetailsResp1 = new TransactionDetailsResp()
            {
                Status = this.failed.ResponseCode,
                Msg    = this.failed.ResponseMessage
            };

            this.logger.Info <TransactionDetailsResp>("Response {@value}", transactionDetailsResp1);
            return(transactionDetailsResp1);
        }
Пример #2
0
 public List <CBNIntegration.Models.TransactionDetails> TransactionDetails(
     TransactionDetailsReq transactionDetailsReq)
 {
     try
     {
         using (OracleConnection cnn = new OracleConnection(this.connectionString))
         {
             cnn.Open();
             string sql = string.Format(File.ReadAllText(Path.Combine(Directory.GetCurrentDirectory(), this.TransactionDetailsQry), Encoding.UTF8), (object)transactionDetailsReq.AccountNo, (object)transactionDetailsReq.StartDate, (object)transactionDetailsReq.EndDate);
             List <CBNIntegration.Models.TransactionDetails> list = cnn.Query <CBNIntegration.Models.TransactionDetails>(sql).ToList <CBNIntegration.Models.TransactionDetails>();
             cnn.Close();
             return(list);
         }
     }
     catch (Exception ex)
     {
         return(new List <CBNIntegration.Models.TransactionDetails>());
     }
 }