fmsinvestmentcost-view-model.js 1.1 KB

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