コード例 #1
0
        public IActionResult IndexLoggedIn(string username, string location = "", string potentialTitle = "", string message = "")
        {
            UserController userController = new UserController();
            TaskController taskController = new TaskController();

            if (username == null)
            {
                username = _CurrentSession.GetUsername();
            }
            User currentUser = userController.ReturnUserWithGivenUsername(username);
            List <Tuple <Models.Task, ContactInformationAttribute, double, string> > activeAdsWithAdOwnerContactInfos = taskController.ArrangeOrderOfAds(taskController.GetAllActiveAds(location, potentialTitle), currentUser.PreferredJobCategories);

            ViewData["members"]             = userController.CountUsers();
            ViewData["tasks"]               = taskController.CountTasks();
            ViewData["numberOfActiveTasks"] = activeAdsWithAdOwnerContactInfos.Count;
            ViewData["username"]            = username;
            ViewData["activeAds"]           = activeAdsWithAdOwnerContactInfos;
            ViewData["message"]             = message;
            return(View("Views/Home/IndexLoggedIn.cshtml"));
        }