示例#1
0
        ////
        //// GET: /Job/
        public ActionResult Index()
        {
            var model = new JobViewModel();

            var filters = context.Filters.OrderBy(f=>f.Order).ToList();

            var categories = filters.Select(f => f.Category).Distinct();

            foreach (var category in categories)
            {
                var filterVM = new FilterViewModel();
                filterVM.Category = category;

                foreach (var filter in filters.Where(f=>f.Category== category))
                {
                    filterVM.Itens.Add(new FilterItem(filter.FilterId,filter.Name,filter.Quantity));
                }

                model.Filters.Add(filterVM);
            }

            return View(model);
        }
示例#2
0
        //
        // GET: /Job/
        public ActionResult Index()
        {
            var model = new JobViewModel();

            model.Industries = context.Industries.OrderBy(i => i.Name).ToList();

            return View(model);
        }