Exemple #1
0
        public U_AuxMasterAdmin page_load(Object Session)
        {
            U_AuxMasterAdmin response = new U_AuxMasterAdmin();

            if (Session == null)
            {
                response.Redireccion = "LoginUsr.aspx";
                //Response.Redirect();
            }
            else
            {
                int num = int.Parse(((DataTable)(Session)).Rows[0]["idTipo"].ToString());
                if (int.Parse(((DataTable)(Session)).Rows[0]["idTipo"].ToString()) == 1)
                {
                    //DDAOadministrador user = new DDAOadministrador();

                    //DataTable not = user.LlenarNotificacion();
                    //DataTable notAcep = user.LlenarNotificacionAceptadas();
                    //DataTable notRecha = user.LlenarNotificacionRechazada();

                    //REEMPLAZO
                    DB_Admin dao_Admin = new DB_Admin();
                    int      not       = dao_Admin.llenar_notificacion();
                    int      notAcep   = dao_Admin.llenar_notificacionAccept();
                    int      notRecha  = dao_Admin.llenar_notificacionRechaz();

                    if (not == 0)
                    {
                        response.Numero_noti1 = "0";
                        //Numero_noti.Text = "0";
                    }
                    if (notAcep == 0)
                    {
                        response.CantidadAceptadas = "0";
                        //cantidadAceptadas.Text = "0";
                    }
                    if (notRecha == 0)
                    {
                        response.CantidadRechazadas = "0";
                        //cantidadRechazadas.Text = "0";
                    }
                    else
                    {
                        response.Numero_noti1       = not.ToString();
                        response.CantidadAceptadas  = notAcep.ToString();
                        response.CantidadRechazadas = notRecha.ToString();
                        response.CantidadPendientes = not.ToString();
                        response.TotalAceptadas1    = notAcep.ToString();
                        response.TotalRechazadas1   = notRecha.ToString();
                        response.TotalPendientes1   = not.ToString();
                    }
                    response.TotalSolicitudes1 = (notAcep + notRecha + not).ToString();
                    String img = ((DataTable)(Session)).Rows[0]["rutaArchivo"].ToString() + ((DataTable)(Session)).Rows[0]["nomArchivo"].ToString();
                    response.FotoPerfil1    = img;
                    response.NombrePerfil1  = ((DataTable)(Session)).Rows[0]["nomUsuario"].ToString() + " " + ((DataTable)(Session)).Rows[0]["apeUsuario"].ToString();
                    response.NombrePerfil21 = ((DataTable)(Session)).Rows[0]["nomUsuario"].ToString();
                    response.Redireccion    = "0";
                }
                else
                {
                    response.Redireccion = "LoginUsr.aspx";
                    //Response.Redirect();
                }
            }
            return(response);
        }
Exemple #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Response.Cache.SetCacheability(HttpCacheability.ServerAndNoCache);
        L_MasterAdmin    logica   = new L_MasterAdmin();
        U_AuxMasterAdmin response = logica.page_load(Session["sesion"]);

        Numero_noti.Text        = response.Numero_noti1;
        cantidadAceptadas.Text  = response.CantidadAceptadas;
        cantidadRechazadas.Text = response.CantidadRechazadas;
        cantidadPendientes.Text = response.CantidadPendientes;
        TotalAceptadas.Text     = response.TotalAceptadas1;
        TotalRechazadas.Text    = response.TotalRechazadas1;
        TotalPendientes.Text    = response.TotalPendientes1;
        TotalSolicitudes.Text   = response.TotalSolicitudes1;
        FotoPerfil.ImageUrl     = response.FotoPerfil1;
        FotoPerfil2.ImageUrl    = response.FotoPerfil1;
        NombrePerfil.Text       = response.NombrePerfil1;
        NombrePerfil2.Text      = response.NombrePerfil21;

        //Seteando Idiomas
        L_Idioma  idiot      = new L_Idioma();
        Object    sesidioma  = Session["idiomases"];
        Int32     formulario = 25;
        Int32     idiom      = Convert.ToInt32(sesidioma);
        Hashtable compIdioma = new Hashtable();

        idiot.mostraridioma(formulario, idiom, compIdioma);
        try
        {
            this.title.Text              = compIdioma["title"].ToString();
            this.adm.InnerText           = compIdioma["adm"].ToString();
            this.solic.InnerText         = compIdioma["solic"].ToString();
            this.emp_acept.InnerText     = compIdioma["emp_acept"].ToString();
            this.emp_rech.InnerText      = compIdioma["emp_rech"].ToString();
            this.emp_pend.InnerText      = compIdioma["emp_pend"].ToString();
            this.rep_cry.InnerHtml       = "<span></span>" + compIdioma["rep_cry"].ToString();
            this.Salir.Text              = compIdioma["Salir"].ToString();
            this.contr.InnerText         = compIdioma["contr"].ToString();
            this.navigate_menu.InnerText = compIdioma["navigate_menu"].ToString();
            this.main.InnerText          = compIdioma["main"].ToString();
            this.quej.InnerText          = compIdioma["quej"].ToString();
            this.repor.InnerText         = compIdioma["repor"].ToString();
            this.usr.InnerHtml           = compIdioma["usr"].ToString() + "<span class='label label-theme m-l-5'></span>";
            this.cliet.InnerHtml         = "<b class='caret pull-right'></b>" + compIdioma["cliet"].ToString();
            this.ver_all.InnerText       = compIdioma["ver_all"].ToString();
            this.empre.InnerHtml         = "<b class='caret pull-right'></b>" + compIdioma["empre"].ToString();
            this.ver_all2.InnerText      = compIdioma["ver_all"].ToString();
            this.tot_vent.InnerText      = compIdioma["tot_vent"].ToString();
            this.request.InnerText       = compIdioma["request"].ToString();
            this.accep.InnerText         = compIdioma["accep"].ToString();
            this.rech.InnerText          = compIdioma["rech"].ToString();
            this.pend.InnerText          = compIdioma["pend"].ToString();
            this.admi_cat.InnerText      = compIdioma["admi_cat"].ToString();
            this.adm_mem.InnerText       = compIdioma["adm_mem"].ToString();
            this.adm_mot.InnerText       = compIdioma["adm_mot"].ToString();
            this.Span1.InnerText         = compIdioma["Span1"].ToString();
        }
        catch (Exception ex)
        { }
        Page.ClientScript.RegisterStartupScript(this.GetType(), "Script", "redireccionar('" + response.Redireccion + "');", true);
    }