|
| 1 | +namespace CustomAdaptor.Components.Pages |
| 2 | +{ |
| 3 | + public class EmployeeData |
| 4 | + { |
| 5 | + public static List<EmployeeData> Employees = new List<EmployeeData>(); |
| 6 | + |
| 7 | + public EmployeeData() { } |
| 8 | + |
| 9 | + public EmployeeData(int EmployeeID, string FirstName, string LastName, string Title, string Country) |
| 10 | + { |
| 11 | + this.EmployeeID = EmployeeID; |
| 12 | + this.FirstName = FirstName; |
| 13 | + this.LastName = LastName; |
| 14 | + this.Title = Title; |
| 15 | + this.Country = Country; |
| 16 | + } |
| 17 | + |
| 18 | + public static List<EmployeeData> GetAllRecords() |
| 19 | + { |
| 20 | + if (Employees.Count == 0) |
| 21 | + { |
| 22 | + var firstNames = new string[] { "Alice", "John", "Claire", "Michael", "Sophia", "William", "Emma", "James", "Olivia", "Ethan" }; |
| 23 | + var lastNames = new string[] { "Smith", "Doe", "Johnson", "Brown", "Davis", "Wilson", "Martinez", "Anderson", "Taylor", "Thomas" }; |
| 24 | + var titles = new string[] { "Sales Representative", "Vice President, Sales", "Sales Manager", "Inside Sales Coordinator" }; |
| 25 | + var countries = new string[] { "USA", "UK", "UAE", "NED", "BER" }; |
| 26 | + |
| 27 | + Random random = new Random(); |
| 28 | + for (int i = 1; i <= 100; i++) |
| 29 | + { |
| 30 | + Employees.Add(new EmployeeData( |
| 31 | + i, |
| 32 | + firstNames[random.Next(firstNames.Length)], |
| 33 | + lastNames[random.Next(lastNames.Length)], |
| 34 | + titles[random.Next(titles.Length)], |
| 35 | + countries[random.Next(countries.Length)] |
| 36 | + )); |
| 37 | + } |
| 38 | + } |
| 39 | + return Employees; |
| 40 | + } |
| 41 | + public int EmployeeID { get; set; } |
| 42 | + public string? FirstName { get; set; } |
| 43 | + public string? LastName { get; set; } |
| 44 | + public string? Title { get; set; } |
| 45 | + public string? Country { get; set; } |
| 46 | + } |
| 47 | +} |
0 commit comments