(function() { BemsWebApplication.BemsMonitoringPointBaseDataViewModel = function(data) { this.SiteId = ko.observable(); this.FacilityTypeId = ko.observable(); this.PropertyId = ko.observable(); this.ValueType = ko.observable(); this.IsAccumulated = ko.observable(); this.ServiceType = ko.observable(); this.FuelType = ko.observable(); this.Name = ko.observable(); this.Description = ko.observable(); if(data) this.fromJS(data); }; $.extend(BemsWebApplication.BemsMonitoringPointBaseDataViewModel.prototype, { toJS: function() { return { SiteId: this.SiteId(), FacilityTypeId: this.FacilityTypeId(), PropertyId: this.PropertyId(), ValueType: this.ValueType(), IsAccumulated: this.IsAccumulated(), ServiceType: this.ServiceType(), FuelType: this.FuelType(), Name: this.Name(), Description: this.Description(), }; }, fromJS: function(data) { if(data) { this.SiteId(data.SiteId); this.FacilityTypeId(data.FacilityTypeId); this.PropertyId(data.PropertyId); this.ValueType(data.ValueType); this.IsAccumulated(data.IsAccumulated); this.ServiceType(data.ServiceType); this.FuelType(data.FuelType); this.Name(data.Name); this.Description(data.Description); } } }); })();