bfb39e78c7b768c2e613c8515f243d3cdc4fc417.svn-base 816 B

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