Ejemplo n.º 1
0
        private bool IsSIValid(string SINumber, int CommoditySourceID)
        {
            //check allocation and gc for the same record
            var  fromGc   = _giftCertificateService.FindBySINumber(SINumber);
            bool fromRall =
                _receiptAllocationService.IsSINSource(BLL.CommoditySource.Constants.DONATION, SINumber);

            if (CommoditySourceID == BLL.CommoditySource.Constants.LOCALPURCHASE)
            {
                if
                (!((fromGc == null) && !(fromRall)))
                {
                    return(false);
                }
            }
            //just incase the user is bad
            bool fromRallt =
                _receiptAllocationService.IsSINSource(BLL.CommoditySource.Constants.LOCALPURCHASE, SINumber);

            if (CommoditySourceID == BLL.CommoditySource.Constants.DONATION)
            {
                //var mustBeInGift = _giftCertificateService.FindBySINumber(SINumber);
                if
                (fromRallt)
                {
                    //) && (mustBeInGift != null)))
                    return(false);
                }
            }
            return(true);
        }
Ejemplo n.º 2
0
        private bool IsSIValid(string SINumber, int CommoditySourceID)
        {
            //check allocation and gc for the same record
            var shippingInstruction = _shippingInstructionService.FindBy(t => t.Value == SINumber).FirstOrDefault();
            var fromGc = new GiftCertificate();

            if (shippingInstruction != null)
            {
                fromGc = _giftCertificateService.FindBySINumber(shippingInstruction.ShippingInstructionID);
            }
            bool fromRall =
                _receiptAllocationService.IsSINSource(CommoditySource.Constants.DONATION, SINumber);

            if (CommoditySourceID == CommoditySource.Constants.LOCALPURCHASE)
            {
                if
                (!((fromGc == null) && !(fromRall)))
                {
                    return(false);
                }
            }
            //just incase the user is bad
            bool fromRallt =
                _receiptAllocationService.IsSINSource(CommoditySource.Constants.LOCALPURCHASE, SINumber);

            if (CommoditySourceID == CommoditySource.Constants.DONATION)
            {
                //var mustBeInGift = _giftCertificateService.FindBySINumber(SINumber);
                if
                (fromRallt)
                {
                    //) && (mustBeInGift != null)))
                    return(false);
                }
            }
            return(true);
        }