a6f20560e8553acda6834e78e22a414abc788f7c.svn-base 783 B

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