コード例 #1
0
        //===================================================================================
        private void validatePurchaseReceiveTypeReference(IOrderDomainService orderDomainService)
        {
            if (this.ReceiveType.HasValue &&
                this.ReceiveType.Value == ReceiveTypes.Purchase)
            {
                var finalApprovedPrurchaseOrders = orderDomainService.GetFinalApprovedPrurchaseOrders(this.FuelReport.VesselInCompany.CompanyId);

                var receiveRefCount = finalApprovedPrurchaseOrders.Count(
                    o => o.Id == this.ReceiveReference.ReferenceId && this.ReceiveReference.ReferenceType == ReferenceType.Order);

                if (receiveRefCount != 1)
                    throw new BusinessRuleException("BR_FR 16_1", string.Format("BR_FR 16 : Purchase Receive Type Reference for '{0}' is invlaid.", this.Good.Code));
                //throw new BusinessRuleException("BR_FR 16_1", "BR_FR 16 -چنانچه نوع دریافت خرید می باشد  مرجع آن سفارش خرید تائید نهایی شده باشد");
            }
        }