(function() { BemsWebApplication.FmsWorkDailyRecordPreventionViewModel = function(data) { this.SiteId = ko.observable(); this.WorkDate = ko.observable(); this.TemplateId = ko.observable(); this.DailyRecordId = ko.observable(); this.BusinessFieldId = ko.observable(); this.PreventionId = ko.observable(); this.ShopNo = ko.observable(); this.ShopName = ko.observable(); this.WorkTime = ko.observable(); this.PreventionContent = ko.observable(); this.SignificantContent = ko.observable(); if(data) this.fromJS(data); }; $.extend(BemsWebApplication.FmsWorkDailyRecordPreventionViewModel.prototype, { toJS: function() { return { SiteId: this.SiteId(), WorkDate: this.WorkDate(), TemplateId: this.TemplateId(), DailyRecordId: this.DailyRecordId(), BusinessFieldId: this.BusinessFieldId(), PreventionId: this.PreventionId(), ShopNo: this.ShopNo(), ShopName: this.ShopName(), WorkTime: this.WorkTime(), PreventionContent: this.PreventionContent(), SignificantContent: this.SignificantContent(), }; }, fromJS: function(data) { if(data) { this.SiteId(data.SiteId); this.WorkDate(data.WorkDate); this.TemplateId(data.TemplateId); this.DailyRecordId(data.DailyRecordId); this.BusinessFieldId(data.BusinessFieldId); this.PreventionId(data.PreventionId); this.ShopNo(data.ShopNo); this.ShopName(data.ShopName); this.WorkTime(data.WorkTime); this.PreventionContent(data.PreventionContent); this.SignificantContent(data.SignificantContent); } } }); })();