public static List <Opcion> ObtenerMenuSGU()
        {
            List <Opcion> opciones = null;

            try
            {
                ModuloContext moduloBD = new ModuloContext("cnnSGU");

                List <SegModulo> modulos = moduloBD.SelectAll(0);
                opciones = new List <Opcion>();
                if (modulos != null)
                {
                    foreach (var modulo in modulos)
                    {
                        Opcion op = new Opcion();
                        op.IdOpcion      = modulo.IdModuloSGU;
                        op.IdOpcionPadre = modulo.IdModuloPadreSGU;
                        op.NombreOpcion  = modulo.Nombre;
                        op.Descripcion   = modulo.Descripcion;
                        op.Comando       = modulo.Pagina;
                        op.Orden         = modulo.Orden;
                        op.HasRows       = (modulo.CountChildren > 0) ?true : false;
                        opciones.Add(op);
                    }
                }
                return(opciones);
            }
            catch (Exception ex) {
                throw new Exception("No se pudo cargar el menú");
            }
        }
        public ModuloController(ModuloContext context, IOptionsSnapshot <ModuloSettings> settings, IModuloIntegrationEventService moduloIntegrationEventService)
        {
            _moduloContext = context ?? throw new ArgumentNullException(nameof(context));
            _moduloIntegrationEventService = moduloIntegrationEventService ?? throw new ArgumentNullException(nameof(moduloIntegrationEventService));
            _settings = settings.Value;

            //((DbContext)context).ChangeTracker.QueryTrackingBehavior = QueryTrackingBehavior.NoTracking;
        }
 public ModuloIntegrationEventService(ModuloContext moduloContext, IntegrationEventLogContext logContext, IEventBus eventBus, IOptionsSnapshot <ModuloSettings> settings,
                                      Func <DbConnection, IIntegrationEventLogService> integrationEventLogServiceFactory)
 {
     _moduloContext = moduloContext ?? throw new ArgumentNullException(nameof(moduloContext));
     _logContext    = logContext ?? throw new ArgumentNullException(nameof(logContext));
     _integrationEventLogServiceFactory = integrationEventLogServiceFactory ?? throw new ArgumentNullException(nameof(integrationEventLogServiceFactory));
     _eventBus        = eventBus ?? throw new ArgumentNullException(nameof(eventBus));
     _eventLogService = _integrationEventLogServiceFactory(_moduloContext.Database.GetDbConnection());
 }
예제 #4
0
 public ModuloController(ModuloContext context)
 {
     _context = context;
 }
예제 #5
0
 public EmpresaInclusaoIntegrationEventHandler(ModuloContext setorContext, IModuloIntegrationEventService setorIntegrationEventService)
 {
     _setorContext = setorContext;
     _setorIntegrationEventService = setorIntegrationEventService;
 }