(function() { BemsWebApplication.BemsPriceTypeViewModel = function(data) { this.PriceTypeId = ko.observable(); this.PriceTypeIdDesc = ko.observable(); this.FuelTypeId = ko.observable(); if(data) this.fromJS(data); }; $.extend(BemsWebApplication.BemsPriceTypeViewModel.prototype, { toJS: function() { return { PriceTypeId: this.PriceTypeId(), PriceTypeIdDesc: this.PriceTypeIdDesc(), FuelTypeId: this.FuelTypeId(), }; }, fromJS: function(data) { if(data) { this.PriceTypeId(data.PriceTypeId); this.PriceTypeIdDesc(data.PriceTypeIdDesc); this.FuelTypeId(data.FuelTypeId); } } }); })();