public StockInformation(StockInformation stockInformation) { Item = stockInformation.Item; Unit = stockInformation.Unit; Activity = stockInformation.Activity; Manufacturer = stockInformation.Manufacturer; PhysicalStore = stockInformation.PhysicalStore; ExpiryDate = stockInformation.ExpiryDate; Quantity = stockInformation.Quantity; }
public StockInformationViewModel(StockInformation stockInformation) { _stockInformation = stockInformation; }
public ICollection<StockInformation> GetStockInformationByOrderID(int orderId) { var balance = new Balance(); var stockInformationTable = balance.GetBalanceByOrder(orderId, CurrentContext.UserId); ICollection<StockInformation> stockInformations = new Collection<StockInformation>(); foreach (DataRowView stockInformationRow in stockInformationTable) { var itemID = Convert.ToInt32(stockInformationRow["ItemID"]); var unitID = Convert.ToInt32(stockInformationRow["UnitID"]); var stockInformation = new StockInformation { Item = _itemRepository.FindSingle(Convert.ToInt32(itemID)), Unit = _unitOfIssueRepository.FindSingle(Convert.ToInt32(unitID)), Manufacturer = DBNull.Value != stockInformationRow["ManufacturerId"] ? _manufacturerRepository.FindSingle( Convert.ToInt32(stockInformationRow["ManufacturerId"])) : null, Activity = _activityRepository.FindSingle( Convert.ToInt32(stockInformationRow["ActivityID"]), Convert.ToBoolean(stockInformationRow["DeliveryNote"])), ExpiryDate = DBNull.Value != stockInformationRow["ExpiryDate"] ? Convert.ToDateTime(stockInformationRow["ExpiryDate"]) : (DateTime?) null, PhysicalStore = DBNull.Value != stockInformationRow["PhysicalStoreID"] ? _physicalStoreRepository.FindSingle( Convert.ToInt32(stockInformationRow["PhysicalStoreID"])) : null, Quantity = Convert.ToDecimal(stockInformationRow["Usable"]) }; stockInformations.Add(stockInformation); } return stockInformations; }