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();
            }
        }
Beispiel #3
0
 public static UInt32 GetCoinBalance(UInt32 accountId)
 {
     using (var db = new OTNetContext()){
         return(_queryCoinBalance(db, accountId));
     }
 }