You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

59 lines
1.4 KiB

8 months ago
  1. using GMEStatusSync.Common;
  2. using System;
  3. using System.Configuration;
  4. using System.Linq;
  5. using System.Threading.Tasks;
  6. namespace GMEStatusSync
  7. {
  8. class Program
  9. {
  10. static void Main(string[] args)
  11. {
  12. int runTimeForFullTxnSync = 22;
  13. int currentHour = DateTime.Now.Hour;
  14. if (currentHour >= runTimeForFullTxnSync)
  15. {
  16. GetStatic.WriteLog("Welcome to Automatic processing ");
  17. DoSyncStatus("Y");
  18. }
  19. else
  20. {
  21. GetStatic.WriteLog("Welcome to Automatic processing ");
  22. DoSyncStatus("N");
  23. }
  24. }
  25. static void DoSyncStatus(string doSyncTxn = "N")
  26. {
  27. var m = Task.Run(() => DoSyncTxn(doSyncTxn));
  28. m.Wait();
  29. }
  30. private static void DoSyncTxn(string doSyncTxn = "N")
  31. {
  32. try
  33. {
  34. Business.ICommonBusiness _business = new Business.CommonBusiness();
  35. GetStatic.WriteLog("GME Nepal Request Started ..");
  36. _business.GetStatusCommonBusiness("gmenepal", doSyncTxn);
  37. GetStatic.WriteLog("GME Nepal Request Ended ..");
  38. }
  39. catch (Exception ex)
  40. {
  41. GetStatic.WriteLog(ex.ToString());
  42. }
  43. }
  44. }
  45. }