Ejemplo n.º 1
0
 // -------------------------------------------------------------------------------
 // GenerateCode
 // -------------------------------------------------------------------------------
 public int GenerateCode(Constants.AccountActionType accountActionType)
 {
     ResetCode();
     nCode  = UnityEngine.Random.Range(1000, 9999);
     Action = accountActionType;
     return(nCode);
 }
Ejemplo n.º 2
0
        // ===============================================================================
        // ACCOUNT RELATED
        // ===============================================================================

        // -------------------------------------------------------------------------------
        // RequestSecurityCode
        // -------------------------------------------------------------------------------
        public bool RequestSecurityCode(CAccount cAccount, Constants.AccountActionType accountActionType)
        {
            if (cAccount.IsEmpty || accountActionType == Constants.AccountActionType.None)
            {
                return(false);
            }

            int tmpCode = cAccount.GenerateCode(accountActionType);

            mailManager.SendMailSecurityCode(cAccount.sMail, tmpCode);

            return(databaseManager.AccountSave(cAccount));
        }
Ejemplo n.º 3
0
 // -------------------------------------------------------------------------------
 // ValidateAll
 // -------------------------------------------------------------------------------
 public bool ValidateAll(Constants.AccountActionType Action, int _nCode)
 {
     return(ValidateCode(_nCode) && ValidateAction(Action));
 }
Ejemplo n.º 4
0
 // -------------------------------------------------------------------------------
 // ValidateAction
 // -------------------------------------------------------------------------------
 public bool ValidateAction(Constants.AccountActionType _Action)
 {
     return(Action == _Action);
 }
Ejemplo n.º 5
0
 //--------------------------------------------------------------------------------
 // Init
 //--------------------------------------------------------------------------------
 public void Init(Constants.AccountActionType accountActionType, Action <bool> _callbackFunction)
 {
     nAction          = (int)accountActionType;
     callbackFunction = _callbackFunction;
     Show();
 }