96e3e617f2b56c3237d01f711ddbe58def67723c.svn-base 1.5 KB

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