(function() { BemsWebApplication.FmsWorkScheduleViewModel = function(data) { this.SiteId = ko.observable(); this.WorkScheduleId = ko.observable(); this.WorkTypeId = ko.observable(); this.BusinessFieldId = ko.observable(); this.Name = ko.observable(); this.CycleSize = ko.observable(); this.CycleUnitId = ko.observable(); this.HolidayWorkTypeId = ko.observable(); this.InspectionAgencyId = ko.observable(); this.WorkDueDate = ko.observable(); this.UpdateUserId = ko.observable(); this.IsUse = ko.observable(); this.IsAutoOrder = ko.observable(); this.Content = ko.observable(); if(data) this.fromJS(data); }; $.extend(BemsWebApplication.FmsWorkScheduleViewModel.prototype, { toJS: function() { return { SiteId: this.SiteId(), WorkScheduleId: this.WorkScheduleId(), WorkTypeId: this.WorkTypeId(), BusinessFieldId: this.BusinessFieldId(), Name: this.Name(), CycleSize: this.CycleSize(), CycleUnitId: this.CycleUnitId(), HolidayWorkTypeId: this.HolidayWorkTypeId(), InspectionAgencyId: this.InspectionAgencyId(), WorkDueDate: this.WorkDueDate(), UpdateUserId: this.UpdateUserId(), IsUse: this.IsUse(), IsAutoOrder: this.IsAutoOrder(), Content: this.Content() }; }, fromJS: function(data) { if(data) { this.SiteId(data.SiteId); this.WorkScheduleId(data.WorkScheduleId); this.WorkTypeId(data.WorkTypeId); this.BusinessFieldId(data.BusinessFieldId); this.Name(data.Name); this.CycleSize(data.CycleSize); this.CycleUnitId(data.CycleUnitId); this.HolidayWorkTypeId(data.HolidayWorkTypeId); this.InspectionAgencyId(data.InspectionAgencyId); this.WorkDueDate(data.WorkDueDate); this.UpdateUserId(data.UpdateUserId); this.IsUse(data.IsUse); this.IsAutoOrder(data.IsAutoOrder); this.Content(data.Content); } } }); })();