4fb0c727be5a8141fe9b45b84e03f110180992a5.svn-base 907 B

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