(function () { Partials.ConsumeMonthlyViewModel = function (data) { this.SiteId = ko.observable(); this.BuildingId = ko.observable(); this.Year = ko.observable(); this.Month = ko.observable(); this.Cooler = ko.observable(); this.Boiler = ko.observable(); this.Goal = ko.observable(); this.Product = ko.observable(); if (data) this.fromJS(data); }; $.extend(Partials.ConsumeMonthlyViewModel.prototype, { toJS: function () { return { SiteId: this.SiteId(), BuildingId: this.BuildingId(), Year: this.Year(), Month: this.Month(), Day: this.Day(), Cooler: this.Cooler(), Boiler: this.Boiler(), Goal: this.Goal(), product: this.Product(), }; }, fromJS: function (data) { if (data) { this.SiteId(data.SiteId); this.BuildingId(data.BuildingId); this.Year(data.Year); this.Month(data.Month); this.Cooler(data.Cooler); this.Boiler(data.Boiler); this.Goal(data.Goal); this.Product(data.Product); } } }); })();