public string RejectRequest(int id)
        {
            Request request = requestService.FindRequestbyId(id);

            requestService.updateStatus(request, Enums.Status.Rejected);
            emailservice.sendrequestrejectionemailnotifitcation(request.EmployeeId);
            return(JsonSerializer.Serialize(new { Id = id, Status = Enums.Status.Rejected }));
        }
        public IActionResult Submit(string submitButton, int requestid, string Comments)
        {
            if (!(HttpContext.Session.GetString("role") == EmployeeRole.DEPTHEAD || HttpContext.Session.GetString("role") == "ActingHead"))
            {
                return(RedirectToAction(HttpContext.Session.GetString("role"), "Home"));
            }

            Request request = requestService.FindRequestbyId(requestid);

            request.Comments = Comments;
            dbcontext.SaveChanges();
            int id = request.EmployeeId;

            if (submitButton == "Reject")
            {
                emailService.sendrequestrejectionemailnotifitcation(id);
                return(RedirectToAction("RejectRequest", new { id = requestid }));
            }
            else
            {
                emailService.sendrequestapprovalemailnotifitcation(id);
                return(RedirectToAction("ApproveRequest", new { id = requestid }));
            }
        }