Example #1
0
        public ActionResult IncomingRequestList([DataSourceRequest] DataSourceRequest request)
        {
            var leaveRequestList = _employeeLeaveRequestService.GetEmployeeLeaveRequests(LoginInformation.UserInformation.EmployeeId);

            LoginInformation.IncomingLeaveRequest = leaveRequestList.Where(s => s.ApprovalStatusId == 1 || s.ApprovalStatusId == 2).ToList().Count;

            foreach (var leaveRequest in leaveRequestList)
            {
                leaveRequest.ApprovalStatusName = _leaveApprovalStatusService.GetById(leaveRequest.ApprovalStatusId).Name;
            }
            return(Json(leaveRequestList.ToDataSourceResult(request)));
        }
Example #2
0
        private void SetLoginInformation(UserInformationModel userInformation)
        {
            Session["IsLogged"] = true;
            LoginInformation.UserInformation = userInformation;

            if (userInformation.RoleId != null)
            {
                LoginInformation.IsApprover = _employeeService.IsApprover(userInformation.EmployeeId);
                if (LoginInformation.IsApprover)
                {
                    LoginInformation.IncomingLeaveRequest = _employeeLeaveRequestService.GetEmployeeLeaveRequests(
                        LoginInformation.UserInformation.EmployeeId)
                                                            .Where(s => s.ApprovalStatusId == 1 || s.ApprovalStatusId == 2).ToList().Count;
                }
                LoginInformation.PermittedMenues = _menuService.GetPermittedMenus((long)userInformation.RoleId);
            }
        }