public void Strata_User() { List <CurrentUsers> AllCurrentUsersList = CurrentUserList_ReadExcel.ReadExcelForCurrentUsers("Current User List", @"C:\Automation\Judy_Data\Strata users and HR Employees April 18.xlsx", 1); List <HREmployee> AllHREmployee = HRList_ReadExel.ReadExcelForHREmployeeList("HR Employee List", @"C:\Automation\Judy_Data\Strata users and HR Employees April 18.xlsx", 2, 3); //AllCurrentUsers.Sort(); // AllHREmployee.Sort(); List <string> Current = new List <string>(); List <string> Existing = new List <string>(); foreach (var item in AllCurrentUsersList) { Current.Add(item.Name.Trim()); } foreach (var item in AllHREmployee) { Existing.Add(item.FirstName.Trim()); } List <string> nomatch = Current.Except(Existing).ToList(); CurrentUserList_ReadExcel.WriteExceptions(nomatch, @"C:\Automation\Judy_Data\Strata users and HR Employees April 18.xlsx"); }
public void CDlClassic_User() { List <CDLClassicUsers> AllCDLUsers = CDLClassicUsersList.ReadExcelForCDLUsers("UserList", @"C:\Automation\Judy_Data\CDL Classic users and HR Employees April 18.xlsx", 1, 2, 3, 4); List <HREmployee> AllHREmployee = HRList_ReadExel.ReadExcelForHREmployeeList("HR List", @"C:\Automation\Judy_Data\CDL Classic users and HR Employees April 18.xlsx", 2, 3); var nomatch = AllCDLUsers.Where(p => !AllHREmployee.Any(p2 => string.Format("{0} {1}", p2.FirstName.Trim(), p2.Surname.Trim()) == p.Name.Trim())).Where(p => p.Name != null | p.Name != "").ToList(); CDLClassicUsersList.WriteExceptions(nomatch, @"C:\Automation\Judy_Data\CDL Classic users and HR Employees April 18.xlsx"); }