(function () { BemsWebApplication.BemsMonitoringPointConfigViewModel = function (data) { this.SiteId = ko.observable(); this.FacilityTypeId = ko.observable(); this.FacilityCode = ko.observable(); this.PropertyId = ko.observable(); this.IsAccumulated = ko.observable(); this.IsSampled = ko.observable(); this.SaveMode = ko.observable(); this.ControlPointName = ko.observable(); this.IsConverted = ko.observable(); if (data) this.fromJS(data); }; $.extend(BemsWebApplication.BemsMonitoringPointConfigViewModel.prototype, { toJS: function () { return { SiteId: this.SiteId(), FacilityTypeId: this.FacilityTypeId(), FacilityCode: this.FacilityCode(), PropertyId: this.PropertyId(), IsAccumulated: this.IsAccumulated(), IsSampled: this.IsSampled(), SaveMode: this.SaveMode(), ControlPointName: this.ControlPointName(), IsConverted: this.IsConverted(), }; }, fromJS: function (data) { if (data) { this.SiteId(data.SiteId); this.FacilityTypeId(data.FacilityTypeId); this.FacilityCode(data.FacilityCode); this.PropertyId(data.PropertyId); this.IsAccumulated(data.IsAccumulated); this.IsSampled(data.IsSampled); this.SaveMode(data.SaveMode); this.ControlPointName(data.ControlPointName); this.IsConverted(data.IsConverted); } } }); })();