Exemplo n.º 1
0
    public static string WLeerGeocercasDelMunicipio(string IdMunicipio)
    {
        JavaScriptSerializer scriptSerializer = new JavaScriptSerializer();
        List <string>        Lista            = new List <string>();
        Usuario usr = new Usuario();

        if (!UtilWeb.CheckSession(Lista, ref usr, HttpContext.Current))
        {
            return(scriptSerializer.Serialize(Lista.ToArray()));
        }

        try
        {
            Geocercas geo = new Geocercas(usr);
            geo.ReadAll_Geocerca_del_Municipio(IdMunicipio);
            UtilWeb.AddElementSeleccioneALista(geo.Datos);
            UtilWeb util    = new UtilWeb();
            string  jsonMun = util.GetJson(geo.Datos);

            string html = "";
            WLeerGeocerca_Internal(usr, ref html, IdMunicipio);

            Lista.Add("Exito");
            //Lista.Add(jsonMun);
            Lista.Add(html);
            //Lista.Add(jsonCamiones);
        }
        catch (Exception ex)
        {
            Lista.Add("Exception");
            Lista.Add(ex.Message);
            Lista.Add("Hubo un error no controlado en la aplicación, por favor inténtelo nuevamente, si el problema persiste contactarse con el administrador sistemas para revisar el log de eventos del servidor.");
        }
        return(scriptSerializer.Serialize(Lista.ToArray()));
    }
Exemplo n.º 2
0
    private static void WLeerGeocerca_Internal(Usuario usr, ref string html, string IdMunicipio)
    {
        Geocercas geo = new Geocercas(usr);

        //geo.ReadAll();
        if (IdMunicipio.Trim().Length == 0)
        {
            geo.ReadAll_con_Municipio();
        }
        else
        {
            geo.ReadAll_Geocerca_del_Municipio(IdMunicipio);
        }

        //Se genera la tabla HTML
        List <ColumnaHtml> lista = new List <ColumnaHtml>();

        lista.Add(new ColumnaHtml(eeTipoColumnaHtml.Label, "", "NombreMunic"));
        lista.Add(new ColumnaHtml(eeTipoColumnaHtml.Label, "", "NombreGeocerca"));
        lista.Add(new ColumnaHtml(eeTipoColumnaHtml.Label, "", "Ubicacion"));
        //lista.Add(new ColumnaHtml(eeTipoColumnaHtml.Label, "", "RutUserMunic"));
        lista.Add(new ColumnaHtml(eeTipoColumnaHtml.Label, "", "Coordenadas"));
        lista.Add(new ColumnaHtml(eeTipoColumnaHtml.Label, "", "Observacion"));
        //lista.Add(new ColumnaHtml(eeTipoColumnaHtml.Label, "", "Telefono"));  //Aca va IMAGEN
        lista.Add(new ColumnaHtml(eeTipoColumnaHtml.ImageEdit, "Id", "", "Edit", "EditGeocerca"));
        lista.Add(new ColumnaHtml(eeTipoColumnaHtml.ImageDelete, "Id", "", "Delete", "DeleteGeocerca"));

        UtilWeb util = new UtilWeb();

        html = util.GetHtmlTableBasica(geo.Datos, lista);
    }