Exemplo n.º 1
0
        public Tuple<bool, string> isDeliveryValid(titizOto.Models.titizOtoEntities db)
        {
            HelperSite.Shared.addressShared ads = new HelperSite.Shared.addressShared(db);

            // Unregistered User
            if (!cartItem.isRegisteredUser)
            {
                // Validate Track Info, name,surname,email
                var validateTrackInfo = ads.isValidTrackData(this.trackInfo);

                if (!validateTrackInfo.Item1)
                {
                    return validateTrackInfo;
                }

                // Validate Address
                var addressValidation = ads.isValidAddress(this.deliveryAddress);

                if (!addressValidation.Item1)
                {
                    return addressValidation;
                }

            }
            else  // Registered User
            {
                var addressItem = ads.getAddressById(this.deliveryAddressId);

                if (addressItem == null || addressItem.statu == false)
                {
                    return new Tuple<bool, string>(false, lang.checkoutDeliveryRequired);
                }

            }

            return new Tuple<bool, string>(true, null);
        }
Exemplo n.º 2
0
        public Tuple<bool, string> isBillingValid(titizOto.Models.titizOtoEntities db)
        {
            HelperSite.Shared.addressShared ads = new HelperSite.Shared.addressShared(db);

            // Unregistered User
            if (!cartItem.isRegisteredUser)
            {
                // Validate Address
                var addressValidation = ads.isValidAddress(this.billingAddress);

                if (!addressValidation.Item1)
                {
                    return addressValidation;
                }
            }
            else
            {
                var addressItem = ads.getAddressById(this.billingAddressId);

                if (addressItem == null || addressItem.statu == false)
                {
                    return new Tuple<bool, string>(false, lang.checkoutDeliveryRequired);
                }

            }

            return new Tuple<bool, string>(true, null);
        }