public Zona GetZoneForIncident(PoligonoDetalle point)
        {
            var db = new RiinContainer();
            var result = false;
            Zona zone = null;
            var Zonas = db.Estados.First(e => e.Id == 2).Zonas.Where(z => z.Poligonos.PoligonoDetalles.Count > 0);
            foreach (var zona in Zonas)
            {
                var polygon = zona.Poligonos.PoligonoDetalles.ToList();//.Select(p => new Coordinate { Latitude = p.Latitud, Longitude = p.Longitud }).ToList();

                Assert.IsTrue(polygon.Count > 0, "Polygon should have coordinates");

                result = IsPointInPolygon(polygon, point);
                if (result)
                {
                    zone = zona;
                    break;
                }

            }
            return zone;
        }
        public JsonResult GetZoneForIncident(float lat, float lng)
        {
            var db = new RiinContainer();
            var result = false;
            Zona zone = null;
            PoligonoDetalle point = new PoligonoDetalle();
            point.Latitud = lat;
            point.Longitud = lng;
            var Zonas = db.Zonas.Where(z => z.Poligonos.PoligonoDetalles.Count > 0);
            foreach (var zona in Zonas)
            {
                var polygon = zona.Poligonos.PoligonoDetalles.ToList();

                result = IsPointInPolygon(polygon, point);
                if (result)
                {
                    zone = zona;
                    break;
                }

            }
            return Json(zone != null ? zone.Id : -1, JsonRequestBehavior.AllowGet);
        }
        private string GetEmpresaName(string id)
        {
            RiinContainer db = new RiinContainer();
            var empresaId = int.Parse(id);

            var empresa = from e in db.Empresas
                          where e.Id == empresaId
                          select e.Nombre;

            var nombre = empresa.ToList().First();

            return nombre;
        }