(function() { BemsWebApplication.BemsMonitoringPointViewModel = function(data) { this.SiteId = ko.observable(); this.FacilityTypeId = ko.observable(); this.FacilityCode = ko.observable(); this.PropertyId = ko.observable(); this.ValueType = ko.observable(); this.ServiceTypeId = ko.observable(); this.FuelTypeId = ko.observable(); //this.IsAccumulated = ko.observable(); this.Name = ko.observable(); this.Description = ko.observable(); this.BuildingId = ko.observable(); this.FloorId = ko.observable(); this.ZoneId = ko.observable(); //this.TagInput = ko.observable(); //this.TagOutput = ko.observable(); //this.IsVirtualFacility = ko.observable(); if(data) this.fromJS(data); }; $.extend(BemsWebApplication.BemsMonitoringPointViewModel.prototype, { toJS: function() { return { SiteId: this.SiteId(), FacilityTypeId: this.FacilityTypeId(), FacilityCode: this.FacilityCode(), PropertyId: this.PropertyId(), ValueType: this.ValueType(), ServiceTypeId: this.ServiceTypeId(), FuelTypeId: this.FuelTypeId(), //IsAccumulated: this.IsAccumulated(), Name: this.Name(), Description: this.Description(), BuildingId: this.BuildingId(), FloorId: this.FloorId(), ZoneId: this.ZoneId(), //TagInput: this.TagInput(), //TagOutput: this.TagOutput(), //IsVirtualFacility: this.IsVirtualFacility(), }; }, fromJS: function(data) { if(data) { this.SiteId(data.SiteId); this.FacilityTypeId(data.FacilityTypeId); this.FacilityCode(data.FacilityCode); this.PropertyId(data.PropertyId); this.ValueType(data.ValueType); this.ServiceTypeId(data.ServiceTypeId); this.FuelTypeId(data.FuelTypeId); //this.IsAccumulated(data.IsAccumulated); this.Name(data.Name); this.Description(data.Description); this.BuildingId(data.BuildingId); this.FloorId(data.FloorId); this.ZoneId(data.ZoneId); //this.TagInput(data.TagInput); //this.TagOutput(data.TagOutput); //this.IsVirtualFacility(data.IsVirtualFacility); } } }); })();