(function () { BemsWebApplication.FmsDailyStoredReleaseStatusViewViewModel = function (data) { this.SiteId = ko.observable(); this.BusinessFieldId = ko.observable(); this.MaterialId = ko.observable(); this.MaterialCode = ko.observable(); this.Name = ko.observable(); this.Unit = ko.observable(); this.StoredDate = ko.observable(); this.MaterialStoredId = ko.observable(); this.PurchaseOrderId = ko.observable(); this.UnitCost = ko.observable(); this.StockCount = ko.observable(); this.StoredCount = ko.observable(); this.IsApproval = ko.observable(); this.IsUse = ko.observable(); this.ReleaseDate = ko.observable(); this.ReleaseTypeId = ko.observable(); this.ReleaseCount = ko.observable(); this.ReleaseTotalCost = ko.observable(); this.StockRemainCount = ko.observable(); this.StockRemainAmount = ko.observable(); this.WarehouseId = ko.observable(); this.WarehouseName = ko.observable(); this.LocationInWarehouse = ko.observable(); this.ReasonableStockCount = ko.observable(); if (data) this.fromJS(data); }; $.extend(BemsWebApplication.FmsDailyStoredReleaseStatusViewViewModel.prototype, { toJS: function () { return { SiteId: this.SiteId(), BusinessFieldId: this.BusinessFieldId(), MaterialId: this.MaterialId(), MaterialCode: this.MaterialCode(), Name: this.Name(), Unit: this.Unit(), StoredDate: this.StoredDate(), MaterialStoredId: this.MaterialStoredId(), PurchaseOrderId: this.PurchaseOrderId(), UnitCost: this.UnitCost(), StockCount: this.StockCount(), StoredCount: this.StoredCount(), IsApproval: this.IsApproval(), IsUse: this.IsUse(), ReleaseDate: this.ReleaseDate(), ReleaseTypeId: this.ReleaseTypeId(), ReleaseCount: this.ReleaseCount(), ReleaseTotalCost: this.ReleaseTotalCost(), StockRemainCount: this.StockRemainCount(), StockRemainAmount: this.StockRemainAmount(), WarehouseId: this.WarehouseId(), WarehouseName: this.WarehouseName(), LocationInWarehouse: this.LocationInWarehouse(), ReasonableStockCount: this.ReasonableStockCount() }; }, fromJS: function (data) { if (data) { this.SiteId(data.SiteId); this.BusinessFieldId(data.BusinessFieldId); this.MaterialId(data.MaterialId); this.MaterialCode(data.MaterialCode); this.Name(data.Name); this.Unit(data.Unit); this.StoredDate(data.StoredDate); this.MaterialStoredId(data.MaterialStoredId); this.PurchaseOrderId(data.PurchaseOrderId); this.UnitCost(data.UnitCost); this.StockCount(data.StockCount); this.StoredCount(data.StoredCount); this.IsApproval(data.IsApproval); this.IsUse(data.IsUse); this.ReleaseDate(data.ReleaseDate); this.ReleaseTypeId(data.ReleaseTypeId); this.ReleaseCount(data.ReleaseCount); this.ReleaseTotalCost(data.ReleaseTotalCost); this.StockRemainCount(data.StockRemainCount); this.StockRemainAmount(data.StockRemainAmount); this.WarehouseId(data.WarehouseId); this.WarehouseName(data.WarehouseName); this.LocationInWarehouse(data.LocationInWarehouse); this.ReasonableStockCount(data.ReasonableStockCount); } } }); })();