Esempio n. 1
0
        public ActionResult ChangeLeaveRequestApprovalStatusHR(LeaveRequestViewModel leaveRequestInfo)
        {
            if (leaveRequestInfo == null)
            {
                throw new ArgumentNullException(nameof(leaveRequestInfo));
            }

            //Check Model State
            if (!ModelState.IsValid)
            {
                var model = leaveRequestService.GetLeaveRequestUpdateView(leaveRequestInfo, string.Empty);

                return(PartialView("ChangeLeaveRequestApprovalStatusHR", model));
            }

            var processingMessage = leaveRequestService.ProcessLeaveRequestApprovalStatusChangeHr(leaveRequestInfo);

            if (!string.IsNullOrEmpty(processingMessage))
            {
                var model = leaveRequestService.GetLeaveRequestUpdateView(leaveRequestInfo, string.Empty);

                return(this.View("ChangeLeaveRequestApprovalStatusHR", model));
            }

            return(Redirect(leaveRequestInfo.URL));
        }