6353e9845decbeb97b716d8e86234facad2063d3.svn-base 1.1 KB

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