Пример #1
0
        public void ProcessUpgradeTransactionInGoms(IPTV2Entities context, UpgradeTransaction t)
        {
            try// added try catch to save GomsRemarks
            {

                if (t.GomsTransactionId != null)
                    throw new Exception("Transaction already processed in GOMS.");

                if (!IsUserVerifiedInTv(context, t.UserId))
                {
                    throw new Exception("User is not verified in TFC.tv");
                }
            }
            catch (Exception e)
            {
                //try
                //{
                //    t.GomsRemarks = e.Message;
                //    context.SaveChanges();
                //}
                //catch (Exception ex)
                //{
                //    Console.WriteLine("Error in saving GomsRemarks:" + ex.Message);
                //}
                throw e;
            }
        }
Пример #2
0
 private static UpgradeTransaction CreateUpgradeTransaction(DateTime originalExpirationDate, int originalProductId, DateTime newExpirationDate, int newProductId, string CurrencyCode, DateTime registDt)
 {
     UpgradeTransaction transaction = new UpgradeTransaction()
     {
         Amount = 0,
         NewExpirationDate = newExpirationDate,
         NewProductId = newProductId,
         OriginalExpirationDate = originalExpirationDate,
         OriginalProductId = originalProductId,
         Currency = CurrencyCode,
         Date = registDt,
         OfferingId = GlobalConfig.offeringId,
         Reference = "UPGRADE TO PREMIUM",
         StatusId = GlobalConfig.Visible
     };
     return transaction;
 }