af2e5c96c4804d67a8b9c1e2e73855e87eb71932.svn-base 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. (function() {
  2. BemsWebApplication.BemsReportHistoryViewModel = function (data) {
  3. this.SiteId = ko.observable();
  4. this.Seq = ko.observable();
  5. this.DateTime = ko.observable();
  6. this.ReportName = ko.observable();
  7. this.ReportFormatId = ko.observable();
  8. this.FormatName = ko.observable();
  9. this.Content = ko.observable();
  10. this.Writer = ko.observable();
  11. this.Confirm1 = ko.observable();
  12. this.Confirm2 = ko.observable();
  13. this.parts = ko.observable();
  14. this.FileName = ko.observable();
  15. if(data)
  16. this.fromJS(data);
  17. };
  18. $.extend(BemsWebApplication.BemsReportHistoryViewModel.prototype, {
  19. toJS: function() {
  20. return {
  21. SiteId: this.SiteId(),
  22. Seq: this.Seq(),
  23. DateTime: this.DateTime(),
  24. ReportName: this.ReportName(),
  25. ReportFormatId: this.ReportFormatId(),
  26. FormatName: this.FormatName(),
  27. Content: this.Content(),
  28. Writer: this.Writer(),
  29. Confirm1: this.Confirm1(),
  30. Confirm2: this.Confirm2(),
  31. parts: this.parts(),
  32. FileName: this.FileName()
  33. };
  34. },
  35. fromJS: function(data) {
  36. if (data) {
  37. this.SiteId(data.SiteId);
  38. this.Seq(data.Seq);
  39. this.DateTime(data.DateTime);
  40. this.ReportName(data.ReportName);
  41. this.ReportFormatId(data.ReportFormatId);
  42. this.FormatName(data.FormatName);
  43. this.Content(data.Content);
  44. this.Writer(data.Writer);
  45. this.Confirm1(data.Confirm1);
  46. this.Confirm2(data.Confirm2);
  47. this.parts(data.parts);
  48. this.FileName(data.FileName);
  49. }
  50. }
  51. });
  52. })();