private void SyncMissingDbUsers() { this.LogService.LogEvent("START: Sync missing users in was/is table"); var adUsers = AdUserService.GetCachedUsers(); var dbUsers = DbUserService.GetAllUsers(); var dbUsersIds = dbUsers.Select(x => x.AttorneyUserID.ToLower()).ToList(); var missingUsers = adUsers.Where(x => !dbUsersIds.Contains(x.UserId.ToLower())).ToList(); DbUserService.AddMissingUsers(missingUsers); this.LogService.LogEvent("FINISH: Sync missing users in was/is table"); }
private List <Attorney> LoadAttorneys() { this.LogService.LogEvent("START: Load Attorneys: Loading the data from AD and mapping with DB user."); var dbUsers = DbUserService.GetAllUsers(); var blackListedNumbers = HelperService.GetBlackListedFaxNumbers(); var listAttoryes = new List <Attorney>(); foreach (var user in dbUsers) { var attorneyObj = BuildAttorney(user, blackListedNumbers); if (attorneyObj.NotNull()) { listAttoryes.Add(attorneyObj); } } this.LogService.LogEvent("FINISH: Load Attorneys: Loading the data from AD and mapping with DB user."); return(listAttoryes); }