Advertisement
IDNPeterL

IPP .NET DevKit v2 - QBO TimeActivity - Add

May 8th, 2012
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.14 KB | None | 0 0
  1. //Add QBO TimeActivity
  2. //Documentation:  http://goo.gl/DjJyb
  3.  
  4. List<Employee> employees = commonService.FindAll(new Employee(), 1, 1).ToList<Employee>();
  5. List<Customer> customers = commonService.FindAll(new Customer(), 1, 1).ToList<Customer>();
  6.  
  7. TimeActivity timeActivity = new TimeActivity();
  8. timeActivity.BillableStatus = BillableStatusEnum.Billable;
  9. timeActivity.BillableStatusSpecified = true;
  10. timeActivity.Hours = "8";
  11. timeActivity.Minutes = "0";
  12. timeActivity.BreakHours = "1";
  13. timeActivity.BreakMinutes = "0";
  14. timeActivity.Taxable = true;
  15. timeActivity.TaxableSpecified = true;
  16. timeActivity.TxnDate = DateTime.Now.Date;
  17. timeActivity.TxnDateSpecified = true;
  18. timeActivity.HourlyRate = new decimal(200);
  19. timeActivity.HourlyRateSpecified = true;
  20. timeActivity.CustomerId = customers[0].Id;
  21. timeActivity.NameOf = TimeActivityTypeEnum.Employee;
  22. timeActivity.NameOfSpecified = true;
  23. timeActivity.Item = new EmployeeRef() { EmployeeId = employees[0].Id, EmployeeName = employees[0].Name };
  24. timeActivity.ItemName = "TestTimeActivity";
  25. timeActivity.ItemType = ItemTypeEnum.Service;
  26. TimeActivity timeActivityResult = commonService.Add(timeActivity);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement