public ICollection<ApprovedDetail> GetApprovedDetail(int orderId) { ICollection<ApprovedDetail> stockInformations = new Collection<ApprovedDetail>(); var balance = new Balance(); var approvedInformationTable = balance.GetApprovedByOrderID(orderId); foreach (DataRowView approvedInformationRow in approvedInformationTable) { var itemID = Convert.ToInt32(approvedInformationRow["ItemID"]); var unitID = Convert.ToInt32(approvedInformationRow["UnitID"]); var stockInformation = new ApprovedDetail { Item = _itemRepository.FindSingle(Convert.ToInt32(itemID)), Unit = _unitOfIssueRepository.FindSingle(Convert.ToInt32(unitID)), Manufacturer = DBNull.Value != approvedInformationRow["ManufacturerId"] ? _manufacturerRepository.FindSingle(Convert.ToInt32(approvedInformationRow["ManufacturerId"])) : null, ActivityGroup = _activityRepository.FindSingle(Convert.ToInt32(approvedInformationRow["ActivityID"]), Convert.ToBoolean(approvedInformationRow["IsDeliveryNote"])), ExpiryDate = DBNull.Value != approvedInformationRow["ExpiryDate"] ? Convert.ToDateTime(approvedInformationRow["ExpiryDate"]) : (DateTime?)null, physicalStore = DBNull.Value != approvedInformationRow["PhysicalStoreID"] ? _physicalStoreRepository.FindSingle(Convert.ToInt32(approvedInformationRow["PhysicalStoreID"])) : null, Quantity = Convert.ToDecimal(approvedInformationRow["ApprovedQuantity"]) }; stockInformations.Add(stockInformation); } return stockInformations; }
public ApprovedDetail(ApprovedDetail approvedDetail) { Item = approvedDetail.Item; Unit = approvedDetail.Unit; ActivityGroup = approvedDetail.ActivityGroup; Manufacturer = approvedDetail.Manufacturer; physicalStore = approvedDetail.physicalStore; ExpiryDate = approvedDetail.ExpiryDate; Quantity = approvedDetail.Quantity; }