Ejemplo n.º 1
0
        public Dictionary <string, object> GetAllRepresentativesOfDepartment()
        {
            Dictionary <string, object> repDict = new Dictionary <string, object>();

            Employee user = AuthUtil.GetCurrentLoggedUser();

            if (user == null)
            {
                repDict.Add("repList", new List <Employee>());
                repDict.Add("curRep", new Employee());
            }
            else
            {
                long            currentRepId = DepartmentService.GetCurrentRep(user.DeptId);
                List <Employee> employees    = RepresentativeService.GetEmployeesByDepartment(user.DeptId);
                Employee        emp          = employees.Find(e => e.EmpId == currentRepId);
                if (emp == null)
                {
                    emp = DepartmentDAO.GetCurrentRepInfoById(user.DeptId);
                }

                repDict.Add("repList", employees);
                repDict.Add("curRep", emp);
            }

            return(repDict);
        }