3bfa53aa463bcdf8ba4aa2f2c174b456ad241a63.svn-base 931 B

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