本文整理汇总了C#中SQLDB.getEmployeesOfSector方法的典型用法代码示例。如果您正苦于以下问题:C# SQLDB.getEmployeesOfSector方法的具体用法?C# SQLDB.getEmployeesOfSector怎么用?C# SQLDB.getEmployeesOfSector使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SQLDB
的用法示例。
在下文中一共展示了SQLDB.getEmployeesOfSector方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: getEmployeesOfSector
// получаем список сотрудников на конкретном участке
public List<Employee> getEmployeesOfSector(List<EmployeeAttrib> emp_attribs, string secID, string period)
{
SQLDB db = new SQLDB();
List<Employee> all_employees = db.getEmployeesOfSector(secID, period);
List<Employee> new_employees = new List<Employee>();
foreach (EmployeeAttrib emp_attr in emp_attribs)
{
if (new_employees.Count > 0)
{
Employee employee = new_employees.Find(delegate(Employee emp) { return emp.EmployeeID.Equals(emp_attr.EmployeeID); });
if (employee == null)
{
List<Employee> employees = all_employees.FindAll(delegate(Employee emp) { return emp.EmployeeID.Equals(emp_attr.EmployeeID); });
foreach (Employee em in employees)
new_employees.Add(em);
}
}
else
{
List<Employee> employees = all_employees.FindAll(delegate(Employee emp) { return emp.EmployeeID.Equals(emp_attr.EmployeeID); });
foreach (Employee em in employees)
new_employees.Add(em);
}
}
EmployeeComparerByFullnameASC cp = new EmployeeComparerByFullnameASC();
new_employees.Sort(cp);
return new_employees;
}