Esempio n. 1
0
        public static IEnumerable <VehicleManufacturerList> GetManufacturerList()
        {
            var ManufacturerList = new List <VehicleManufacturerList>();
            var dt = ManufacturerDAL.GetManufacturerList();

            foreach (DataRow dataRow in dt.Rows)
            {
                ManufacturerList.Add(new VehicleManufacturerList
                {
                    Id      = (int)dataRow["ManufacturerID"],
                    Display = dataRow["Manufacturer"].ToString()
                });
            }
            return(ManufacturerList);
        }
Esempio n. 2
0
        public static List <VehicleModelListView> BuildAccordionModel()
        {
            List <VehicleModelListView> model = new List <VehicleModelListView>();
            var manufacturer = ManufacturerDAL.GetManufacturerList();

            foreach (DataRow dataRow in manufacturer.Rows)
            {
                VehicleModelListView vehicleModelView = new VehicleModelListView
                {
                    ManufacturerId = (int)dataRow["ManufacturerID"],
                    Manufacturer   = dataRow["Manufacturer"].ToString(),
                    modelList      = GetModelByManufacturerList((int)dataRow["ManufacturerID"])
                };
                model.Add(vehicleModelView);
            }
            return(model);
        }