コード例 #1
0
        public virtual IEnumerable ValidateAddresses(PXAdapter adapter)
        {
            foreach (RQRequest current in adapter.Get <RQRequest>())
            {
                if (current != null)
                {
                    bool needSave = false;
                    Save.Press();
                    PORemitAddress address = this.Remit_Address.Select();
                    if (address != null && address.IsDefaultAddress == false && address.IsValidated == false)
                    {
                        if (PXAddressValidator.Validate <PORemitAddress>(this, address, true))
                        {
                            needSave = true;
                        }
                    }

                    if (needSave == true)
                    {
                        this.Save.Press();
                    }
                }
                yield return(current);
            }
        }
コード例 #2
0
 public virtual IEnumerable ValidateAddresses(PXAdapter adapter)
 {
     if (Buildings.Current != null)
     {
         Address address = Address.Current;
         if (address != null && address.IsValidated == false)
         {
             PXAddressValidator.Validate(this, address, true);
         }
     }
     return(adapter.Get());
 }
コード例 #3
0
        public virtual IEnumerable ValidateAddresses(PXAdapter adapter)
        {
            INSite inSite = this.site.Current;

            if (inSite != null)
            {
                Address address = this.Address.Current;
                if (address != null && address.IsValidated == false)
                {
                    PXAddressValidator.Validate <Address>(this, address, true);
                }
            }
            return(adapter.Get());
        }
コード例 #4
0
 public virtual IEnumerable ValidateAddress(PXAdapter adapter)
 {
     foreach (FSBranchLocation current in adapter.Get <FSBranchLocation>())
     {
         if (current != null)
         {
             FSAddress address = this.BranchLocation_Address.Select();
             if (address != null && address.IsDefaultAddress == false && address.IsValidated == false)
             {
                 PXAddressValidator.Validate <FSAddress>(this, address, true);
             }
         }
         yield return(current);
     }
 }
コード例 #5
0
        public virtual IEnumerable ValidateAddresses(PXAdapter adapter)
        {
            INSite inSite = this.site.Current;

            if (inSite != null)
            {
                bool needSave = false;
                Save.Press();
                Address address = this.Address.Current;
                if (address != null && address.IsValidated == false)
                {
                    PXAddressValidator.Validate <Address>(this, address, true);
                    needSave = true;
                }
                if (needSave == true)
                {
                    this.Save.Press();
                }
            }
            return(adapter.Get());
        }
コード例 #6
0
        public virtual void ValidateAddresses()
        {
            var row = BAccount.Current;

            if (row == null)
            {
                return;
            }

            var address = row.DefAddressID.With(_ => (Address)PXSelect <Address,
                                                                        Where <Address.addressID, Equal <Required <Address.addressID> > > > .
                                                Select(this, _.Value));

            if (address != null && address.IsValidated != true)
            {
                PXAddressValidator.Validate <Address>(this, address, true);
            }

            var location = (Location)PXSelect <Location,
                                               Where <Location.locationID, Equal <Required <Location.locationID> > > > .
                           Select(this, row.DefLocationID);

            if (location == null || location.DefAddressID == null)
            {
                return;
            }

            var locationAddress = (Address)PXSelect <Address,
                                                     Where <Address.addressID, Equal <Required <Address.addressID> > > > .
                                  Select(this, location.DefAddressID);

            if (locationAddress != null && locationAddress.IsValidated != true)
            {
                PXAddressValidator.Validate <Address>(this, locationAddress, true);
            }
        }