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