6a3bfd95586a7718f95e5363cfcd393e5c44b015.svn-base 843 B

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