1c12351ec0280ea687ae5888dc0bd80f59e8197d.svn-base 778 B

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