(function() { BemsWebApplication.CmHolidayWeekendViewModel = function(data) { this.SiteId = ko.observable(); this.Saturday = ko.observable(); this.Sunday = ko.observable(); this.IsUse = ko.observable(); if(data) this.fromJS(data); }; $.extend(BemsWebApplication.CmHolidayWeekendViewModel.prototype, { toJS: function() { return { SiteId: this.SiteId(), Saturday: this.Saturday(), Sunday: this.Sunday(), IsUse: this.IsUse(), }; }, fromJS: function(data) { if(data) { this.SiteId(data.SiteId); this.Saturday(data.Saturday); this.Sunday(data.Sunday); this.IsUse(data.IsUse); } } }); })();