Exemple #1
0
        public List <RequestViewModel> ListRequestsByDepartmentId()
        {
            string userId = User.Identity.GetUserId();
            Staff  s1     = StaffDepartmentDAO.GetStaffByUserId(userId);

            if (s1 == null)
            {
                return(null);
            }

            List <RequestViewModel> reqList = RequestDAO.GetPendingRequestsInDepartment(s1);

            return(reqList);
        }
        public ActionResult ApproveReject(string ShowHistory)
        {
            TempData["ShowHistory"] = "False";
            string userId = User.Identity.GetUserId();
            Staff  s1     = StaffDepartmentDAO.GetStaffByUserId(userId);
            List <RequestViewModel> reqList = RequestDAO.GetPendingRequestsInDepartment(s1);

            if (ShowHistory == "True")
            {
                List <RequestViewModel> reqList0 = RequestDAO.GetHistoryRequestsInDepartment(s1);
                reqList = reqList.Union(reqList0).ToList();
                TempData["ShowHistory"] = "True";
            }
            return(View(reqList));
        }