Billing.PurchaseDatabase.UpdatePurchasedItem C# (CSharp) Метод

UpdatePurchasedItem() приватный Метод

Updates the quantity of the given product to the given value. If the given value is zero, then the product is removed from the table.
private UpdatePurchasedItem ( string productId, int quantity ) : void
productId string the product to update
quantity int the number of times the product has been purchased
Результат void
        private void UpdatePurchasedItem(string productId, int quantity)
        {
            if (quantity == 0)
            {
                mDb.Delete(PURCHASED_ITEMS_TABLE_NAME, PURCHASED_PRODUCT_ID_COL + "=?", new string[] { productId });
                return;
            }
            ContentValues values = new ContentValues();
            values.Put(PURCHASED_PRODUCT_ID_COL, productId);
            values.Put(PURCHASED_QUANTITY_COL, quantity);
            mDb.Replace(PURCHASED_ITEMS_TABLE_NAME, null, values); // nullColumnHack
        }