0430a4f47fcaa5a617ee44fccb38fb01b27d24e1.svn-base 658 B

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