コード例 #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);
        }
コード例 #2
0
        public Dictionary <string, List <Employee> > GetAllEmployeesOfDepartment()
        {
            Dictionary <string, List <Employee> > repDict = new Dictionary <string, List <Employee> >();

            Employee user = AuthUtil.GetCurrentLoggedUser();

            if (user == null)
            {
                repDict.Add("repList", new List <Employee>());
            }
            else
            {
                List <Employee> employees = RepresentativeService.GetEmployeesByDepartment(user.DeptId);
                repDict.Add("repList", employees);
            }

            return(repDict);
        }