bdcc72d9fd5bde7aa8b69482261ecc49fcb3e98a.svn-base 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. (function() {
  2. BemsWebApplication.BemsMonitoringPointHistory15minRawDataViewModel = function (data) {
  3. this.SiteId = ko.observable();
  4. this.FacilityTypeId = ko.observable();
  5. this.FacilityCode = ko.observable();
  6. this.PropertyId = ko.observable();
  7. this.CreatedDateTime = ko.observable();
  8. this.CurrentValue = ko.observable();
  9. if(data)
  10. this.fromJS(data);
  11. };
  12. $.extend(BemsWebApplication.BemsMonitoringPointHistory15minRawDataViewModel.prototype, {
  13. toJS: function() {
  14. return {
  15. SiteId: this.SiteId(),
  16. FacilityTypeId: this.FacilityTypeId(),
  17. FacilityCode: this.FacilityCode(),
  18. PropertyId: this.PropertyId(),
  19. CreatedDateTime: this.CreatedDateTime(),
  20. CurrentValue: this.CurrentValue(),
  21. };
  22. },
  23. fromJS: function(data) {
  24. if(data) {
  25. this.SiteId(data.SiteId);
  26. this.FacilityTypeId(data.FacilityTypeId);
  27. this.FacilityCode(data.FacilityCode);
  28. this.PropertyId(data.PropertyId);
  29. this.CreatedDateTime(data.CreatedDateTime);
  30. this.CurrentValue(data.CurrentValue);
  31. }
  32. }
  33. });
  34. })();