Exemplo n.º 1
0
        private SoftTokenDeviceExistenceTransactionResponse DeviceExistance(SoftTokenDeviceExistenceTransactionRequest model)
        {
            SoftTokenDeviceExistenceTransactionResponse response = null;
            SoftTokenDeviceExistenceTransactionRequest  request  = model;
            var callDispatcher = new VBMCallDispatcher();

            response = callDispatcher.DispatchAction <SoftTokenDeviceExistenceTransactionRequest, SoftTokenDeviceExistenceTransactionResponse>(
                "SoftTokenDeviceExistenceTransaction", MethodTypeEnum.Execute, Channels.SharedAspects, request);
            return(response);
        }
        public void Execute(object requestMessage, ref object responseMessage, TransactionHeader transactionHeader)
        {
            SoftTokenDeviceExistenceTransactionRequest  request  = requestMessage as SoftTokenDeviceExistenceTransactionRequest;
            SoftTokenDeviceExistenceTransactionResponse response = responseMessage as SoftTokenDeviceExistenceTransactionResponse;

            using (VeriBranchDataEntities dataEntities = new VeriBranchDataEntities())
            {
                var result = dataEntities.VPSoftTokenRegistration.Where(x => x.VpOtpDevice.SerialNumber.Equals(request.DeviceId)).ToList();

                if (result != null && result.Count > 0)
                {
                    response.IsExisting     = true;
                    response.UserId         = result[0].UserId;
                    response.UseFingerPrint = Convert.ToBoolean(result[0].Preference);
                }
                else
                {
                    response.IsExisting = false;
                }
            }
        }