Exemplo n.º 1
0
 public VehiculoController(IOptions <AppSettingsMongo> settings, IHttpContextAccessor httpContextAccessor)
 {
     _session               = httpContextAccessor.HttpContext.Session;
     _httpContext           = httpContextAccessor;
     _settings              = settings;
     _controladoraVehiculos = ControladoraVehiculos.getInstance(_settings);
 }
 public ViewModelViajeDirecto(IOptions <AppSettingsMongo> settings)
 {
     _settings              = settings;
     _controladoraUsuarios  = ControladoraUsuarios.getInstance(_settings);
     _controladoraVehiculos = ControladoraVehiculos.getInstance(_settings);
     cargarClientes().Wait();
     cargarVehiculos();
 }
        public void cargarVehiculos()
        {
            List <Vehiculo> vehiculos = ControladoraVehiculos.getInstance(_settings).getVehiculosDisponibles();
            Vehiculo        v         = new Vehiculo()
            {
                Id = new ObjectId(), Matricula = "Seleccione un vehiculo"
            };

            vehiculos.Insert(0, v);
            Vehiculos = new SelectList(vehiculos, "Id", "Matricula");
        }
Exemplo n.º 4
0
        public async Task CargarChoferes()
        {
            List <Chofer> choferes = await ControladoraVehiculos.getInstance(_settings).choferesDisponibles();

            Chofer aux = new Chofer()
            {
                Id = new ObjectId(), Leyenda = "Seleccione un chofer"
            };

            choferes.Insert(0, aux);
            ListaChoferes = new SelectList(choferes, "Id", "Leyenda");
        }
Exemplo n.º 5
0
        public async Task cargarVehiculos()
        {
            var vehiculos = await ControladoraVehiculos.getInstance(_settings).getVehiculos();

            List <Vehiculo> lista = vehiculos.ToList();
            Vehiculo        v     = new Vehiculo()
            {
                Id = new ObjectId(), Matricula = "Seleccione un vehiculo"
            };

            lista.Insert(0, v);
            ListaVehiculos = new SelectList(lista, "Id", "Matricula");
        }
        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);
        }