33789b675036621476e67bcbb82f411bc39e2d20.svn-base 1.0 KB

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