1b714e6e465410b7d83cf20d152ffe4f69003c73.svn-base 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. 
  2. (function () {
  3. BemsWebApplication.BemsIceThermalStorageSimulationViewModel = 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.SimulationValue = ko.observable();
  11. this.SimulationCase = ko.observable();
  12. if (data)
  13. this.fromJS(data);
  14. };
  15. $.extend(BemsWebApplication.BemsIceThermalStorageSimulationViewModel.prototype, {
  16. toJS: function () {
  17. return {
  18. SiteId: this.SiteId(),
  19. FacilityTypeId: this.FacilityTypeId(),
  20. FacilityCode: this.FacilityCode(),
  21. PropertyId: this.PropertyId(),
  22. CreatedDateTime: this.CreatedDateTime(),
  23. TargetDateTime: this.TargetDateTime(),
  24. SimulationValue: this.SimulationValue(),
  25. SimulationCase: this.SimulationCase()
  26. };
  27. },
  28. fromJS: function (data) {
  29. if (data) {
  30. this.SiteId(data.SiteId);
  31. this.FacilityTypeId(data.FacilityTypeId);
  32. this.FacilityCode(data.FacilityCode);
  33. this.PropertyId(data.PropertyId);
  34. this.CreatedDateTime(data.CreatedDateTime);
  35. this.TargetDateTime(data.TargetDateTime);
  36. this.SimulationValue(data.SimulationValue);
  37. this.SimulationCase(data.SimulationCase);
  38. }
  39. }
  40. });
  41. })();