(function () { BemsWebApplication.BemsAlarmGroupViewModel = function (data) { this.SiteId = ko.observable(); this.AlarmGroupId = ko.observable(); this.Name = ko.observable(); if (data) this.fromJS(data); }; $.extend(BemsWebApplication.BemsAlarmGroupViewModel.prototype, { toJS: function () { return { SiteId: this.SiteId(), AlarmGroupId: this.AlarmGroupId(), Name: this.Name(), }; }, fromJS: function (data) { if (data) { this.SiteId(data.SiteId); this.AlarmGroupId(data.AlarmGroupId); this.Name(data.Name); } } }); })();