Ejemplo n.º 1
0
        public int Step2(string code)
        {
            if (CheckVendor.NotValidCode(code))
            {
                return(03_0011);
            }

            if (CheckVendor.NotValidResponse(_serverResponse))
            {
                return(02_0008);
            }

            if (_email == null)
            {
                return(00_0000);
            }

            var recoveryEmail = new RecoveryEmail();

            recoveryEmail.Username = _username;

            recoveryEmail.Email = _email;

            recoveryEmail.Trace = _trace;

            recoveryEmail.Code = code;

            recoveryEmail.ReportTime = DateTime.Now;

            var result = ApiCall.AccountRecoveryEmail.Call(null, new MilvanethProtocol {
                Context = null, Data = recoveryEmail
            });

            if (!(result.Data is ServerResponse sr))
            {
                return(02_0007);
            }

            if (!CheckVendor.NotValidResponse(sr))
            {
                _serverResponse = sr;
            }

            return(sr.Message);
        }