예제 #1
0
        /// <summary>
        /// print list of transaction ID from
        /// </summary>
        /// <param name="selDate"></param>
        /// <param name="serviceName"></param>
        public static void Print_QS_TransactionId(DateTime selDate,
                                                  ServiceHelper sh)
        {
            List <string> transactionList = ReadHelper.Read_QS_TransactionId(selDate, sh);

            if (transactionList.Count > 0)
            {
                foreach (string id in transactionList)
                {
                    Console.WriteLine("QS ID is : {0}", id);
                }
            }
            Console.WriteLine("Total is {0}", transactionList.Count);
            Console.ReadLine();
        }
예제 #2
0
        /// <summary>
        /// Main will call this function. Start Here
        /// </summary>
        /// <param name="myService"></param>
        private static void StartProgram(ServiceCode myService)
        {
            PrintHelper.Trace(string.Format(Messages.GetServiceName, myService.ToString()));
            try
            {
                ServiceHelper sh = new ServiceHelper(myService);

                //SWTNBHelper sWTNB = new SWTNBHelper();
                //List<string> retString = sWTNB.GetTransId(inputDate, sh);

                //get logfiles from folder based on date and insert data to SOA Transaction
                List <FileInfo> logFiles = ReadHelper.Read_SW_Logs(inputDate, sh);
                PrintHelper.Trace(Messages.InsertSOA_TRANSACTION);
                Insert_SOA_Transaction(logFiles, sh);

                //Compare with QS Report and save difference in KSF_SYSTEM_SOA_FAIL_TRANS
                List <string> soaTransactionList = ReadHelper.Read_QS_TransactionId(inputDate, sh);
                List <string> swTransactionList  = ReadHelper.Read_SW_Transaction_ID(logFiles);

                PrintHelper.Trace(Messages.RemoveDuplicates);
                soaTransactionList = soaTransactionList.Distinct().ToList();
                swTransactionList  = swTransactionList.Distinct().ToList();

                PrintHelper.Trace(string.Format(Messages.TotalTransId_QS, soaTransactionList.Count));
                PrintHelper.Trace(string.Format(Messages.TotalTransId_SW, swTransactionList.Count));

                //this will insert the difference into KSF_SYSTEM_SOA_FAIL_TRANS table
                PrintHelper.Trace(Messages.InsertKSF_SYSTEM_SOA_FAIL_TRANS);
                var difference = soaTransactionList.Except(swTransactionList);
                //var difference = swTransactionList.Except(soaTransactionList);
                if (difference.Count() == 0)
                {
                    PrintHelper.Trace(string.Format(Messages.TotalDifferenceZero, difference.Count().ToString()));
                }
                else
                {
                    PrintHelper.Trace(string.Format(Messages.TotalDifference, difference.Count().ToString()));
                    Insert_SOA_Fail_Trans(difference, sh, inputDate);
                }
            }
            catch (Exception ex)
            {
                PrintHelper.Error(ex.Message);
                PrintHelper.Error(ex.ToString());
            }
        }