コード例 #1
0
        public static ICarrierService CreateCarrierService(PXGraph graph, string carrierID)
        {
            if (string.IsNullOrEmpty(carrierID))
            {
                throw new ArgumentNullException();
            }

            ICarrierService service = null;
            Carrier         carrier = PXSelect <Carrier, Where <Carrier.carrierID, Equal <Required <Carrier.carrierID> > > > .Select(graph, carrierID);

            if (carrier != null && carrier.IsExternal == true && !string.IsNullOrEmpty(carrier.CarrierPluginID))
            {
                service        = CarrierPluginMaint.CreateCarrierService(graph, carrier.CarrierPluginID);
                service.Method = carrier.PluginMethod;
            }

            return(service);
        }
コード例 #2
0
        public static ICarrierService CreateCarrierService(PXGraph graph, string carrierID)
        {
            if (string.IsNullOrEmpty(carrierID))
            {
                throw new ArgumentNullException();
            }

            ICarrierService service = null;
            Carrier         carrier = CS.Carrier.PK.Find(graph, carrierID);

            if (carrier != null && carrier.IsExternal == true && !string.IsNullOrEmpty(carrier.CarrierPluginID))
            {
                service        = CarrierPluginMaint.CreateCarrierService(graph, carrier.CarrierPluginID);
                service.Method = carrier.PluginMethod;
            }

            return(service);
        }
コード例 #3
0
        protected virtual IEnumerable GetRecords()
        {
            PXCache cache = this._Graph.Caches[typeof(Carrier)];
            Carrier row   = cache.Current as Carrier;

            if (row != null && row.IsExternal == true && !string.IsNullOrEmpty(row.CarrierPluginID))
            {
                ICarrierService cs = CarrierPluginMaint.CreateCarrierService(this._Graph, row.CarrierPluginID);

                foreach (CarrierMethod cm in cs.AvailableMethods)
                {
                    CarrierPluginMethod cpm = new CarrierPluginMethod();
                    cpm.Code        = cm.Code;
                    cpm.Description = cm.Description;

                    yield return(cpm);
                }
            }
        }