Пример #1
0
 protected virtual IEnumerable Cancel(PXAdapter adapter)
 {
     TranslationReleaseList.Cache.Clear();
     TimeStamp = null;
     PXLongOperation.ClearStatus(this.UID);
     return(adapter.Get());
 }
Пример #2
0
        public virtual IEnumerable delete(PXAdapter adapter)
        {
            GLVoucherBatch batch = VoucherBatches.Current;

            if (batch == null)
            {
                throw new PXException(Messages.NoBatchesForDelete);
            }
            if (VoucherBatches.Ask(PXMessages.LocalizeFormatNoPrefixNLA(Messages.BatchDeleteConfirmation, batch.VoucherBatchNbr), MessageButtons.OKCancel) == WebDialogResult.OK)
            {
                if (batch.Released == true)
                {
                    throw new PXException(Messages.BatchDeleteReleased);
                }
                List <GLVoucherBatch> fullList = new List <GLVoucherBatch>();
                foreach (GLVoucherBatch voucherBatch in VoucherBatches.Select())                //create list to show all records during processing
                {
                    fullList.Add(voucherBatch);
                }
                PXLongOperation.ClearStatus(this.UID);
                PXLongOperation.StartOperation(this, delegate() { DeleteBatch(batch, fullList.ToArray <object>()); });
                VoucherBatches.View.RequestRefresh();
            }
            return(adapter.Get());
        }
Пример #3
0
        protected virtual System.Collections.IEnumerable Next(PXAdapter a)
        {
            PXLongOperation.ClearStatus(this.UID);
            CuryRateFilter current = (CuryRateFilter)Filter.Current;
            PXSelectBase <CurrencyRate> currentSelectStatement;

            if (current.ToCurrency != null)
            {
                CurrencyRate rate;
                if (current.EffDate != null)
                {
                    currentSelectStatement = new PXSelectReadonly <CurrencyRate, Where <CurrencyRate.toCuryID, Equal <Required <CurrencyRate.toCuryID> >,
                                                                                        And <CurrencyRate.curyEffDate, Greater <Required <CurrencyRate.curyEffDate> > > >,
                                                                   OrderBy <Asc <CurrencyRate.curyEffDate> > >(this);
                    rate = (CurrencyRate)currentSelectStatement.View.SelectSingle(current.ToCurrency, current.EffDate);
                }
                else
                {
                    currentSelectStatement = new PXSelectReadonly <CurrencyRate, Where <CurrencyRate.toCuryID, Equal <Required <CurrencyRate.toCuryID> > >,
                                                                   OrderBy <Asc <CurrencyRate.curyEffDate> > >(this);
                    rate = (CurrencyRate)currentSelectStatement.View.SelectSingle(current.ToCurrency);
                }
                if (rate != null)
                {
                    current              = (CuryRateFilter)Filter.Cache.CreateCopy(Filter.Current);
                    current.ToCurrency   = rate.ToCuryID;
                    current.EffDate      = rate.CuryEffDate;
                    current              = Filter.Update(current);
                    Filter.Cache.IsDirty = false;
                }
            }
            yield return(current);
        }
Пример #4
0
        public virtual IEnumerable release(PXAdapter adapter)
        {
            PXCache cache = Caches[typeof(GLVoucherBatch)];
            List <GLVoucherBatch> list = new List <GLVoucherBatch>();

            foreach (GLVoucherBatch batch in VoucherBatches.Select())
            {
                if (batch.Released != true && batch.Selected == true)
                {
                    //cache.Update(batch);
                    list.Add(batch);
                }
            }
            if (list.Count == 0)
            {
                throw new PXException(Messages.NoBatchesIsSelectedForRelease);
            }
            //Save.Press();
            if (list.Count > 0)
            {
                PXLongOperation.ClearStatus(this.UID);
                PXLongOperation.StartOperation(this, delegate() { ReleaseBatch(list); });
                TimeSpan        timespan;
                Exception       ex;
                PXLongRunStatus status = PXLongOperation.GetStatus(this.UID, out timespan, out ex);
                DisableOnProcessing(status);
                VoucherBatches.View.RequestRefresh();
            }
            return(adapter.Get());
        }
 protected virtual IEnumerable Cancel(PXAdapter adapter)
 {
     CAReconRecords.Cache.Clear();
     Filter.Cache.Clear();
     TimeStamp = null;
     PXLongOperation.ClearStatus(this.UID);
     return(adapter.Get());
 }
Пример #6
0
        protected virtual void Filter_RowUpdated(PXCache sender, PXRowUpdatedEventArgs e)
        {
            PXLongRunStatus status = GetLongOperationStatus();

            if (status != PXLongRunStatus.InProcess)
            {
                PXLongOperation.ClearStatus(this.UID);
                VoucherBatches.Cache.Clear();
            }
        }
Пример #7
0
        protected virtual IEnumerable Cancel(PXAdapter adapter)
        {
            CATranListRecords.Cache.Clear();
            CATranListRecords.Cache.ClearQueryCacheObsolete();
            Filter.Cache.Clear();
            Caches[typeof(CADailySummary)].Clear();
            TimeStamp = null;

            PXLongOperation.ClearStatus(this.UID);
            return(adapter.Get());
        }
Пример #8
0
        public virtual IEnumerable release(PXAdapter adapter)
        {
            PXCache cache = Caches[typeof(GLVoucherBatch)];
            List <GLVoucherBatch> list = new List <GLVoucherBatch>();

            foreach (GLVoucherBatch batch in VoucherBatches.Select())
            {
                if (batch.Released != true && batch.Selected == true)
                {
                    list.Add(batch);
                }
            }
            if (list.Count == 0)
            {
                throw new PXException(Messages.NoBatchesIsSelectedForRelease);
            }
            if (list.Count > 0)
            {
                PXLongOperation.ClearStatus(this.UID);
                PXLongOperation.StartOperation(this, delegate() { ReleaseBatch(list); });
                VoucherBatches.View.RequestRefresh();
            }
            return(adapter.Get());
        }
Пример #9
0
 protected virtual IEnumerable customCancel(PXAdapter adapter)
 {
     PXLongOperation.ClearStatus(this.UID);
     Cancel.Press();
     return(adapter.Get());
 }