(function () { BemsWebApplication.CmPatrolPosViewModel = function (data) { this.SiteId = ko.observable(); this.BuildingId = ko.observable(); this.FloorId = ko.observable(); this.PosId = ko.observable(); this.Name = ko.observable(); this.PosDesc = ko.observable(); this.TagId = ko.observable(); if (data) this.fromJS(data); }; $.extend(BemsWebApplication.CmPatrolPosViewModel.prototype, { toJS: function () { return { SiteId: this.SiteId(), BuildingId: this.BuildingId(), FloorId: this.FloorId(), PosId: this.PosId(), Name: this.Name(), PosDesc: this.PosDesc(), TagId: this.TagId(), }; }, fromJS: function (data) { if (data) { this.SiteId(data.SiteId); this.BuildingId(data.BuildingId); this.FloorId(data.FloorId); this.PosId(data.PosId); this.Name(data.Name); this.PosDesc(data.PosDesc); this.TagId(data.TagId); } } }); })();