Esempio n. 1
0
        public VehiculosViewModel(IConfiguration configuration, int?id, Parametros pr)
        {
            var ad = new AdaptadorAtc(configuration);

            Vehiculos = ad.TiposVehiculoLeer(id);
            streaming = configuration.GetSection("StreamFiles")["rutaStreaming"];
            foreach (TipoVehiculo vh in Vehiculos)
            {
                vh.url = streaming + vh.Imagen;
                if (vh.IDTipoVehiculo == id)
                {
                    VehiculoSeleccionado = vh;
                }
            }
            ;
            IDTipoVehiculo = id;
            if (pr != null)
            {
                var res = ad.ObtenerdescripcionesPorIDs(pr);
                Parametros = res;
                JavaScriptSerializer js = new JavaScriptSerializer();
                ParametrosJavascript = js.Serialize(res);
            }
        }