Ejemplo n.º 1
0
 static void accountInfo()
 {
     while (true)
     {
         clearScreen();
         GrdResult <GrdAccountInfo> result = GrdManager.AccountBalance(username);
         Console.WriteLine("ACCOUNT INFORMATION");
         Console.WriteLine("-----------------------------------");
         if (result.error != 0)
         {
             printError(result);
         }
         else
         {
             Console.WriteLine("Username:"******"");
             Console.WriteLine("Wallet address:" + result.data.address + "");
             Console.WriteLine("Balance:" + result.data.balance.ToString() + "");
         }
         Console.WriteLine("-----------------------------------");
         Console.WriteLine("TO DO");
         Console.WriteLine("1.Transfer money to other address (use for user).");
         Console.WriteLine("2.Charge from this account (use for game action).");
         Console.WriteLine("3.Pay money to this account(use for game action).");
         Console.WriteLine("4.List transactions");
         Console.WriteLine("5.Refresh.");
         Console.WriteLine("10.Go back...");
         Console.WriteLine("-----------------------------------");
         Console.Write("YOUR CHOISE:");
         userSelect = Console.ReadLine();
         if (userSelect.Equals("1"))
         {
             transfer();
         }
         else if (userSelect.Equals("2"))
         {
             chargeMoney();
         }
         else if (userSelect.Equals("3"))
         {
             payMoney();
         }
         else if (userSelect.Equals("4"))
         {
             listTransactions();
         }
         else if (userSelect.Equals("10"))
         {
             return;
         }
     }
 }
Ejemplo n.º 2
0
        public static void Main(String[] args)
        {
            const String appId  = "6e672e888487bd8346b946a715c74890077dc332";
            const String secret = "acc3e0404646c57502b480dc052c4fe15878a7ab84fb43402106c575658472faf7e9050c92a851b0016442ab604b0488aab3e67537fcfda3650ad6cfd43f7974";

            GrdManager.Init(appId, secret, GrdNet.Test);
            clearScreen();
            Console.Write("USER NAME:");
            username = Console.ReadLine();
            if (username.Length == 0)
            {
                return;
            }
            GrdManager.AccountBalance(username);//create user if is new user
            testMenu();
        }