673017ad1dc7fe81e36b568f1159b25eb61c5d79.svn-base 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. (function () {
  2. BemsWebApplication.BemsFloorStatusViewModel = function (data) {
  3. this.SiteId = ko.observable();
  4. this.FloorId = ko.observable();
  5. this.FloorName = ko.observable();
  6. this.ImageFileId = ko.observable();
  7. this.Xvalue = ko.observable();
  8. this.Yvalue = ko.observable();
  9. this.ZoneId = ko.observable();
  10. this.ServiceTypeId = ko.observable();
  11. this.FacilityTypeId = ko.observable();
  12. this.FacilityCode = ko.observable();
  13. this.PropertyId = ko.observable();
  14. this.FacilityName = ko.observable();
  15. if (data)
  16. this.fromJS(data);
  17. };
  18. $.extend(BemsWebApplication.BemsFloorStatusViewModel.prototype, {
  19. toJS: function () {
  20. return {
  21. SiteId: this.SiteId(),
  22. FloorId: this.FloorId(),
  23. FloorName: this.FloorName(),
  24. ImageFileId: this.ImageFileId(),
  25. Xvalue: this.Xvalue(),
  26. Yvalue: this.Yvalue(),
  27. ZoneId: this.ZoneId(),
  28. ServiceTypeId: this.ServiceTypeId(),
  29. FacilityTypeId: this.FacilityTypeId(),
  30. FacilityCode: this.FacilityCode(),
  31. PropertyId: this.PropertyId(),
  32. FacilityName: this.FacilityName(),
  33. };
  34. },
  35. fromJS: function (data) {
  36. if (data) {
  37. this.SiteId(data.SiteId);
  38. this.FloorId(data.FloorId);
  39. this.FloorName(data.FloorName);
  40. this.ImageFileId(data.ImageFileId);
  41. this.Xvalue(data.Xvalue);
  42. this.Yvalue(data.Yvalue);
  43. this.ZoneId(data.ZoneId);
  44. this.ServiceTypeId(data.ServiceTypeId);
  45. this.FacilityTypeId(data.FacilityTypeId);
  46. this.FacilityCode(data.FacilityCode);
  47. this.PropertyId(data.PropertyId);
  48. this.FacilityName(data.FacilityName);
  49. }
  50. }
  51. });
  52. })();