private void GetAllEmployeesCompleted(object sender, GetAllEmployeesCompletedEventArgs e) { _employeeServiceClient.GetAllEmployeesCompleted -= GetAllEmployeesCompleted; foreach (IManageEmployeeService.Employee emp in e.Result) { if (!emp.IsDeleted) { Employees.Add(emp); } } }
private void client_GetAllEmployeesCompleted(object sender, GetAllEmployeesCompletedEventArgs e) { Logger.Instance().Log(MessageType.Information, "Get All Employee Completed"); if (ErrorHandler.Handle(e.Error)) { return; } List <Employee> employees = new List <Employee>(); if (e.Result != null) { employees = e.Result.ToList <Employee>(); } else { Logger.Instance().Log(MessageType.Error, "Result is NULL"); } source.Clear(); for (int i = 0; i < employees.Count; i++) { employees[i].Password = CryptographyStuff.AES_DecryptString(employees[i].Password); User user = new User(employees[i]); user.Index = i + 1; source.Add(user); } records.ItemsSource = null; records.ItemsSource = source; records.SelectedIndex = currentSelectIndex; records.LoadingRow += new EventHandler <DataGridRowEventArgs>(records_LoadingRow); //ClientInstance.HideSpinner(); }