d8737f4f201d49c27178b4a1cc31049562940f18.svn-base 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. (function() {
  2. BemsWebApplication.FmsLicenseViewModel = function(data) {
  3. this.SiteId = ko.observable();
  4. this.LicenseId = ko.observable();
  5. this.Name = ko.observable();
  6. this.IssuingOffice = ko.observable();
  7. this.BusinessFieldId = ko.observable();
  8. this.EducationalInstitute = ko.observable();
  9. this.Note = ko.observable();
  10. this.IsUse = ko.observable();
  11. if(data)
  12. this.fromJS(data);
  13. };
  14. $.extend(BemsWebApplication.FmsLicenseViewModel.prototype, {
  15. toJS: function() {
  16. return {
  17. SiteId: this.SiteId(),
  18. LicenseId: this.LicenseId(),
  19. Name: this.Name(),
  20. IssuingOffice: this.IssuingOffice(),
  21. BusinessFieldId: this.BusinessFieldId(),
  22. EducationalInstitute: this.EducationalInstitute(),
  23. Note: this.Note(),
  24. IsUse: this.IsUse(),
  25. };
  26. },
  27. fromJS: function(data) {
  28. if(data) {
  29. this.SiteId(data.SiteId);
  30. this.LicenseId(data.LicenseId);
  31. this.Name(data.Name);
  32. this.IssuingOffice(data.IssuingOffice);
  33. this.BusinessFieldId(data.BusinessFieldId);
  34. this.EducationalInstitute(data.EducationalInstitute);
  35. this.Note(data.Note);
  36. this.IsUse(data.IsUse);
  37. }
  38. }
  39. });
  40. })();