(function () { BemsWebApplication.FmsBudgetDetailExecution2ViewModel = function (data) { this.SiteId = ko.observable(); this.Year = ko.observable(); this.BudgetClassId = ko.observable(); this.RootBudgetClassId = ko.observable(); this.ParentBudgetClassId = ko.observable(); this.RootBudgetName = ko.observable(); this.ParentBudgetName = ko.observable(); this.MonthlyBudget = ko.observable(); this.MonthlyExecution = ko.observable(); this.Month = ko.observable(); this.YearlyBudget = ko.observable(); this.YearlyExecution = ko.observable(); this.Depth = ko.observable(); this.Name = ko.observable(); this.BudgetSeq = ko.observable(); if (data) this.fromJS(data); }; $.extend(BemsWebApplication.FmsBudgetDetailExecution2ViewModel.prototype, { toJS: function () { return { SiteId: this.SiteId(), Year: this.Year(), BudgetClassId: this.BudgetClassId(), RootBudgetClassId: this.RootBudgetClassId(), ParentBudgetClassId: this.ParentBudgetClassId(), RootBudgetName: this.RootBudgetName(), ParentBudgetName: this.ParentBudgetName(), MonthlyExecution: this.MonthlyExecution(), Month: this.Month(), YearlyBudget: this.YearlyBudget(), MonthlyBudget: this.MonthlyBudget(), YearlyExecution: this.YearlyExecution(), Depth: this.Depth(), Name: this.Name(), BudgetSeq: this.BudgetSeq(), }; }, fromJS: function (data) { if (data) { this.SiteId(data.SiteId); this.Year(data.Year); this.BudgetClassId(data.BudgetClassId); this.RootBudgetClassId(data.RootBudgetClassId); this.ParentBudgetClassId(data.ParentBudgetClassId); this.RootBudgetName(data.RootBudgetName); this.ParentBudgetName(data.ParentBudgetName); this.MonthlyExecution(data.MonthlyExecution); this.Month(data.Month); this.YearlyBudget(data.YearlyBudget); this.MonthlyBudget(data.MonthlyBudget); this.YearlyExecution(data.YearlyExecution); this.Depth(data.Depth); this.Name(data.Name); this.BudgetSeq(data.BudgetSeq); } } }); })();