Пример #1
0
        public ActionResult Reject(ApproveRejectVacationRequestVM request)
        {
            try
            {
                var userInfo = CookieHelpers.GetUserInfo();

                var isApproved = vacationRequestServices.RejectRequest(request.RequestId, userInfo.EmployeeId, request.ResponseComment);

                return(Json(new BaseViewModel <bool>(true, string.Empty, isApproved), JsonRequestBehavior.AllowGet));
            }
            catch (Exception ex)
            {
                return(Json(new BaseViewModel <bool>(true, ex.Message, false), JsonRequestBehavior.AllowGet));
            }
        }
Пример #2
0
        public ActionResult Approve(string requestId)
        {
            try
            {
                var request = vacationRequestServices.GetRequestById(requestId);

                var requestVM = new ApproveRejectVacationRequestVM
                {
                    RequestId   = request.RequestId,
                    RequestedBy = request.RequestEmployeeName,
                    RequestedAt = request.RequestedAt,
                    StartDate   = request.StartDate,
                    EndDate     = request.EndDate,
                };

                return(PartialView("_Approve_Vacation_Request", requestVM));
            }
            catch (Exception ex)
            {
                return(Redirect("/VacationRequest/List"));
            }
        }