(function() { BemsWebApplication.BemsMonitoringPointHistoryDailyViewModel = function(data) { this.SiteId = ko.observable(); this.FacilityTypeId = ko.observable(); this.FacilityCode = ko.observable(); this.PropertyId = ko.observable(); this.CreatedDateTime = ko.observable(); this.DailyValue = ko.observable(); if(data) this.fromJS(data); }; $.extend(BemsWebApplication.BemsMonitoringPointHistoryDailyViewModel.prototype, { toJS: function() { return { SiteId: this.SiteId(), FacilityTypeId: this.FacilityTypeId(), FacilityCode: this.FacilityCode(), PropertyId: this.PropertyId(), CreatedDateTime: this.CreatedDateTime(), DailyValue: this.DailyValue(), }; }, fromJS: function(data) { if(data) { this.SiteId(data.SiteId); this.FacilityTypeId(data.FacilityTypeId); this.FacilityCode(data.FacilityCode); this.PropertyId(data.PropertyId); this.CreatedDateTime(data.CreatedDateTime); this.DailytValue(data.DailyValue); } } }); })();