fmsaccidentcodetype-view-model.js 898 B

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