using GMEStatusSync.Common; using System; using System.Configuration; using System.Linq; using System.Threading.Tasks; namespace GMEStatusSync { class Program { static void Main(string[] args) { int runTimeForFullTxnSync = 22; int currentHour = DateTime.Now.Hour; if (currentHour >= runTimeForFullTxnSync) { GetStatic.WriteLog("Welcome to Automatic processing "); DoSyncStatus("Y"); } else { GetStatic.WriteLog("Welcome to Automatic processing "); DoSyncStatus("N"); } } static void DoSyncStatus(string doSyncTxn = "N") { var m = Task.Run(() => DoSyncTxn(doSyncTxn)); m.Wait(); } private static void DoSyncTxn(string doSyncTxn = "N") { try { Business.ICommonBusiness _business = new Business.CommonBusiness(); GetStatic.WriteLog("Api Request Started .."); //_business.GetStatusCommonBusiness("gccremit", doSyncTxn); //_business.GetStatusCommonBusiness("gmenepal", doSyncTxn); _business.GetStatusCommonBusiness("sendMN", doSyncTxn); GetStatic.WriteLog("Api Request Ended .."); } catch (Exception ex) { GetStatic.WriteLog(ex.ToString()); } } } }