Exemplo n.º 1
0
 public static void Add(EmployeeInfo emp)
 {
     var client = EmployeeClient.CreateEmployeeClient();
     client.AddEmployeeAsync(ConvertToEmployee(emp));
     client.WaitForComplete();
 }
Exemplo n.º 2
0
 public static void Modify(EmployeeInfo emp)
 {
     var client = EmployeeClient.CreateEmployeeClient();
     client.ModifyEmployeesAsync(ConvertToEmployee(emp));
     client.WaitForComplete();
 }
Exemplo n.º 3
0
 private static Employee ConvertToEmployee(EmployeeInfo emp)
 {
     Employee result = new Employee();
     result.Id = emp.Id;
     result.Birthday = emp.Birthday;
     result.Bonus = emp.Bonus;
     result.DepartmentId = emp.DepartmentId;
     result.DepartmentName = emp.DepartmentName;
     result.Level = emp.Level;
     result.Name = emp.Name;
     result.Remark = emp.Remark;
     result.Salary = emp.Salary;
     result.Sex = emp.Sex;
     result.Skills = new ObservableCollection<Skill>();
     foreach (var item in emp.Skills)
     {
         result.Skills.Add(ObjectUtils.CloneEx<Skill>(item));
     }
     return result;
 }