//=================================================================================== private void validateTransferPurchaseReceiveReference(IOrderDomainService orderDomainService) { if (this.ReceiveType.HasValue && this.ReceiveType.Value == ReceiveTypes.TransferPurchase) { var finalApprovedPrurchaseTransferOrders = orderDomainService.GetBuyerFinalApprovedPurchaseTransferOrders(this.FuelReport.VesselInCompany.CompanyId); var receiveRefCount = finalApprovedPrurchaseTransferOrders.Count( o => o.Id == this.ReceiveReference.ReferenceId && this.ReceiveReference.ReferenceType == ReferenceType.Order); if (receiveRefCount != 1) throw new BusinessRuleException("BR_FR 16_2", string.Format("BR_FR 16 : Transfer-Purchase Receive Reference for '{0}' is invalid.", this.Good.Code)); //throw new BusinessRuleException("BR_FR 16_2", "BR_FR 16 - چنانچه نوع آن خرید انتقالی می باشد مرجع آن سفارش خرید انتقالی تائید نهایی شده باشد"); } }