Exemple #1
0
        public static void Register(HttpConfiguration config)
        {
            config.MapHttpAttributeRoutes();

            config.Routes.MapHttpRoute(
                name: "DefaultApi",
                routeTemplate: "api/{controller}/{id}",
                defaults: new { id = RouteParameter.Optional }
                );
            config.Formatters.JsonFormatter.SupportedMediaTypes.Add(new MediaTypeHeaderValue("text/html"));
            //config.Formatters.JsonFormatter.SerializerSettings.DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Local;
            PlateDefinition.LoadConfigFile();
        }
Exemple #2
0
        JObject AnalyzeLPR(string reg, string drz)
        {
            var ret = new JObject();

            try
            {
                if (!string.IsNullOrEmpty(reg))
                {
                    if (drz == null)
                    {
                        drz = "";
                    }
                    PlateDefinition.CountryResultSet[] res = PlateDefinition.SearchResults(reg);
                    foreach (var r in res)
                    {
                        if (r.Country.ToUpper() == drz.ToUpper())
                        {
                            ret.Add(CountryPlates(r));
                        }
                    }
                    foreach (var r in res)
                    {
                        if (r.Country.ToUpper() != drz.ToUpper())
                        {
                            ret.Add(CountryPlates(r));
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                MethodsPrometno.SpremiGresku("", ex, "LPR CONTROLLER");
                throw ex;
            }
            return(ret);
        }