Beispiel #1
0
    void OnBtnConfirmClick()
    {
        if (_CurrentInputField.text == "")
        {
            return;
        }
        if (int.Parse(_CurrentInputField.text) % 100 != 0)
        {
            _CurrentInputField.text = "";
            ShowOnly100();
            return;
        }

        int money = int.Parse(_CurrentInputField.text);

        if (!ATMTaskManager._Instance.CheckMoney(money))
        {
            _CurrentInputField.text = "";
            ++WrongMoney;
            MoneyInCorrect();
            return;
        }
        if (money <= 0)
        {
            _CurrentInputField.text = "";
            return;
        }
        int outmoney = CardUserManager.TransferOutByID(ATMScreenManager._Instance.CurrentCardUser.UserID, money);

        ATMScreenTransferOut._Instance._OutMoney = outmoney;
        ATMTaskManager._Instance.TaskDone(TASKTYPE);
        ATMScreenTransferOut._Instance.SetGOActive(1);
    }
    void ShowBalance()
    {
        // text.text = CardUserManager.CheckUserBalanceByID(ScreenManager._Instance.CurrentCardUser.UserID);
        text.text = string.Format("{0:N}", CardUserManager.CheckUserBalanceByID(ATMScreenManager._Instance.CurrentCardUser.UserID));

        //紀錄查詢餘額錯誤次數
        ATMDataManager.Instance.WrongNumber = ATMScreenInputPassWord.WrongPassword;
        Debug.Log("查詢餘額錯誤次數: " + ATMDataManager.Instance.WrongNumber);

        ATMTaskManager._Instance.TaskDone(TASKTYPE);
    }
    void OnBtnConfirmClick()
    {
        if (_canConfirm == false)
        {
            _CurrentInputField.text = "";
            return;
        }
        int inputmoney;

        try
        {
            inputmoney = int.Parse(_CurrentInputField.text);
        }
        catch (Exception e)
        {
            _CurrentInputField.text = "";
            return;
        }

        if (inputmoney <= 0)
        {
            _CurrentInputField.text = "";
            return;
        }
        if (!ATMTaskManager._Instance.CheckMoney(inputmoney))
        {
            _CurrentInputField.text = "";
            ++WrongMoney;
            MoneyInCorrect();
            return;
        }


        int outmoney = CardUserManager.TransferOutByID(ATMScreenManager._Instance.CurrentCardUser.UserID, inputmoney);

        if (outmoney > 0)
        {
            CardUserManager.TransferInCard(ATMScreenTransfer._Instance._targetId, outmoney);
        }

        //紀錄轉帳總錯誤次數
        ATMDataManager.Instance.WrongNumber = ATMScreenInputPassWord.WrongPassword + ATMScreenTransferFirst.WrongAccount + WrongMoney;


        ATMTaskManager._Instance.TaskDone(TASKTYPE);
        ATMScreenTransfer._Instance._transfermoney = outmoney;
        ATMScreenTransfer._Instance.SetGOActive(3);
    }
    void OnBtnConfirmClick()
    {
        if (_CurrentInputField.text == "")
        {
            return;
        }
        string id   = _CurrentInputField.text;
        string name = CardUserManager.CheckUserNameByID(id);

        if (name != "")
        {
            ATMScreenTransfer._Instance.SetUserInfo(id, name);
        }
        else
        {
            ++WrongAccount;
            ShowInputError();
        }
    }
Beispiel #5
0
 void OnBtnConfirmClick()
 {
     if (_TextTransferInValue.text == "")
     {
         return;
     }
     else
     {
         int money = int.Parse(_TextTransferInValue.text);
         if (CardUserManager.TransferInCard(ATMScreenManager._Instance.CurrentCardUser.UserID, money))
         {
             Debug.LogError("存钱成功");
             _TextTransferInValue.text = 0 + "";
         }
         else
         {
             Debug.LogError("存钱失败");
         }
     }
 }