예제 #1
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env, IOptions <AppSettingsMongo> appSettingsMongo)
        {
            if (env.IsDevelopment())
            {
                app.UseBrowserLink();
                app.UseDeveloperExceptionPage();
            }
            else
            {
                app.UseExceptionHandler("/Home/Error");
            }

            app.UseAuthentication();
            app.UseStaticFiles();
            app.UseSession();
            app.UseMvc(routes =>
            {
                routes.MapRoute(
                    name: "default",
                    template: "{controller=Home}/{action=Index}/{id?}");
            });
            _settingsMongo = appSettingsMongo;

            //DBRepository<AppSettings>.Iniciar(_settings);
            DBRepositoryMongo <AppSettingsMongo> .Iniciar(_settingsMongo);
        }
예제 #2
0
 public PeonController(IOptions <AppSettingsMongo> settings, IHttpContextAccessor httpContextAccessor, IConfiguration configuration)
 {
     _session       = httpContextAccessor.HttpContext.Session;
     _configuration = configuration;
     _httpContext   = httpContextAccessor;
     _settings      = settings;
     DBRepositoryMongo <Peon> .Iniciar(_settings);
 }
        public AdministrativoController(IOptions <AppSettingsMongo> settings, IHttpContextAccessor httpContextAccessor, IConfiguration configuration)
        {
            _session       = httpContextAccessor.HttpContext.Session;
            _configuration = configuration;
            _httpContext   = httpContextAccessor;
            _settings      = settings;
            DBRepositoryMongo <Usuario> .Iniciar(_settings);

            _controladoraUsuarios = ControladoraUsuarios.getInstance(_settings);
        }
예제 #4
0
        private ControladoraUsuarios(IOptions<AppSettingsMongo> settings)
        {
            _settings = settings;
            DBRepositoryMongo<Administrativo>.Iniciar(_settings);
            DBRepositoryMongo<Chofer>.Iniciar(_settings);
            DBRepositoryMongo<Cliente>.Iniciar(_settings);
            DBRepositoryMongo<Peon>.Iniciar(_settings);
            UbicacionesClientes = new Hashtable();

        }
        private ControladoraVehiculos(IOptions <AppSettingsMongo> settings)
        {
            _settings           = settings;
            _controladoraViajes = ControladoraViajes.getInstancia(_settings);
            UbicacionVehiculos  = new Hashtable();
            DBRepositoryMongo <Vehiculo> .Iniciar(_settings);

            DBRepositoryMongo <Chofer> .Iniciar(_settings);

            cargarVehicuos();
            datos();
        }
        public APIController(IOptions <AppSettingsMongo> settings, IHttpContextAccessor httpContextAccessor, IConfiguration configuration)
        {
            _session       = httpContextAccessor.HttpContext.Session;
            _configuration = configuration;
            _httpContext   = httpContextAccessor;
            _settings      = settings;
            DBRepositoryMongo <Usuario> .Iniciar(_settings);

            DBRepositoryMongo <Cliente> .Iniciar(_settings);

            DBRepositoryMongo <Chofer> .Iniciar(_settings);

            _controladoraViajes    = ControladoraViajes.getInstancia(_settings);
            _controladoraVehiculos = ControladoraVehiculos.getInstance(_settings);
            _controladoraUsuarios  = ControladoraUsuarios.getInstance(_settings);
        }