Example #1
0
        public void PopulateLocationsDropDownList(Models.CityAssetsDBContext _context,
                                                  object selectedLocation = null)
        {
            var locationsQuery = from d in _context.Locations
                                 orderby d.Description
                                 select d;

            LocationNameSL = new SelectList(locationsQuery.AsNoTracking(),
                                            "ID", "Description", selectedLocation);
        }
Example #2
0
        public void PopulateTypesDropDownList(Models.CityAssetsDBContext _context,
                                              object selectedType = null)
        {
            var typesQuery = from d in _context.Types
                             orderby d.Description
                             select d;

            TypeNameSL = new SelectList(typesQuery.AsNoTracking(),
                                        "ID", "Description", selectedType);
        }
Example #3
0
        public void PopulateDepartmentsDropDownList(Models.CityAssetsDBContext _context,
                                                    object selectedDepartment = null)
        {
            var departmentsQuery = from d in _context.Departments
                                   orderby d.Description // Sort by name.
                                   select d;

            DepartmentNameSL = new SelectList(departmentsQuery.AsNoTracking(),
                                              "ID", "Description", selectedDepartment);
        }