7d89b4864bd76851009e9ed3c72799070063542d.svn-base 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. (function () {
  2. BemsWebApplication.CmPatrolHistoryPosViewModel = function (data) {
  3. this.SiteId = ko.observable();
  4. this.PatrolHistoryId = ko.observable();
  5. this.PosId = ko.observable();
  6. this.PatrolTime = ko.observable();
  7. this.term = ko.observable();
  8. this.resultType = ko.observable();
  9. this.mId = ko.observable();
  10. if (data)
  11. this.fromJS(data);
  12. };
  13. $.extend(BemsWebApplication.CmPatrolHistoryPosViewModel.prototype, {
  14. toJS: function () {
  15. return {
  16. SiteId: this.SiteId(),
  17. PatrolHistoryId: this.PatrolHistoryId(),
  18. PosId: this.PosId(),
  19. PatrolTime: this.PatrolTime(),
  20. resultType: this.resultType(),
  21. mId: this.mId(),
  22. term: this.term(),
  23. };
  24. },
  25. fromJS: function (data) {
  26. if (data) {
  27. this.SiteId(data.SiteId);
  28. this.PatrolHistoryId(data.PatrolHistoryId);
  29. this.PosId(data.PosId);
  30. this.PatrolTime(data.PatrolTime);
  31. this.resultType(data.resultType);
  32. this.mId(data.mId);
  33. this.term(data.term);
  34. }
  35. }
  36. });
  37. })();