コード例 #1
0
        private PassportValidationResult InvokeValidation(string jn)
        {
            var pi = JsonConvert.DeserializeObject <PassportInput>(HttpUtility.UrlDecode(jn));
            var validationResult = pm.ValidatePassportData(pi);

            return(validationResult);
        }
コード例 #2
0
        public JsonResult CheckPassportData(string inputString)
        {
            PassportValidationResult validationResult = null;

            try
            {
                var pi = JsonConvert.DeserializeObject <PassportInput>(HttpUtility.UrlDecode(inputString));

                PassportManager pm = new PassportManager();
                validationResult = pm.ValidatePassportData(pi);
            }
            catch (PassportDataException ex)
            {
                Logger.LogContent(ex);
                return(Json(JsonResponseFactory.ErrorResponse(ex.Message)));
            }
            catch (Exception ex)
            {
                Logger.LogContent(ex);
                return(Json(JsonResponseFactory.ErrorResponse(string.Format("{0}  |  {1}", ex.Message, ex.StackTrace))));
            }

            return(Json(JsonResponseFactory.SuccessResponse(JsonConvert.SerializeObject(validationResult))));
        }