本文整理汇总了C#中Manager.AddEmployees方法的典型用法代码示例。如果您正苦于以下问题:C# Manager.AddEmployees方法的具体用法?C# Manager.AddEmployees怎么用?C# Manager.AddEmployees使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Manager
的用法示例。
在下文中一共展示了Manager.AddEmployees方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Main
public static void Main()
{
Manager manager1 = new Manager("000001", "Manager1", "Manager1 Last name", 123m, Department.Marketing);
Manager manager2 = new Manager("000002", "Manager2", "Manager2 Last name", 351.23m, Department.Production);
Manager manager3 = new Manager("000003", "Manager2", "Manager2 Last name", 421.53m, Department.Accounting);
SalesEmployee salesEmployee1 = new SalesEmployee("000004", "SalesEmployee1", "SalesEmployee1 Last name", 212m, Department.Marketing);
Developer developer1 = new Developer("000007", "Developer1", "Developer1 Last name", 2232m, Department.Marketing);
Developer developer2 = new Developer("000009", "Developer3", "Developer3 Last name", 104.23m, Department.Accounting);
Sale sale = new Sale("graphic card", DateTime.Now, 140m);
Project project = new Project("Php", "Php course", DateTime.Now);
manager1.AddEmployees(new HashSet<Employee> { salesEmployee1, developer2 });
salesEmployee1.AddSales(new HashSet<Sale> { sale });
developer1.AddProjects(new HashSet<Project> { project });
IList<Employee> employees = new List<Employee>
{
manager1,
manager2,
manager3,
salesEmployee1,
};
foreach (var employee in employees)
{
Console.WriteLine(employee);
}
}