public virtual IEnumerable viewVendorCatalogue(PXAdapter adapter)
        {
            if (VendorCatalogue.Current != null && VendorCatalogue.Current.InventoryID.HasValue)
            {
                POVendorCatalogueMaint graph    = PXGraph.CreateInstance <POVendorCatalogueMaint>();
                VendorLocation         baccount = PXSelect <VendorLocation,
                                                            Where <VendorLocation.bAccountID, Equal <Required <VendorLocation.bAccountID> >,
                                                                   And <VendorLocation.locationID, Equal <Required <VendorLocation.locationID> > > > >
                                                  .Select(graph, VendorCatalogue.Current.VendorID, VendorCatalogue.Current.VendorLocationID);

                if (baccount != null)
                {
                    graph.BAccount.Current = baccount;
                    throw new PXRedirectRequiredException(graph, true, "View Vendor Catalogue")
                          {
                              Mode = PXBaseRedirectException.WindowMode.NewWindow
                          };
                }
            }
            return(adapter.Get());
        }
Ejemplo n.º 2
0
        protected virtual IEnumerable Cancel(PXAdapter adapter)
        {
            VendorLocation vendor = this.BAccount.Current;

            if (vendor != null && adapter.Searches.Length == 2 && adapter.Searches[0] != null && vendor.AcctCD != null)
            {
                if (vendor.AcctCD.Trim() != adapter.Searches[0].ToString().Trim())
                {
                    PXResult <BAccountR, CRLocation> r =
                        (PXResult <BAccountR, CRLocation>) PXSelectJoin <BAccountR,
                                                                         InnerJoin <CRLocation, On <CRLocation.bAccountID, Equal <BAccountR.bAccountID>, And <CRLocation.locationID, Equal <BAccountR.defLocationID> > > >,
                                                                         Where <BAccountR.acctCD, Equal <Required <BAccountR.acctCD> > > >
                        .SelectWindowed(this, 0, 1, adapter.Searches[0]);

                    CRLocation location = r;
                    adapter.Searches[1] = location.LocationCD;
                }
            }

            foreach (VendorLocation i in (new PXCancel <VendorLocation>(this, "Cancel")).Press(adapter))
            {
                yield return(i);
            }
        }