(function () { BemsWebApplication.CmPartnerTypeViewModel = function (data) { this.PartnerTypeId = ko.observable(); this.Name = ko.observable(); this.IsUse = ko.observable(); if (data) this.fromJS(data); }; $.extend(BemsWebApplication.CmPartnerTypeViewModel.prototype, { toJS: function () { return { PartnerTypeId: this.PartnerTypeId(), Name: this.Name(), IsUse: this.IsUse(), }; }, fromJS: function (data) { if (data) { this.PartnerTypeId(data.PartnerTypeId); this.Name(data.Name); this.IsUse(data.IsUse); } } }); })();