4096a11d6e8a0b9f8b8966f65c9d2517ab37de35.svn-base 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. (function() {
  2. BemsWebApplication.FmsWorkOperationTimeViewModel = function(data) {
  3. this.SiteId = ko.observable();
  4. this.FacilityCode = ko.observable();
  5. this.CheckDatetime = ko.observable();
  6. this.InsertedDate = ko.observable();
  7. this.InsertedUserId = ko.observable();
  8. this.UpdatedDate = ko.observable();
  9. this.UpdatedUserId = ko.observable();
  10. if(data)
  11. this.fromJS(data);
  12. };
  13. $.extend(BemsWebApplication.FmsWorkOperationTimeViewModel.prototype, {
  14. toJS: function() {
  15. return {
  16. SiteId: this.SiteId(),
  17. FacilityCode: this.FacilityCode(),
  18. CheckDatetime: this.CheckDatetime(),
  19. InsertedDate: this.InsertedDate(),
  20. InsertedUserId: this.InsertedUserId(),
  21. UpdatedDate: this.UpdatedDate(),
  22. UpdatedUserId: this.UpdatedUserId(),
  23. };
  24. },
  25. fromJS: function(data) {
  26. if(data) {
  27. this.SiteId(data.SiteId);
  28. this.FacilityCode(data.FacilityCode);
  29. this.CheckDatetime(data.CheckDatetime);
  30. this.InsertedDate(data.InsertedDate);
  31. this.InsertedUserId(data.InsertedUserId);
  32. this.UpdatedDate(data.UpdatedDate);
  33. this.UpdatedUserId(data.UpdatedUserId);
  34. }
  35. }
  36. });
  37. })();