-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTD.hx
64 lines (57 loc) · 1.23 KB
/
TD.hx
1
import thx.core.*;typedef Employees = List<Employee>;typedef Employee = { id : Int, lastName : String, firstName : String, title : String, birthDate : Date, hireDate : Date, address : String, city : String, state : String, country : String, postalCode : String, phone : String, fax : String, email : String };class EmployeeMapper { public static function dbEmployeeToEmployee( i : DB__Employee) : Employee { var imap = new thx.AnonymousMap(i); return { id : i.EmployeeId, lastName : i.LastName, firstName : i.FirstName, title : i.Title, birthDate : i.BirthDate, hireDate : i.HireDate, address : i.Address, city : i.City, state : i.State, country : i.Country, postalCode : i.PostalCode, phone : i.Phone, fax : i.Fax, email : i.Email }; } public static function employeeToDbEmployee( i : Employee) : DB__Employee { return { EmployeeId : i.id, LastName : i.lastName, FirstName : i.firstName, Title : i.title, BirthDate : i.birthDate, HireDate : i.hireDate, Address : i.address, City : i.city, State : i.state, Country : i.country, PostalCode : i.postalCode, Phone : i.phone, Fax : i.fax, Email : i.email }; }}