adb2a63021585fb5c1e7fcf56432a7a0d0954899.svn-base 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. (function() {
  2. BemsWebApplication.BemsNoticePriceDetailViewModel = function (data) {
  3. this.SiteId = ko.observable();
  4. this.FuelTypeId = ko.observable();
  5. this.ApplyDate = ko.observable();
  6. this.ContractType = ko.observable();
  7. this.DataId = ko.observable();
  8. this.P01 = ko.observable();
  9. this.P02 = ko.observable();
  10. this.P03 = ko.observable();
  11. this.P04 = ko.observable();
  12. this.P05 = ko.observable();
  13. this.P06 = ko.observable();
  14. this.P07 = ko.observable();
  15. this.P08 = ko.observable();
  16. this.P09 = ko.observable();
  17. this.P10 = ko.observable();
  18. this.P11 = ko.observable();
  19. this.P12 = ko.observable();
  20. if(data)
  21. this.fromJS(data);
  22. };
  23. $.extend(BemsWebApplication.BemsNoticePriceDetailViewModel.prototype, {
  24. toJS: function() {
  25. return {
  26. SiteId: this.SiteId(),
  27. FuelTypeId: this.FuelTypeId(),
  28. ApplyDate: this.ApplyDate(),
  29. ContractType: this.ContractType(),
  30. DataId: this.DataId(),
  31. P01: this.P01(),
  32. P02: this.P02(),
  33. P03: this.P03(),
  34. P04: this.P04(),
  35. P05: this.P05(),
  36. P06: this.P06(),
  37. P07: this.P07(),
  38. P08: this.P08(),
  39. P09: this.P09(),
  40. P10: this.P10(),
  41. P11: this.P11(),
  42. P12: this.P12(),
  43. };
  44. },
  45. fromJS: function(data) {
  46. if(data) {
  47. this.SiteId(data.SiteId);
  48. this.FuelTypeId(data.FuelTypeId);
  49. this.ApplyDate(data.ApplyDate);
  50. this.ContractType(data.ContractType);
  51. this.DataId(data.DataId);
  52. this.P01(data.P01);
  53. this.P02(data.P02);
  54. this.P03(data.P03);
  55. this.P04(data.P04);
  56. this.P05(data.P05);
  57. this.P06(data.P06);
  58. this.P07(data.P07);
  59. this.P08(data.P08);
  60. this.P09(data.P09);
  61. this.P10(data.P10);
  62. this.P11(data.P11);
  63. this.P12(data.P12);
  64. }
  65. }
  66. });
  67. })();