d10b04cc498ab4c6ff2a3d45819d305b5b1a36f0.svn-base 764 B

1234567891011121314151617181920212223242526272829
  1. (function() {
  2. BemsWebApplication.CmUserGroupViewModel = function(data) {
  3. this.SiteId = ko.observable();
  4. this.UserGroupId = ko.observable();
  5. this.Name = ko.observable();
  6. if(data)
  7. this.fromJS(data);
  8. };
  9. $.extend(BemsWebApplication.CmUserGroupViewModel.prototype, {
  10. toJS: function() {
  11. return {
  12. SiteId: this.SiteId(),
  13. UserGroupId: this.UserGroupId(),
  14. Name: this.Name(),
  15. };
  16. },
  17. fromJS: function(data) {
  18. if(data) {
  19. this.SiteId(data.SiteId);
  20. this.UserGroupId(data.UserGroupId);
  21. this.Name(data.Name);
  22. }
  23. }
  24. });
  25. })();