a3380d9142079d317bf6a28be15732ffcdad83f9.svn-base 724 B

12345678910111213141516171819202122232425262728
  1. 
  2. (function () {
  3. Partials.CmBuildingViewModel = function (data) {
  4. this.SiteId = ko.observable();
  5. this.BuildingId = ko.observable();
  6. this.Name = ko.observable();
  7. if (data)
  8. this.fromJS(data);
  9. };
  10. $.extend(Partials.CmBuildingViewModel.prototype, {
  11. toJS: function () {
  12. return {
  13. SiteId: this.SiteId(),
  14. BuildingId: this.BuildingId(),
  15. Name: this.Name()
  16. };
  17. },
  18. fromJS: function (data) {
  19. if (data) {
  20. this.SiteId(data.SiteId);
  21. this.BuildingId(data.BuildingId);
  22. this.Name(data.Name);
  23. }
  24. }
  25. });
  26. })();