Exemplo n.º 1
0
        public ActionResult Create()
        {
            var model = new JobModel();

            model.CreateDate = DateTime.UtcNow;
            model.IsActive   = true;
            model.Categories = jobCategoryService.GetActives();
            return(View(model));
        }
Exemplo n.º 2
0
        public override string ToHtmlString()
        {
            var allJobs = _categoryId.HasValue ? jobService.GetActives(_categoryId.Value) : jobService.GetActives();

            if (!string.IsNullOrEmpty(_searchTerm))
            {
                allJobs = allJobs.Where(s => s.Title.Contains(_searchTerm));
            }

            if (_displayCount.HasValue && _displayCount.Value > 0)
            {
                allJobs = allJobs.Take(_displayCount.Value);
            }

            this.Component.Items.AddRange(allJobs);
            this.Component.AllCategories = categoryService.GetActives().ToList();

            return(base.ToHtmlString());
        }