Esempio n. 1
0
        public static Vehiculos ConsultarVehiculoCliente()
        {
            List <SP_GENERAL_CONSULTARResult> lstDB = new List <SP_GENERAL_CONSULTARResult>();

            using (Conect db = new Conect())
            {
                lstDB = db.SP_GENERAL_CONSULTAR().ToList <SP_GENERAL_CONSULTARResult>();
            }

            Vehiculos lstRes = new Vehiculos();

            foreach (SP_GENERAL_CONSULTARResult item in lstDB)
            {
                lstRes.Add(new Vehiculo
                {
                    MATRICULA = item.MATRICULA,
                    MARCA     = item.MARCA,
                    ESTADO    = item.ESTADO
                                //,MODELO = convert. item.MODELO
                    , MODELO = System.Convert.ToInt16(item.MODELO),
                });
            }

            return(lstRes);
        }