e4cec05784750bc952354687588d37db64933275.svn-base 3.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. 
  2. (function () {
  3. BemsWebApplication.FmsEquipmentExViewModel = function (data) {
  4. this.SiteId = ko.observable();
  5. this.EquipmentId = ko.observable();
  6. this.Name = ko.observable();
  7. this.EquipmentTypeId = ko.observable();
  8. this.WarehouseId = ko.observable();
  9. this.Unit = ko.observable();
  10. this.Standard = ko.observable();
  11. this.AddDate = ko.observable();
  12. this.UpdateDate = ko.observable();
  13. this.RegisterUserId = ko.observable();
  14. this.SupplierName = ko.observable();
  15. this.SupplierPhoneNo = ko.observable();
  16. this.EquipmentCodeTypeName = ko.observable();
  17. this.TotalStockCount = ko.observable();
  18. this.CurrentStockCount = ko.observable();
  19. this.StoredCount = ko.observable();
  20. this.CurrentRentCount = ko.observable();
  21. this.CurrentStoredCount = ko.observable();
  22. this.CurrentReturnCount = ko.observable();
  23. this.CurrentLossCount = ko.observable();
  24. this.ImageFileId = ko.observable();
  25. if (data)
  26. this.fromJS(data);
  27. };
  28. $.extend(BemsWebApplication.FmsEquipmentExViewModel.prototype, {
  29. toJS: function () {
  30. return {
  31. SiteId: this.SiteId(),
  32. Name: this.Name(),
  33. EquipmentId: this.EquipmentId(),
  34. EquipmentTypeId: this.EquipmentTypeId(),
  35. WarehouseId: this.WarehouseId(),
  36. Unit: this.Unit(),
  37. Standard: this.Standard(),
  38. AddDate: this.AddDate(),
  39. UpdateDate: this.UpdateDate(),
  40. RegisterUserId: this.RegisterUserId(),
  41. SupplierName: this.SupplierName(),
  42. SupplierPhoneNo: this.SupplierPhoneNo(),
  43. EquipmentCodeTypeName: this.EquipmentCodeTypeName(),
  44. TotalStockCount: this.TotalStockCount(),
  45. CurrentStockCount: this.CurrentStockCount(),
  46. StoredCount: this.StoredCount(),
  47. CurrentRentCount: this.CurrentRentCount(),
  48. CurrentStoredCount: this.CurrentStoredCount(),
  49. CurrentReturnCount: this.CurrentReturnCount(),
  50. CurrentLossCount: this.CurrentLossCount(),
  51. ImageFileId: this.ImageFileId()
  52. };
  53. },
  54. fromJS: function (data) {
  55. if (data) {
  56. this.SiteId(data.SiteId);
  57. this.Name(data.Name);
  58. this.EquipmentId(data.EquipmentId);
  59. this.EquipmentTypeId(data.EquipmentTypeId);
  60. this.WarehouseId(data.WarehouseId);
  61. this.Unit(data.Unit);
  62. this.Standard(data.Standard);
  63. this.AddDate(data.AddDate);
  64. this.UpdateDate(data.UpdateDate);
  65. this.RegisterUserId(data.RegisterUserId);
  66. this.SupplierName(data.SupplierName);
  67. this.SupplierPhoneNo(data.SupplierPhoneNo);
  68. this.EquipmentCodeTypeName(data.EquipmentCodeTypeName);
  69. this.TotalStockCount(data.TotalStockCount);
  70. this.CurrentStockCount(data.CurrentStockCount);
  71. this.StoredCount(data.StoredCount);
  72. this.CurrentRentCount(data.CurrentRentCount);
  73. this.CurrentStoredCount(data.CurrentStoredCount);
  74. this.CurrentReturnCount(data.CurrentReturnCount);
  75. this.CurrentLossCount(data.CurrentLossCount);
  76. this.ImageFileId(data.ImageFileId);
  77. }
  78. }
  79. });
  80. })();