(function () { BemsWebApplication.FmsFacilityOperationReportViewModel = function (data) { this.SiteId = ko.observable(); this.FacilityOperationReportId = ko.observable(); this.Name = ko.observable(); this.Contents = ko.observable(); this.RegisterUserId = ko.observable(); this.AddDate = ko.observable(); if (data) this.fromJS(data); }; $.extend(BemsWebApplication.FmsFacilityOperationReportViewModel.prototype, { toJS: function () { return { SiteId: this.SiteId(), FacilityOperationReportId: this.FacilityOperationReportId(), Name: this.Name(), Contents: this.Contents(), RegisterUserId: this.RegisterUserId(), AddDate: this.AddDate(), }; }, fromJS: function (data) { if (data) { this.SiteId(data.SiteId); this.FacilityOperationReportId(data.FacilityOperationReportId); this.Name(data.Name); this.Contents(data.Contents); this.RegisterUserId(data.RegisterUserId); this.AddDate(data.AddDate); } } }); })();