9d98e9e9cae135fa7dec8c62e734352ac2f2cee3.svn-base 937 B

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