//Add Data From Linked Tables for Display public void EditItemForDisplay(ReasonCodeItem reasonCodeItem) { ProductRepository productRepository = new ProductRepository(); Product product = new Product(); product = productRepository.GetProduct(reasonCodeItem.ProductId); if (product != null) { reasonCodeItem.ProductName = product.ProductName; } ReasonCodeTypeRepository reasonCodeTypeRepository = new ReasonCodeTypeRepository(); ReasonCodeType reasonCodeType = new ReasonCodeType(); reasonCodeType = reasonCodeTypeRepository.GetItem(reasonCodeItem.ReasonCodeTypeId); if (reasonCodeType != null) { reasonCodeItem.ReasonCodeTypeDescription = reasonCodeType.ReasonCodeTypeDescription; } ReasonCodeProductTypeDescriptionRepository reasonCodeProductTypeDescriptionRepository = new ReasonCodeProductTypeDescriptionRepository(); ReasonCodeProductTypeDescription reasonCodeProductTypeDescription = new ReasonCodeProductTypeDescription(); reasonCodeProductTypeDescription = reasonCodeProductTypeDescriptionRepository.GetItem( "en-GB", reasonCodeItem.ReasonCode, reasonCodeItem.ProductId, reasonCodeItem.ReasonCodeTypeId ); reasonCodeItem.ReasonCodeDescription = (reasonCodeProductTypeDescription != null) ? reasonCodeProductTypeDescription.ReasonCodeProductTypeDescription1 : String.Empty; ReasonCodeGroupRepository reasonCodeGroupRepository = new ReasonCodeGroupRepository(); ReasonCodeGroup reasonCodeGroup = new ReasonCodeGroup(); reasonCodeGroup = reasonCodeGroupRepository.GetGroup(reasonCodeItem.ReasonCodeGroupId); if (reasonCodeGroup != null) { reasonCodeItem.ReasonCodeGroupName = reasonCodeGroup.ReasonCodeGroupName; } }