private void BindEmployee(int departmentID) //绑定部门员工 { //List<Employee> emp = new List<Employee>(); //emp = await _sc.QueryEmployeeByDepartmentID(departmentID); List <Employee> emp = _sc.QueryEmployeeByDepartmentID(departmentID); if (emp != null) { UserHelper.EmpList = emp; } List <sEmployee> semp = new List <sEmployee>(); if (emp != null) { foreach (Employee e in emp) { sEmployee se = new sEmployee(); se.Id = e.Id; se.Name = e.Name; se.Position = e.Position; se.UserName = e.User.Username; se.Department = e.Department.Name; se.IsAdmin = e.IsAdmin == 0 ? "否" : "是"; se.CanSubmit = e.CanSubmit == 0 ? "否" : "是"; se.CanSign = e.CanSign == 0 ? "否" : "是"; se.CanStatistic = e.CanStatistic == 0 ? "否" : "是"; semp.Add(se); } UserHelper.sEmpList = semp; this.dataGridView3.AutoGenerateColumns = false; this.dataGridView3.DataSource = semp; } }