(function () { BemsWebApplication.BemsConfigDataViewModel = function (data) { this.SiteId = ko.observable(); this.LoadDBIP = ko.observable(); this.LoadDBUserID = ko.observable(); this.LoadDBUserPW = ko.observable(); this.LoadDBName = ko.observable(); this.TargetDBIP = ko.observable(); this.TargetDBUserID = ko.observable(); this.TargetDBUserPW = ko.observable(); this.TargetDBName = ko.observable(); if (data) this.fromJS(data); }; $.extend(BemsWebApplication.BemsConfigDataViewModel.prototype, { toJS: function () { return { SiteId: this.SiteId(), LoadDBIP: this.LoadDBIP(), LoadDBUserID: this.LoadDBUserID(), LoadDBUserPW: this.LoadDBUserPW(), LoadDBName: this.LoadDBName(), TargetDBIP: this.TargetDBIP(), TargetDBUserID: this.TargetDBUserID(), TargetDBUserPW: this.TargetDBUserPW(), TargetDBName: this.TargetDBName() }; }, fromJS: function (data) { if (data) { this.SiteId(data.SiteId); this.LoadDBIP(data.LoadDBIP); this.LoadDBUserID(data.LoadDBUserID); this.LoadDBUserPW(data.LoadDBUserPW); this.LoadDBName(data.LoadDBName); this.TargetDBIP(data.TargetDBIP); this.TargetDBUserID(data.TargetDBUserID); this.TargetDBUserPW(data.TargetDBUserPW); this.TargetDBName(data.TargetDBName); } } }); })();