Exemplo n.º 1
0
        public ActionResult SearchTasks(string request, int?category, int?subcategory,
                                        int?minprice, int?maxprice, int?solved, int?executive, int?subscribed)
        {
            UserModel sender = Session["CurrentUser"] as UserModel;

            if (solved != null)
            {
                ViewBag.Tasks = _unitOfWork.Tasks.GetUserSolvedTasks(sender.Id);
            }
            else if (executive != null)
            {
                ViewBag.Tasks = _unitOfWork.Tasks.GetUserExecutiveTasks(sender.Id);
            }
            else if (subscribed != null)
            {
                ViewBag.Tasks = _unitOfWork.Tasks.GetUserSubscribedTasks(sender.Id);
            }
            else
            {
                ViewBag.Tasks = _unitOfWork.Tasks.SearchTasks(request, sender.Id, category, subcategory, minprice, maxprice);
            }

            ViewBag.CurrentUser = sender;

            _searchTask = _unitOfWork.Tasks.UpdateSearchModel(request, null, category, subcategory, minprice, maxprice);

            ViewBag.SearchTask = _searchTask;

            InitHomeTaskViewBag(sender.Id);

            return(View("Index"));
        }
Exemplo n.º 2
0
        public SearchTaskModel UpdateSearchModel(string request, int?userId, int?category, int?subcategory,
                                                 int?minPrice, int?maxPrice)
        {
            SearchTaskModel model = new SearchTaskModel
            {
                Request       = request,
                CategoryId    = category,
                SubcategoryId = subcategory,
                MinPrice      = minPrice,
                MaxPrice      = maxPrice
            };

            return(model);
        }