Exemple #1
0
 public void updateApproveRejectStatus([FromBody] RequestViewModel request)
 {
     if (request != null && request.requestId != null && request.status_request != null)
     {
         if (request.status_request.ToUpper() == "APPROVED")
         {
             RequestDAO.ApproveRequest(request.requestId, request.remark);
         }
         else if (request.status_request.ToUpper() == "REJECTED")
         {
             RequestDAO.RejectRequest(request.requestId, request.remark);
         }
     }
 }
        public ActionResult ApproveReject(string remarks, int?approveSelected, int?rejectSelected)
        {
            string userId = User.Identity.GetUserId();
            var    s1     = StaffDepartmentDAO.GetStaffByUserId(userId);

            // If reject request is submitted
            if (rejectSelected != null)
            {
                RequestDAO.RejectRequest(rejectSelected, remarks);
                return(RedirectToAction("ApproveReject"));
            }
            else if (approveSelected != null)
            {
                RequestDAO.ApproveRequest(approveSelected, remarks);
                return(RedirectToAction("ApproveReject"));
            }
            else
            {
                return(View("~/Views/Shared/Error.cshtml"));
            }
        }