예제 #1
0
        /// <summary>
        /// Register an employee/person
        /// </summary>
        /// <param name="template">Templte or image</param>
        /// <param name="registrationid"></param>
        /// <param name="token"></param>
        /// <param name="format">Format value needs only for FingerPrint operation</param>
        public string Register(string template, string registrationid, string token, string format = CloudABISConstant.CLOUDABIS_ISO)
        {
            CloudABISBiometricRequest biometricRequest = new CloudABISBiometricRequest
            {
                RegistrationID = registrationid,
                BiometricXml   = template,
                CustomerKey    = _customerKey,
                EngineName     = _engineName,
                Format         = format,
                Token          = token
            };
            CloudABISAPI      cloudABISAPI     = new CloudABISAPI(_appkey, _secretKey, _apiBaseUrl);
            CloudABISResponse matchingResponse = cloudABISAPI.Register(biometricRequest);

            if (matchingResponse != null)
            {
                if (matchingResponse.OperationName.Equals(EnumOperationName.Register) && matchingResponse.OperationResult.Equals(CloudABISConstant.SUCCESS))
                {
                    return("Registration Success!");
                }
                else
                {
                    return(CloudABISResponseParser.GetResponseMessage(matchingResponse.OperationResult));
                }
            }
            else
            {
                return("Something went wrong!");
            }
        }
예제 #2
0
        private static void Register(CloudABISScanrCaptureResponse cloudScanrCaptureResponse, string id)
        {
            CloudABISBiometricRequest biometricRequest = new CloudABISBiometricRequest
            {
                RegistrationID = id,
                BiometricXml   = cloudScanrCaptureResponse.TemplateData,
                CustomerKey    = _cloudABISAPICredentials.CustomerKey,
                EngineName     = CloudABISConstant.FINGERPRINT_ENGINE,
                Format         = CloudABISConstant.CLOUDABIS_ISO,
                Token          = _cloudABISToken.AccessToken
            };
            //Register Biometric
            CloudABISResponse matchingResponse = _cloudABISAPI.Register(biometricRequest);

            if (matchingResponse != null)
            {
                if (matchingResponse.Status.Equals(EnumOperationStatus.SUCCESS))
                {
                    if (matchingResponse.OperationResult.Equals(CloudABISConstant.MATCH_FOUND))
                    {
                        Console.WriteLine(CloudABISConstant.MATCH_FOUND + ":" + matchingResponse.BestResult.ID);
                    }
                    else
                    {
                        Console.WriteLine("IdentifyResult:" + matchingResponse.OperationResult);
                    }
                }
                else
                {
                    Console.WriteLine("IdentifyResult: " + matchingResponse.OperationResult);
                }
            }
            else
            {
                Console.WriteLine("Something went wrong!");
            }
        }