Esempio n. 1
0
    public static string WLeerDatosIniciales()
    {
        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
        {
            ClienteMunicipio munic = new ClienteMunicipio();
            munic.ReadAll();

            UtilWeb.AddElementSeleccioneALista(munic.Datos);
            UtilWeb util      = new UtilWeb();
            string  jsonMunic = util.GetJson(munic.Datos);

            Lista.Add("Exito");
            Lista.Add(jsonMunic);
        }
        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()));
    }
Esempio n. 2
0
    public static string WLeerUsuarioConectado()
    {
        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
        {
            ClienteMunicipio mun = new ClienteMunicipio(usr);
            mun.ReadAll();
            UtilWeb.AddElementSeleccioneALista(mun.Datos);
            UtilWeb util    = new UtilWeb();
            string  jsonMun = util.GetJson(mun.Datos);

            Geocercas geo = new Geocercas(usr);
            geo.ReadAll();
            UtilWeb.AddElementSeleccioneALista(geo.Datos);
            util = new UtilWeb();
            string jsonGeo = util.GetJson(geo.Datos);


            string html = "";
            WLeerRutas_Internal(usr, ref html);


            Lista.Add("Exito");
            Lista.Add(jsonMun);
            Lista.Add(jsonGeo);
            Lista.Add(html);
            //Lista.Add(usr.NombreLargo);

            //Lista.Add(html);
        }
        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()));
    }
Esempio n. 3
0
    private static void WLeerUsuarioConectadoAndMunicipios_Internal(Usuario usr, ref string html)
    {
        ClienteMunicipio cliente = new ClienteMunicipio(usr);

        cliente.ReadAll();

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

        lista.Add(new ColumnaHtml(eeTipoColumnaHtml.Label, "", "NombreMunic"));
        lista.Add(new ColumnaHtml(eeTipoColumnaHtml.Label, "", "RutMunic"));
        lista.Add(new ColumnaHtml(eeTipoColumnaHtml.Label, "", "NombreUserMunic"));
        //lista.Add(new ColumnaHtml(eeTipoColumnaHtml.Label, "", "RutUserMunic"));
        lista.Add(new ColumnaHtml(eeTipoColumnaHtml.Label, "", "CorreoUserMunic"));
        lista.Add(new ColumnaHtml(eeTipoColumnaHtml.Label, "", "Telefono"));
        //lista.Add(new ColumnaHtml(eeTipoColumnaHtml.Label, "", "Telefono"));  //Aca va IMAGEN
        lista.Add(new ColumnaHtml(eeTipoColumnaHtml.ImageEdit, "Id", "", "Edit", "EditMunicipio"));
        lista.Add(new ColumnaHtml(eeTipoColumnaHtml.ImageDelete, "Id", "", "Delete", "DeleteMunicipio"));

        UtilWeb util = new UtilWeb();

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