fmsdrawingcodegroup-view-model.js 914 B

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