Beispiel #1
0
 public static void AddCoins(UInt32 accountId, Int32 amount)
 {
     using (var db = new OTNetContext()){
         var account = _queryAccount(db, accountId);
         account.Coins += Convert.ToUInt32(amount);
         db.SaveChanges();
     }
 }
Beispiel #2
0
        public static void RegisterTransaction(UInt32 accountId, Int32 coins, string description)
        {
            using (var db = new OTNetContext()){
                var newStoreHistory = new StoreHistory {
                    AccountId   = accountId,
                    CoinAmount  = coins,
                    Description = description,
                    Time        = DateTime.Now
                };

                db.StoreHistory.Add(newStoreHistory);
                db.SaveChanges();
            }
        }