(function () { BemsWebApplication.FmsInvestmentCostViewModel = function (data) { this.SiteId = ko.observable(); this.InsvestmentCostId = ko.observable(); this.Name = ko.observable(); this.Comment = ko.observable(); this.InsvestmentCost = ko.observable(); if (data) this.fromJS(data); }; $.extend(BemsWebApplication.FmsInvestmentCostViewModel.prototype, { toJS: function () { return { SiteId: this.SiteId(), InsvestmentCostId: this.InsvestmentCostId(), Name: this.Name(), Comment: this.Comment(), InsvestmentCost: this.InsvestmentCost(), }; }, fromJS: function (data) { if (data) { this.SiteId(data.SiteId); this.InsvestmentCostId(data.InsvestmentCostId); this.Name(data.Name); this.Comment(data.Comment); this.InsvestmentCost(data.InsvestmentCost); } } }); })();