bemsfueltype-view-model.js 637 B

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