(function () { BemsWebApplication.BemsEnergyConfigPercentMonth = function (data) { this.SiteId = ko.observable(); this.Year = ko.observable(); this.Month = ko.observable(); this.Electricity = ko.observable(); this.Gas = ko.observable(); this.Water = ko.observable(); if (data) this.fromJS(data); }; $.extend(BemsWebApplication.BemsEnergyConfigPercentMonth.prototype, { toJS: function () { return { SiteId: this.SiteId(), Year: this.Year(), Month: this.Month(), Electricity: this.Electricity(), Gas: this.Gas(), Water: this.Water() }; }, fromJS: function (data) { if (data) { this.SiteId(data.SiteId); this.Year(data.Year); this.Month(data.Month); this.Electricity(data.Electricity); this.Gas(data.Gas); this.Water(data.Water); } } }); })();