e28144acab93fa7e5896835767b9022bc18597f1.svn-base 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. (function() {
  2. BemsWebApplication.FmsWorkOperationItemViewModel = function(data) {
  3. this.SiteId = ko.observable();
  4. this.FacilityCode = ko.observable();
  5. this.CheckDateTime = ko.observable();
  6. this.ItemId = ko.observable();
  7. this.ItemName = ko.observable();
  8. this.ItemResult = ko.observable();
  9. this.ResultUnit = ko.observable();
  10. this.SortOrderNo = ko.observable();
  11. this.InsertedDate = ko.observable();
  12. this.InsertedUserId = ko.observable();
  13. this.UpdatedDate = ko.observable();
  14. this.UpdatedUserId = ko.observable();
  15. if(data)
  16. this.fromJS(data);
  17. };
  18. $.extend(BemsWebApplication.FmsWorkOperationItemViewModel.prototype, {
  19. toJS: function() {
  20. return {
  21. SiteId: this.SiteId(),
  22. FacilityCode: this.FacilityCode(),
  23. CheckDateTime: this.CheckDateTime(),
  24. ItemId: this.ItemId(),
  25. ItemName: this.ItemName(),
  26. ItemResult: this.ItemResult(),
  27. ResultUnit: this.ResultUnit(),
  28. SortOrderNo: this.SortOrderNo(),
  29. InsertedDate: this.InsertedDate(),
  30. InsertedUserId: this.InsertedUserId(),
  31. UpdatedDate: this.UpdatedDate(),
  32. UpdatedUserId: this.UpdatedUserId(),
  33. };
  34. },
  35. fromJS: function(data) {
  36. if(data) {
  37. this.SiteId(data.SiteId);
  38. this.FacilityCode(data.FacilityCode);
  39. this.CheckDateTime(data.CheckDateTime);
  40. this.ItemId(data.ItemId);
  41. this.ItemName(data.ItemName);
  42. this.ItemResult(data.ItemResult);
  43. this.ResultUnit(data.ResultUnit);
  44. this.SortOrderNo(data.SortOrderNo);
  45. this.InsertedDate(data.InsertedDate);
  46. this.InsertedUserId(data.InsertedUserId);
  47. this.UpdatedDate(data.UpdatedDate);
  48. this.UpdatedUserId(data.UpdatedUserId);
  49. }
  50. }
  51. });
  52. })();