public DesignTimeEmployeeSelectionViewModel() { ViewData = new EmployeeSelectionViewData(); var employees = new ObservableCollection<EmployeeListItemViewData>(); employees.Add(new EmployeeListItemViewData() { EmployeeID = 24, FirstName = "John", LastName = "Doe", CPR = "2801 123456", EmpAddress = "Somewhwere in Denmark", City = "Odense", Zip = "5200", Country = "Denmark", Email = "*****@*****.**", TelephoneNumber = "+45 25 25 25 25", MobileNumber = "+45 00 00 00 00", CreditCard = "1234456", ExpDate = DateTime.Now, EmployeePosition = "Junior Detective" }); employees.Add(new EmployeeListItemViewData() { EmployeeID = 24, FirstName = "Jane", LastName = "Desole", CPR = "2801 123456", EmpAddress = "Somewhwere in Denmark 2", City = "Odense", Zip = "5200", Country = "Denmark", Email = "*****@*****.**", TelephoneNumber = "+45 25 25 25 25", MobileNumber = "+45 00 00 00 00", CreditCard = "1234456", ExpDate = DateTime.Now, EmployeePosition = "Senior Detective" }); employees.Add(new EmployeeListItemViewData() { EmployeeID = 10000, FirstName = "Johnny", LastName = "Doenning", CPR = "2801 123456", EmpAddress = "Somewhwere in Denmark 3", City = "Odense", Zip = "5200", Country = "Denmark", Email = "*****@*****.**", TelephoneNumber = "+45 25 25 25 25", MobileNumber = "+45 00 00 00 00", CreditCard = "1234456", ExpDate = DateTime.Now, EmployeePosition = "Grand Detective" }); ((EmployeeSelectionViewData)ViewData).Employees = employees; }
public EmployeeSelectionViewData GetEmployeeSelectionViewData(string cityFilter) { EmployeeSelectionViewData vd = new EmployeeSelectionViewData(); vd.Employees = new ObservableCollection<EmployeeListItemViewData>(); foreach (var employee in empRep.GetListOfEmployees(cityFilter)) { vd.Employees.Add(new EmployeeListItemViewData() { EmployeeID = employee.EmployeeID, FirstName = employee.FirstName, LastName = employee.LastName, CPR = employee.CPR, EmpAddress = employee.EmpAddress, City = employee.City, Zip = employee.Zip, Country = employee.Country, Email = employee.Email, TelephoneNumber = employee.TelephoneNumber, MobileNumber = employee.MobileNumber, CreditCard = employee.CreditCard, ExpDate = employee.ExpDate, }); } return vd; }