public ListInternalAccountsFullResp ListInternalAccountsFull(
            [FromBody] ListInternalAccountsFullReq listInternalAccountsFullReq)
        {
            string AuthToken = this.Request.Headers.GetValues("Authorization").First <string>().ToString().Substring("Bearer ".Length).Trim();
            ListInternalAccountsFullReq listInternalAccountsFullReq1 = new ListInternalAccountsFullReq()
            {
                LedgerCode = listInternalAccountsFullReq.LedgerCode
            };

            if (CBNController.ValidateToken(AuthToken))
            {
                this.logger.Info <ListInternalAccountsFullReq>("Request {@value}", listInternalAccountsFullReq1);
                CBNIntegration.Models.ListInternalAccountsFull[] array = this.cBNIntegrationData.ListInternalAccountsFull(listInternalAccountsFullReq1).ToArray();
                int length = array.Length;
                ListInternalAccountsFullResp accountsFullResp = new ListInternalAccountsFullResp()
                {
                    Status = this.success.ResponseCode,
                    Msg    = this.success.ResponseMessage,
                    Result = array
                };
                this.logger.Info <ListInternalAccountsFullResp>("Response {@value}", accountsFullResp);
                return(accountsFullResp);
            }
            ListInternalAccountsFullResp accountsFullResp1 = new ListInternalAccountsFullResp()
            {
                Status = this.failed.ResponseCode,
                Msg    = this.failed.ResponseMessage
            };

            this.logger.Info <ListInternalAccountsFullResp>("Response {@value}", accountsFullResp1);
            return(accountsFullResp1);
        }
Esempio n. 2
0
 public List <CBNIntegration.Models.ListInternalAccountsFull> ListInternalAccountsFull(
     ListInternalAccountsFullReq listInternalAccountsFullReq)
 {
     try
     {
         using (OracleConnection cnn = new OracleConnection(this.connectionString))
         {
             cnn.Open();
             string sql = string.Format(File.ReadAllText(Path.Combine(Directory.GetCurrentDirectory(), this.ListInternalAccountsFullQry), Encoding.UTF8), (object)listInternalAccountsFullReq.LedgerCode);
             List <CBNIntegration.Models.ListInternalAccountsFull> list = cnn.Query <CBNIntegration.Models.ListInternalAccountsFull>(sql).ToList <CBNIntegration.Models.ListInternalAccountsFull>();
             cnn.Close();
             return(list);
         }
     }
     catch (Exception ex)
     {
         return(new List <CBNIntegration.Models.ListInternalAccountsFull>());
     }
 }