public static void addTransaction(Context context, Transaction transaction)
        {
            BillingDB db = new BillingDB(context);

            db.insert(transaction);
            db.close();
        }
 public static List<Transaction> getTransactions(Context context, String itemId)
 {
     BillingDB db = new BillingDB(context);
     ICursor c = db.queryTransactions(itemId);
     List<Transaction> transactions = cursorToList(c);
     db.close();
     return transactions;
 }
        public static List <Transaction> getTransactions(Context context, String itemId)
        {
            BillingDB          db           = new BillingDB(context);
            ICursor            c            = db.queryTransactions(itemId);
            List <Transaction> transactions = cursorToList(c);

            db.close();
            return(transactions);
        }
 public static int countPurchases(Context context, String itemId)
 {
     BillingDB db = new BillingDB(context);
     ICursor c = db.queryTransactions(itemId, PurchaseState.PURCHASED);
     int count = 0;
     if (c != null)
     {
         count = c.Count;
         c.Close();
     }
     db.close();
     return count;
 }
        public static int countPurchases(Context context, String itemId)
        {
            BillingDB db    = new BillingDB(context);
            ICursor   c     = db.queryTransactions(itemId, PurchaseState.PURCHASED);
            int       count = 0;

            if (c != null)
            {
                count = c.Count;
                c.Close();
            }
            db.close();
            return(count);
        }
 public static void addTransaction(Context context, Transaction transaction)
 {
     BillingDB db = new BillingDB(context);
     db.insert(transaction);
     db.close();
 }