//=================================================================================== private void validateInternalTransferReferenceValue(IOrderDomainService orderDomainService) { if (this.Transfer.HasValue && this.TransferType.Value == TransferTypes.InternalTransfer && !this.TransferReference.IsEmpty()) { var finalApprovedInternalTransferOrder = orderDomainService.GetFinalApprovedInternalTransferOrders(this.FuelReport.VesselInCompany.CompanyId); var transferRefCount = finalApprovedInternalTransferOrder.Count( o => o.Id == this.TransferReference.ReferenceId && this.TransferReference.ReferenceType == ReferenceType.Order); if (transferRefCount != 1) throw new BusinessRuleException("BR_FR29_2", string.Format("BR_FR19 : Internal Transfer Reference Value for '{0}' is invalid.", this.Good.Code)); //throw new BusinessRuleException("BR_FR29_2", "BR_FR19 - چنانچه فیلد انتقال مقداردهی گردیده است و نوع آن فروش انتقالی می باشد مرجع آن سفارش انتقال تائید نهایی شده می باشد"); } }
//=================================================================================== private void validateTrustReceiveReference(IOrderDomainService orderDomainService) { if (this.ReceiveType.HasValue && this.ReceiveType.Value == ReceiveTypes.Trust && !this.ReceiveReference.IsEmpty()) { var finalApprovedInternalTransferOrders = orderDomainService.GetFinalApprovedInternalTransferOrders(this.FuelReport.VesselInCompany.CompanyId); var receiveRefCount = finalApprovedInternalTransferOrders.Count( o => o.Id == this.ReceiveReference.ReferenceId && this.ReceiveReference.ReferenceType == ReferenceType.Order); if (receiveRefCount != 1) throw new BusinessRuleException("", string.Format("BR_FR31 : Trust Receive Reference for '{0}' is invalid.", this.Good.Code)); } }
//=================================================================================== private void validateInternalTransferReceiveReference(IOrderDomainService orderDomainService) { if (this.ReceiveType.HasValue && this.ReceiveType.Value == ReceiveTypes.InternalTransfer) { var finalApprovedInternalTransferOrders = orderDomainService.GetFinalApprovedInternalTransferOrders(this.FuelReport.VesselInCompany.CompanyId); var receiveRefCount = finalApprovedInternalTransferOrders.Count( o => o.Id == this.ReceiveReference.ReferenceId && this.ReceiveReference.ReferenceType == ReferenceType.Order); if (receiveRefCount != 1) throw new BusinessRuleException("BR_FR 31", string.Format("BR_FR31 : Internal-Transfer Receive Reference for '{0}' is invalid.", this.Good.Code)); //throw new BusinessRuleException("BR_FR 31", "BR_FR31 - چنانچه نوع دریافت انتقال داخلی می باشد مرجع آن که سفارش انتقال داخلی تائید نهایی شده می باشد مشخص شده باشد"); } }