Beispiel #1
0
        public async Task <ActionResult> SearchBy(string keyWord, int?page, FormCollection collection)
        {
            if (!keyWord.IsNullOrEmptyOrWhiteSpace())
            {
                keyWord = collection["Keyword"];
            }
            else
            {
                keyWord = string.Empty;
            }

            ViewBag.Keyword = keyWord;

            var _objects = _unitOfWorkAsync.RepositoryAsync <WorkIssue>()
                           .Query().Select().Where(t => t.Contains(keyWord))
                           .OrderByDescending(t => t.CreatedDate)
                           .ThenByDescending(t => t.UpdatedDate)
                           .ToList();

            var _views = IssueMappers.IssuesToViews(_objects);

            if (Request.IsAjaxRequest())
            {
                return(PartialView("Issues/_RelatedIssues",
                                   _views.ToPagedList(pageNumber: page ?? 1, pageSize: PageSize)));
            }

            return(View("_SearchResults", _views.ToPagedList(pageNumber: page ?? 1, pageSize: PageSize)));
        }
Beispiel #2
0
        public ActionResult GetSubIssues(Guid id)
        {
            var _objects = IssueManager.GetSubIssues(id).ToList();
            var _views   = IssueMappers.IssuesToViews(_objects);

            if (Request.IsAjaxRequest())
            {
                return(PartialView("Issues/_Issues", _views));
            }
            return(RedirectToAction("Index"));
        }
Beispiel #3
0
        public ActionResult GetLastest(string userName)
        {
            var _objects = IssueManager.GetLastest(userName).ToList();
            var _views   = IssueMappers.IssuesToViews(_objects);

            if (Request.IsAjaxRequest())
            {
                return(PartialView("Issues/_Issues", _views));
            }
            return(RedirectToAction("Index"));
        }
Beispiel #4
0
        public async Task <ActionResult> Index()
        {
            var _objects = IssueManager.GetAllOf(User.Identity.Name);
            var _views   = IssueMappers.IssuesToViews(_objects);

            if (User.Identity.IsAuthenticated)
            {
                return(View("Index", _views.Where(t => t.CreatedBy == User.Identity.Name).ToList()));
            }

            return(View("Index", _views));
        }
Beispiel #5
0
        public async Task <ActionResult> GetToVerifyIssues(int?page)
        {
            if (page == null)
            {
                page = 1;
            }
            var _objects = IssueManager.GetAllOf(User.Identity.Name);

            _objects = _objects.Where(t => !t.IsVerified)
                       .OrderByDescending(t => t.UpdatedDate)
                       .ThenByDescending(t => t.CreatedDate)
                       .ToList();
            var _views = IssueMappers.IssuesToViews(_objects);

            ViewBag.VerifyIssues = _views;
            if (Request.IsAjaxRequest())
            {
                return(PartialView("Issues/_IssuesToVerify",
                                   _views.ToPagedList(pageNumber: page ?? 1, pageSize: PageSize)));
            }
            return(View("Index", _views));
        }
Beispiel #6
0
        public async Task <ActionResult> GetIssuesOf(string email)
        {
            //if (page == null) page = 1;
            var _objects = IssueManager.GetAllExtendOf(email);

            _objects = _objects
                       //.Where(t => t.IsVerified && t.IsExpired())
                       .OrderByDescending(t => t.UpdatedDate)
                       .ThenByDescending(t => t.CreatedDate)
                       .ToList();
            var _views = IssueMappers.IssuesToViews(_objects);

            ViewBag.ExpiredIssues = _views;
            if (Request.IsAjaxRequest())
            {
                return(PartialView("Issues/_Issues",
                                   _views
                                   //.ToPagedList(pageNumber: page ?? 1, pageSize: PageSize)
                                   ));
            }
            return(View("Index", _views));
        }