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