ecff953b4dcda9d2e87aeffc3d38156fe120b959.svn-base 901 B

1234567891011121314151617181920212223242526272829303132
  1. (function() {
  2. BemsWebApplication.FmsWorkCodeEmergencyViewModel = function(data) {
  3. this.SiteId = ko.observable();
  4. this.EmergencyId = ko.observable();
  5. this.Name = ko.observable();
  6. this.IsUse = ko.observable();
  7. if(data)
  8. this.fromJS(data);
  9. };
  10. $.extend(BemsWebApplication.FmsWorkCodeEmergencyViewModel.prototype, {
  11. toJS: function() {
  12. return {
  13. SiteId: this.SiteId(),
  14. EmergencyId: this.EmergencyId(),
  15. Name: this.Name(),
  16. IsUse: this.IsUse(),
  17. };
  18. },
  19. fromJS: function(data) {
  20. if(data) {
  21. this.SiteId(data.SiteId);
  22. this.EmergencyId(data.EmergencyId);
  23. this.Name(data.Name);
  24. this.IsUse(data.IsUse);
  25. }
  26. }
  27. });
  28. })();