Initial commit

This commit is contained in:
Jorge Luis caudillo esparza
2026-07-14 11:15:20 -07:00
commit 6685ef63fb
7326 changed files with 1020873 additions and 0 deletions

View File

@@ -0,0 +1,9 @@
using System.Collections.Generic;
namespace SIG.Web.AppCode.Session
{
public interface IMenuProvider
{
IReadOnlyList<MenuItemModel> GetMenu(UserSessionModel user);
}
}

View File

@@ -0,0 +1,10 @@
namespace SIG.Web.AppCode.Session
{
public interface ISessionContext
{
T Get<T>(string key) where T : class;
void Set<T>(string key, T value) where T : class;
void Remove(string key);
void Clear();
}
}

View File

@@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
namespace SIG.Web.AppCode.Session
{
[Serializable]
public sealed class MenuItemModel
{
public int CveModulo { get; set; }
public int? CveModuloPadre { get; set; }
public string NombreModulo { get; set; }
public string Url { get; set; }
public string ClaseCssIcono { get; set; }
public string ClaseCssEstilo { get; set; }
public int OrdenVisualizacion { get; set; }
public bool Visible { get; set; } = true;
public List<MenuItemModel> Hijos { get; set; } = new List<MenuItemModel>();
}
}

View File

@@ -0,0 +1,8 @@
namespace SIG.Web.AppCode.Session
{
public static class SessionKeys
{
public const string CurrentUser = "SIG_CurrentUser";
public const string TokenSesion = "SIG_SessionToken";
}
}

View File

@@ -0,0 +1,16 @@
namespace SIG.Web.AppCode.Session
{
public sealed class UserSessionModel
{
public int CveUsuario { get; set; }
public int CveRol { get; set; }
public int CveEmpresa { get; set; }
public string NombreUsuario { get; set; }
public string Nombre { get; set; }
public string CorreoElectronico { get; set; }
public string NombreRol { get; set; }
public string NombreDominio { get; set; }
public string TokenSesion { get; set; }
public bool DebeCambiarContrasena { get; set; }
}
}

View File

@@ -0,0 +1,28 @@
using System.Web;
namespace SIG.Web.AppCode.Session
{
public sealed class WebFormsSessionContext : ISessionContext
{
public T Get<T>(string key) where T : class
{
return HttpContext.Current?.Session?[key] as T;
}
public void Set<T>(string key, T value) where T : class
{
if (HttpContext.Current?.Session == null) return;
HttpContext.Current.Session[key] = value;
}
public void Remove(string key)
{
HttpContext.Current?.Session?.Remove(key);
}
public void Clear()
{
HttpContext.Current?.Session?.Clear();
}
}
}