Exemplo n.º 1
0
        public IHttpActionResult VerifyFingerprint([FromBody] requestParam requestParam)
        {
            //byte[] ansi2 = System.IO.File.ReadAllBytes(@"D:\WORK\SSS-UBP RF\LT.ansi-fmr");
            //byte[] ansi2 = System.IO.File.ReadAllBytes(@"D:\WORK\SSS-UBP RF\EDEL 0511\EDEL 0511_RT.ansi-fmr");

            CardData cardData = new CardData();
            string   errMsg   = "";
            short    response = sssUmidSrvcs.Helpers.UMIDLibrary.ReadBio(requestParam, cardData, ref errMsg);

            switch (response)
            {
            case 0:
                //1 to 1 matching
                response = cardData.VerifyFingerprint(requestParam.fingerprint, ref errMsg);

                switch (response)
                {
                case 0:
                    return(Ok("OK"));

                default:
                    if (errMsg == "")
                    {
                        return(Content(HttpStatusCode.Unauthorized, new response {
                            message = Helpers.Utilities.responseMessage("401B")
                        }));
                    }
                    else
                    {
                        logger.Error(cardData.CRN + " " + errMsg);
                        return(Content(HttpStatusCode.InternalServerError, new response {
                            message = errMsg
                        }));
                    }
                }

            case 1:
            case 2:
                return(Content(HttpStatusCode.Unauthorized, new response {
                    message = Helpers.Utilities.responseMessage("401A")
                }));

            default:
                return(Content(HttpStatusCode.InternalServerError, new response {
                    message = errMsg
                }));
            }
        }
Exemplo n.º 2
0
        public IHttpActionResult ReadCardWithAuthentication([FromBody] requestParam requestParam)
        {
            CardData cardData = new CardData();
            string   errMsg   = "";
            short    response = sssUmidSrvcs.Helpers.UMIDLibrary.ReadData(requestParam, cardData, ref errMsg);

            switch (response)
            {
            case 0:
                response = cardData.VerifyFingerprint(requestParam.fingerprint, ref errMsg);

                switch (response)
                {
                case 0:
                    return(Ok(cardData));

                default:
                    if (errMsg == "")
                    {
                        return(Content(HttpStatusCode.Unauthorized, new response {
                            message = Helpers.Utilities.responseMessage("401B")
                        }));
                    }
                    else
                    {
                        logger.Error(cardData.CRN + " " + errMsg);
                        return(Content(HttpStatusCode.InternalServerError, new response {
                            message = errMsg
                        }));
                    }
                }

            case 1:
            case 2:
                return(Content(HttpStatusCode.Unauthorized, new response {
                    message = Helpers.Utilities.responseMessage("401A")
                }));

            default:
                return(Content(HttpStatusCode.InternalServerError, new response {
                    message = errMsg
                }));
            }
        }
Exemplo n.º 3
0
        public IHttpActionResult ReadCard([FromBody] requestParam requestParam)
        {
            CardData cardData = new CardData();
            string   errMsg   = "";
            short    response = sssUmidSrvcs.Helpers.UMIDLibrary.ReadData(requestParam, cardData, ref errMsg);

            switch (response)
            {
            case 0:
                return(Ok(cardData));

            case 1:
            case 2:
                return(Content(HttpStatusCode.Unauthorized, new response {
                    message = Helpers.Utilities.responseMessage("401A")
                }));

            default:
                return(Content(HttpStatusCode.InternalServerError, new response {
                    message = errMsg
                }));
            }
        }