12345678910111213141516171819202122232425262728 |
-
- (function () {
- Partials.CmBuildingViewModel = function (data) {
- this.SiteId = ko.observable();
- this.BuildingId = ko.observable();
- this.Name = ko.observable();
- if (data)
- this.fromJS(data);
- };
- $.extend(Partials.CmBuildingViewModel.prototype, {
- toJS: function () {
- return {
- SiteId: this.SiteId(),
- BuildingId: this.BuildingId(),
- Name: this.Name()
- };
- },
- fromJS: function (data) {
- if (data) {
- this.SiteId(data.SiteId);
- this.BuildingId(data.BuildingId);
- this.Name(data.Name);
- }
- }
- });
- })();
|