Beispiel #1
0
 public static void ProcessAllGomsPendingTransactions()
 {
     var context = new IPTV2Entities();
     var service = new GomsTfcTv();
     var offering = context.Offerings.Find(2);
     service.ProcessAllPendingTransactionsInGoms(context, offering);
 }
Beispiel #2
0
        public static void ProcessAllGomsPendingTransactionsForUser()
        {

            var context = new IPTV2Entities();
            var service = new GomsTfcTv();
            var offering = context.Offerings.Find(2);
            var user = context.Users.FirstOrDefault(u => u.EMail == "*****@*****.**");            
            service.ProcessAllPendingTransactionsInGoms(context, offering, user);
        }
Beispiel #3
0
 public static void ProcessUser(Object stateInfo)
 {
     try
     {
         UserForProcessing user = (UserForProcessing)stateInfo;
         using (var context = new IPTV2Entities())
         {
             var thisUser = context.Users.Find(user.UserId);
             var offering = context.Offerings.Find(user.OfferingId);
             var service = new GomsTfcTv();
             service.ProcessAllPendingTransactionsInGoms(context, offering, thisUser);
             //var rand = new Random();
             //Thread.Sleep(rand.Next(2000));
             //Console.WriteLine("Processing for user {0}-{1}", user.UserId, System.DateTime.Now);
             user.Status = 1;
         }
     }
     catch (Exception) { throw; }
 }
Beispiel #4
0
        private static void Main(string[] args)
        {
            // TestConnectivity();
            // UserRegistration.TestRegisterUser();
            // UserRegistration.TestRegisterAllUsers();
            // TestGetUser();  //passed
            // PpcTests.LoadUatPpcs();
            // PpcTests.LoadMoreUatPpcs();
            // PpcTests.LoadUatTrialPpcs();
            // PpcTests.ExportAllPpcs();
            // PpcTests.GomsExportAll();
            //PpcTests.ExportPpc("AEBJL0000001", "AEBJL0000020");
            //PpcTests.ExportPpc("AABJL0000001", "AABJL0000020");

            // CreditCard.CreditCardReload();
            // CreditCard.CreditCardPurchase();

            // Forex.GetExchangeRates();

            // Case.CreateCase();

            // Transaction.PpcReload();
            // Transaction.ProcessAllGomsPendingTransactions();
            //Transaction.ProcessAllGomsPendingTransactionsForUser();

            //int offeringid = 2;
            //string email = "*****@*****.**";
            //var service = new GomsTfcTv();
            //var context = new IPTV2Entities();
            //var offering = context.Offerings.Find(offeringid);
            //var user = context.Users.FirstOrDefault(u => u.EMail == email);
            //service.ProcessAllPendingTransactionsInGoms(context, offering, user);
            //Console.ReadLine();
            //TestGetWallet();

            int offeringid = 2;
            string emails = "[email protected],[email protected],[email protected],[email protected]";
            emails = "*****@*****.**";
            var list = emails.Split(',');
            var service = new GomsTfcTv();
            var context = new IPTV2Entities();
            var offering = context.Offerings.Find(offeringid);
            Console.WriteLine("Process start.");
            foreach (var email in list)
            {
                var user = context.Users.FirstOrDefault(u => u.EMail == email);
                Console.Write(String.Format("Processing user {0}...", email));
                service.ProcessAllPendingTransactionsInGoms(context, offering, user);
                Console.WriteLine("DONE.");
            }
            Console.WriteLine("Process finish.");
            //Console.ReadLine();


            //int offeringid = 2;
            //var service = new GomsTfcTv();
            //var context = new IPTV2Entities();
            //var offering = context.Offerings.Find(offeringid);
            //Console.WriteLine("Process start.");
            //// Update Forex
            //service.GetExchangeRates(context, "USD");
            //// Process Transactions
            //service.ProcessAllPendingTransactionsInGoms(context, offering);
            //Console.WriteLine("Process finish.");
            
            // Console.ReadLine();
        }