Beispiel #1
0
        public int Insert_Soa_Trans(List <FileInfo> logFiles, ServiceHelper sh)
        {
            string        query            = string.Empty;
            int           total            = 0;
            List <string> soatransactionId = new List <string>();

            foreach (FileInfo file in logFiles)
            {
                string   id           = ReadHelper.GetTransactionId_StreamReader(file);
                DateTime modifiedDate = file.LastWriteTime;
                if (id != null || id != string.Empty)
                {
                    OracleParameter[] parameters = new OracleParameter[]
                    {
                        new OracleParameter("SERVICE_NAME", sh.ServiceName),
                        new OracleParameter("TRANSID", id),
                        new OracleParameter("TRANSTIME", modifiedDate)
                    };
                    query = string.Format("INSERT into SOA_TRANSACTION (ID, SERVICE, TRANSACTION_ID, TRANSACTION_TIME)" +
                                          "(SELECT SQ_SOA_TRANSACTION.NEXTVAL ID, " +
                                          ":SERVICE_NAME SERVICE, " +
                                          ":TRANSID TRANSACTION_ID, " +
                                          ":TRANSTIME TRANSACTION_TIME " +
                                          "FROM DUAL)");
                    ExecNonQuery(query, parameters);
                    PrintHelper.Trace(string.Format(Messages.TransactionId_SUCCESS, id));
                    total++;
                }
            }

            return(total);
        }
Beispiel #2
0
        /// <summary>
        /// test locally without saving to database
        /// for debugging purposes only: call this method in Main()
        /// </summary>
        /// <param name="myService">Service Code</param>
        private static void TestTransactionId(ServiceCode myService)
        {
            PrintHelper.Trace(string.Format(Messages.GetServiceName, myService.ToString()));
            ServiceHelper   sh       = new ServiceHelper(myService);
            List <FileInfo> logFiles = ReadHelper.Read_SW_Logs(inputDate, sh);

            foreach (FileInfo file in logFiles)
            {
                DateTime createDate   = file.CreationTime;
                DateTime modifiedDate = file.LastWriteTime;
                string   id           = ReadHelper.GetTransactionId_StreamReader(file);
                PrintHelper.Trace(string.Format("the output transaction ID is {0}", id));
            }
        }