public ActionResult MyDepartment(int departmentID) { Session[FASTConstant.SESSION_MYDEPARTMENT] = departmentID; AssignmentProcess assignProcess = new AssignmentProcess(); AccessRightsProcess accessProcess = new AccessRightsProcess(); GenericProcess <vwDepartmentList> deptProcess = new GenericProcess <vwDepartmentList>(); List <vwDepartmentList> departments = new List <vwDepartmentList>(); List <AccessRight> accessRights = accessProcess.GetAccessRightsByEmloyeeID(User.Identity.Name.ToInteger()).ToList(); accessRights = accessProcess.GetAccessRightsByEmloyeeID(User.Identity.Name.ToInteger()) .Where(i => i.AccessLevel == FASTConstant.ACCESS_LVL_MANAGER).ToList(); foreach (AccessRight right in accessRights) { departments.Add(deptProcess.GetAll().Where(i => i.DepartmentID == right.DepartmentID).FirstOrDefault()); } vwDepartmentList theDepartment = deptProcess.GetAll().Where(i => i.DepartmentID == departmentID).First(); List <vwAssetAssignmentsForManager> approvals = assignProcess.GetAssignmentsForManagerApprovalByDepartmentID(departmentID, User.Identity.Name.ToInteger()); ViewBag.Approvals = approvals; ViewBag.MyDepartments = departments; TempData["Department"] = theDepartment; return(View()); }
public ActionResult ShowDepartmentEmployee(int departmentID) { EmployeeProcess employeeProcess = new EmployeeProcess(); GenericProcess <Common.vwDepartmentList> deptProcess = new GenericProcess <Common.vwDepartmentList>(); List <vwEmployeeList> listOfEmployees = new List <vwEmployeeList>(); vwDepartmentList department = new vwDepartmentList(); try { listOfEmployees = employeeProcess.GetEmployeesByDepartmentID(departmentID); department = deptProcess.GetAll().Where(i => i.DepartmentID == departmentID).First(); } catch { } ViewBag.Department = department.GroupName; return(View("Index", listOfEmployees)); }