(function() { BemsWebApplication.FmsLicenseViewModel = function(data) { this.SiteId = ko.observable(); this.LicenseId = ko.observable(); this.Name = ko.observable(); this.IssuingOffice = ko.observable(); this.BusinessFieldId = ko.observable(); this.EducationalInstitute = ko.observable(); this.Note = ko.observable(); this.IsUse = ko.observable(); if(data) this.fromJS(data); }; $.extend(BemsWebApplication.FmsLicenseViewModel.prototype, { toJS: function() { return { SiteId: this.SiteId(), LicenseId: this.LicenseId(), Name: this.Name(), IssuingOffice: this.IssuingOffice(), BusinessFieldId: this.BusinessFieldId(), EducationalInstitute: this.EducationalInstitute(), Note: this.Note(), IsUse: this.IsUse(), }; }, fromJS: function(data) { if(data) { this.SiteId(data.SiteId); this.LicenseId(data.LicenseId); this.Name(data.Name); this.IssuingOffice(data.IssuingOffice); this.BusinessFieldId(data.BusinessFieldId); this.EducationalInstitute(data.EducationalInstitute); this.Note(data.Note); this.IsUse(data.IsUse); } } }); })();