Skip to main content

Dashboard Overview

The SMAF Dashboard (Home page) is your central hub for managing expense and travel allowances. After successful authentication, you’ll be greeted with a personalized interface showing your user information and available modules.

Page Layout

The dashboard is divided into three main sections:

Header Section

Displays the INAPESCA branding and application title:
  • Logo: INAPESCA official logo (700px × 65px)
  • Title: “INAPESCA - WEB - Aplicativo de Control Interno de Viáticos”
A dynamic TreeView menu that displays modules based on your user role. This menu is generated server-side using:
Home.aspx.cs
clsFuncionesGral.LlenarTreeViews(
    Dictionary.NUMERO_CERO, 
    tvMenu, 
    false, 
    "Menu", 
    "SMAF", 
    Session["Crip_Rol"].ToString()
);
The menu structure is role-based. You’ll only see modules and features that your role has permission to access.

User Profile Panel (Right Panel)

Displays your comprehensive user information in a structured table format.

User Profile Information

The dashboard welcomes you by name and displays detailed information about your account:

Welcome Message

Home.aspx.cs
lblBienvenido.Text = "Bienvenido";
A personalized greeting appears at the top of your profile panel.

Personal Information

The following information is displayed in a formatted table:
FieldDescriptionSource
Ubicación/AdscripciónYour office location with full address and phoneMngNegocioAdscripcion.ObtieneDatosUbicacion()
RFCYour tax identification numberSession[“Crip_RFC”]
NombreYour full name (First + Paternal + Maternal)Session[“Crip_Nombre”] + Session[“Crip_ApPat”] + Session[“Crip_ApMat”]
CargoYour position/roleSession[“Crip_Cargo”]
Clave PuestoYour position code (Level + Plaza)Session[“Crip_Nivel”] + Session[“Crip_Plaza”]
Nombre PuestoYour job titleSession[“Crip_Puesto”]

Code Implementation

Home.aspx.cs
public void Carga_Controles()
{
    Label1.Text = clsFuncionesGral.ConvertMayus(Dictionary.UBICACION_ADSCRIPCION + DP);
    Label2.Text = clsFuncionesGral.ConvertMayus(Dictionary.RFC + DP);
    Label3.Text = clsFuncionesGral.ConvertMayus(Dictionary.NOMBRE + DP);
    Label4.Text = clsFuncionesGral.ConvertMayus(Dictionary.CARGO + DP);
    Label5.Text = clsFuncionesGral.ConvertMayus(Dictionary.CLAVE_PUESTO + DP);
    Label6.Text = clsFuncionesGral.ConvertMayus(Dictionary.NOMBRE_PUESTO + DP);

    lblBienvenido.Text = "Bienvenido";
    lblRFC.Text = Session["Crip_RFC"].ToString();
    lblNombre.Text = Session["Crip_Nombre"].ToString() + " " + 
                     Session["Crip_ApPat"].ToString() + " " + 
                     Session["Crip_ApMat"].ToString();
    lblCargo.Text = Session["Crip_Cargo"].ToString();
    lblCvlPuesto.Text = Session["Crip_Nivel"].ToString() + " " + 
                        Session["Crip_Plaza"].ToString();
    lblNomPuesto.Text = Session["Crip_Puesto"].ToString();
    
    Ubicacion oUbicacion = MngNegocioAdscripcion.ObtieneDatosUbicacion(
        Session["Crip_Ubicacion"].ToString()
    );
    lblUbicacion.Text = oUbicacion.Descripcion + "," + 
                        oUbicacion.Estado + ".<br> Tel: " + 
                        oUbicacion.Telefono;
}
All labels are automatically converted to uppercase using ConvertMayus() for consistent formatting.

Quick Access Features

Modify Personal Data

At the bottom of the user profile panel, you’ll find a link to update your personal information:
Home.aspx.cs
lnkDatosPersonales.Text = "Modificar Datos Personales.";
Clicking this link redirects you to the personal data update page:
Home.aspx.cs
protected void lnkDatosPersonales_Click(object sender, EventArgs e)
{
    Response.Redirect("../Catalogos/Actualiza_Datos.aspx", true);
}
Ensure all personal information is accurate and up-to-date, as it’s used in expense reports and official documentation.

Available Modules

The dashboard provides access to various modules through the TreeView menu. The modules you see depend on your assigned role.

Module Navigation

When you click on a menu item, the system:
  1. Captures the selection:
Home.aspx.cs
protected void tvMenu_SelectedNodeChanged(object sender, EventArgs e)
{
    string lsModulo = Convert.ToString(tvMenu.SelectedNode.Value);
    string lsRol = Session["Crip_Rol"].ToString();
    
    WebPage objWebPage = MngNegocioMenu.MngNegocioURL(lsModulo, lsRol);
}
  1. Validates access: Checks if your role has permission to access the selected module
  2. Redirects to module: Navigates to the appropriate page based on the URL stored in the database
Home.aspx.cs
if (objWebPage != null)
{
    if (objWebPage.URL != string.Empty)
    {
        if (objWebPage.Padre != "0")
        {
            Response.Redirect(objWebPage.URL, true);
        }
        if (objWebPage.Modulo == "99")
        {
            Response.Redirect(objWebPage.URL, true);
        }
    }
}

Role-Based Menu

The menu structure is dynamically generated based on your role identifier stored in Session["Crip_Rol"]:
clsFuncionesGral.cs
public static void LlenarTreeViews(
    string psPadre, 
    TreeView ptvObject, 
    Boolean psBandera, 
    string psTipo, 
    string psAplicativo, 
    string psRol = "", 
    string psUbicacion = ""
)
{
    switch (psAplicativo)
    {
        case "SMAF":
            switch (psTipo)
            {
                case "Menu":
                    datasetArbol = MngNegocioMenu.MngDatosMenu(psRol, psPadre);
                    tblTabla = datasetArbol.Tables["DataSetArbol"];
                    break;
            }
            break;
    }
    
    // Build TreeView from dataset
    foreach (DataRow lRegistro in tblTabla.Rows)
    {
        lsPadre = Convert.ToString(lRegistro["PADRE"]);
        lsModulo = Convert.ToString(lRegistro["MODULO"]);
        lsDescripcion = Convert.ToString(lRegistro["DESCRIPCION"]);
        
        objTreeview.ContruirMenu(
            lsModulo, 
            lsDescripcion, 
            ptvObject, 
            lbBandera, 
            psRol, 
            psTipo, 
            psAplicativo
        );
    }
}
The menu hierarchy is retrieved from the database and organized by parent-child relationships, creating an expandable tree structure.

Session Management

The dashboard includes automatic session validation on every page load:
Home.aspx.cs
protected void Page_Load(object sender, EventArgs e)
{
    if (!clsFuncionesGral.IsSessionTimedOut())
    {
        Response.Cache.SetCacheability(HttpCacheability.NoCache);
        
        if (!IsPostBack)
        {
            Carga_Controles();
            clsFuncionesGral.LlenarTreeViews(
                Dictionary.NUMERO_CERO, 
                tvMenu, 
                false, 
                "Menu", 
                "SMAF", 
                Session["Crip_Rol"].ToString()
            );
        }
    }
    else
    {
        Response.Redirect("../Index.aspx", true);
    }
}

Cache Control

The dashboard disables browser caching to ensure sensitive data is not stored:
Response.Cache.SetCacheability(HttpCacheability.NoCache);

Visual Design

The dashboard uses a clean, professional layout:
  • Left panel: TreeView navigation menu with collapsible sections
  • Right panel: User profile information in alternating row colors
    • Even rows: #E0F2F5 (light blue background)
    • Odd rows: White background
  • Header: Blue background (#5c87b2) for the welcome message
Home.aspx
<div id="side-a">
    <asp:TreeView ID="tvMenu" runat="server" 
                  ShowCheckBoxes="None" 
                  ShowLines="false" 
                  onselectednodechanged="tvMenu_SelectedNodeChanged">
    </asp:TreeView>
</div>

<div id="side-b">
    <table id="tbl_Datos" border="0">
        <tr>
            <td colspan="2" style="background-color:#5c87b2;">
                <h1><asp:Label ID="lblBienvenido" runat="server"></asp:Label></h1>
            </td>
        </tr>
        <!-- User information rows -->
    </table>
</div>

Dashboard Features Summary

Personalized Welcome

Displays your name, position, and office location

Role-Based Menu

Dynamic menu showing only modules you have access to

Quick Profile Update

Direct link to modify your personal information

Session Security

Automatic session validation and timeout protection

Source Code References

  • Dashboard Page: Home/Home.aspx and Home/Home.aspx.cs
  • Menu Generation: clsFuncionesGral.cs:739-814
  • Session Validation: clsFuncionesGral.cs:42-70
  • Navigation Logic: Home.aspx.cs:110-144

Build docs developers (and LLMs) love