a12a807bcd66de873fe6fc9e2264979e3479f5fc.svn-base 997 B

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