Advertisement
Guest User

Untitled

a guest
Aug 17th, 2017
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.30 KB | None | 0 0
  1.  
  2. export class TimeLine {
  3. DateAdded: Date;
  4. Id: number;
  5. ElementId: number;
  6. Type: string;
  7. }
  8.  
  9. private employee: Employee = new Employee();
  10. private timeLine: any[]; ///// dałem również private timeLine: TimeLine[];
  11. private timeLineHelper: TimeLine = new TimeLine();
  12.  
  13. employeeModel(x: Employee) {
  14. this.employee = x;
  15. for (var i = 0; i < this.employee.EmployeeTaskModels.length; i++) {
  16. this.timeLineHelper.Id = this.helperId;
  17. this.timeLineHelper.DateAdded = this.employee.EmployeeTaskModels[i].CreatedDate;
  18. this.timeLineHelper.ElementId = this.employee.EmployeeTaskModels[i].Id;
  19. this.timeLineHelper.Type = "Task";
  20. this.timeLine.push(this.timeLineHelper);
  21. this.helperId++;
  22. }
  23. for (var j = 0; j < this.employee.EmployeeWorkOfferModels.length; j++) {
  24. this.timeLineHelper.Id = this.helperId;
  25. this.timeLineHelper.DateAdded = this.employee.EmployeeWorkOfferModels[j].CreatedDate;
  26. this.timeLineHelper.ElementId = this.employee.EmployeeWorkOfferModels[j].Id;
  27. this.timeLineHelper.Type = "Work";
  28. this.timeLine.push(this.timeLineHelper);
  29. this.helperId++;
  30. }
  31. console.log(this.timeLine);
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement