public virtual void _(Events.RowSelected <APAdjust> args) { if (args.Row is APAdjust adjustment && !PXLongOperation.Exists(Base.UID)) { UpdateAmountPaidAvailability(adjustment); } }
protected virtual void Schedule_RowSelected(PXCache cache, PXRowSelectedEventArgs e) { Schedule task = (Schedule)e.Row; if (task == null || PXLongOperation.Exists(UID)) { return; } if ((task.NoRunLimit ?? false) == false && task.RunCntr == task.RunLimit) { cache.RaiseExceptionHandling <Schedule.scheduleID>(e.Row, task.ScheduleID, new PXSetPropertyException(Messages.SheduleExecutionLimitExceeded, PXErrorLevel.RowError)); } else { if ((task.NoEndDate ?? false) == false && task.EndDate < Accessinfo.BusinessDate) { cache.RaiseExceptionHandling <Schedule.scheduleID>(e.Row, task.ScheduleID, new PXSetPropertyException(Messages.SheduleHasExpired, PXErrorLevel.RowError)); } else { if (task.NextRunDate > Accessinfo.BusinessDate) { cache.RaiseExceptionHandling <Schedule.scheduleID>(e.Row, task.ScheduleID, new PXSetPropertyException(Messages.SheduleNextExecutionDateExceeded, PXErrorLevel.RowWarning)); } } } }
private void CheckPrevOperation() { if (PXLongOperation.Exists(UID)) { throw new ApplicationException(GL.Messages.PrevOperationNotCompleteYet); } }
public virtual void _(Events.RowSelected <APAdjust> args) { var adjustment = args.Row; if (adjustment != null && !PXLongOperation.Exists(Base.UID)) { SetAmountToPayIfEmpty(adjustment); } }
protected virtual void CAEnqFilter_RowSelected(PXCache cache, PXRowSelectedEventArgs e) { CAEnqFilter filter = (CAEnqFilter)e.Row; if (filter == null) { return; } bool ShowSummaryNotChecked = filter.ShowSummary != true; bool CashAccountNeedReconcilation = (cashaccount.Current != null) && (bool)cashaccount.Current.Reconcile; if (cashaccount.Current != null && AddFilter.Current != null && AddFilter.Current.CashAccountID != filter.AccountID) { AddFilter.Cache.SetValueExt <AddTrxFilter.cashAccountID>(AddFilter.Current, cashaccount.Current.CashAccountCD); } AddDet.SetEnabled(filter.AccountID != null); PXCache tranCache = CATranListRecords.Cache; tranCache.AllowInsert = false; tranCache.AllowUpdate = (ShowSummaryNotChecked); tranCache.AllowDelete = (ShowSummaryNotChecked); PXUIFieldAttribute.SetVisible <CATran.selected>(tranCache, null, ShowSummaryNotChecked); PXUIFieldAttribute.SetVisible <CATran.hold>(tranCache, null, false); PXUIFieldAttribute.SetVisible <CATran.status>(tranCache, null, ShowSummaryNotChecked); PXUIFieldAttribute.SetVisible <CATran.origModule>(tranCache, null, ShowSummaryNotChecked); PXUIFieldAttribute.SetVisible <CATran.origRefNbr>(tranCache, null, ShowSummaryNotChecked); PXUIFieldAttribute.SetVisible <CATran.origTranType>(tranCache, null, ShowSummaryNotChecked); PXUIFieldAttribute.SetVisible <CATran.extRefNbr>(tranCache, null, ShowSummaryNotChecked); PXUIFieldAttribute.SetVisible <CATran.batchNbr>(tranCache, null, ShowSummaryNotChecked); PXUIFieldAttribute.SetVisible <CATran.finPeriodID>(tranCache, null, ShowSummaryNotChecked); PXUIFieldAttribute.SetVisible <CATran.tranDesc>(tranCache, null, ShowSummaryNotChecked); PXUIFieldAttribute.SetVisible <CATran.referenceName>(tranCache, null, ShowSummaryNotChecked); PXUIFieldAttribute.SetVisible <CATran.reconciled>(tranCache, null, ShowSummaryNotChecked && CashAccountNeedReconcilation); PXUIFieldAttribute.SetVisible <CATran.clearDate>(tranCache, null, ShowSummaryNotChecked && CashAccountNeedReconcilation); PXUIFieldAttribute.SetVisible <CATran.cleared>(tranCache, null, ShowSummaryNotChecked && CashAccountNeedReconcilation); PXUIFieldAttribute.SetVisible <CATran.dayDesc>(tranCache, null, !ShowSummaryNotChecked); PXUIFieldAttribute.SetVisible <CATranExt.dayDesc>(tranCache, null, !ShowSummaryNotChecked); PXUIFieldAttribute.SetVisible <CATranExt.depositNbr>(tranCache, null, ShowSummaryNotChecked); PXUIFieldAttribute.SetVisible <CATran.referenceID>(tranCache, null, ShowSummaryNotChecked); PXCache bAcctCache = this.Caches[typeof(BAccountR)]; PXUIFieldAttribute.SetVisible <BAccountR.acctName>(bAcctCache, null, ShowSummaryNotChecked); Clearence.SetEnabled(CashAccountNeedReconcilation); AddFilter.Cache.RaiseRowSelected(AddFilter.Current); bool operationExists = PXLongOperation.Exists(UID); Save.SetEnabled(!operationExists); Release.SetEnabled(!operationExists); Clearence.SetEnabled(!operationExists); }
protected override IEnumerable ProcessAll(PXAdapter adapter) { if (ConfirmationMessage != null && adapter.ExternalCall) { if (!PXLongOperation.Exists(_Graph.UID) && this.Ask(ConfirmationTitle, ConfirmationMessage, MessageButtons.YesNo) != WebDialogResult.Yes) { return(adapter.Get()); } } return(base.ProcessAll(adapter)); }
protected virtual void GLConsolSetup_RowSelected(PXCache sender, PXRowSelectedEventArgs e) { if (e.Row == null) return; if (!PXLongOperation.Exists(UID)) { var glConsolSetup = (GLConsolSetup)e.Row; CheckUnpostedBatchesNotExist(glConsolSetup); } }
public virtual IEnumerable release(PXAdapter adapter) { PXCache cache = Caches[typeof(CATransfer)]; CATransfer transfer = Transfer.Current; if (PXLongOperation.Exists(UID)) { throw new ApplicationException(GL.Messages.PrevOperationNotCompleteYet); } bool holdExpenses = false; foreach (PXResult <CATran, CAAdj> expense in TransferTran.Select()) { CAAdj expenseAdj = (CAAdj)expense; CATran expenseTran = (CATran)expense; if (expenseAdj != null && (expenseAdj.Hold == true || expenseAdj.Approved == false)) { holdExpenses = true; TransferTran.Cache.RaiseExceptionHandling <CATran.extRefNbr>(expenseTran, expenseTran.ExtRefNbr, new PXSetPropertyException(Messages.HoldExpense, PXErrorLevel.RowError)); } } if (holdExpenses) { throw new PXException(Messages.HoldExpenses, transfer.RefNbr); } Save.Press(); List <CARegister> list = new List <CARegister>(); CATran tran = PXSelect <CATran, Where <CATran.tranID, Equal <Required <CATransfer.tranIDIn> > > > .Select(this, transfer.TranIDIn); if (tran != null) { list.Add(CATrxRelease.CARegister(transfer, tran)); } else { throw new PXException(Messages.TransactionNotFound); } tran = PXSelect <CATran, Where <CATran.tranID, Equal <Required <CATransfer.tranIDOut> > > > .Select(this, transfer.TranIDOut); if (tran == null) { throw new PXException(Messages.TransactionNotFound); } PXLongOperation.StartOperation(this, delegate() { CATrxRelease.GroupRelease(list, false); }); List <CATransfer> ret = new List <CATransfer>(); ret.Add(transfer); return(ret); }
public virtual IEnumerable release(PXAdapter adapter) { if (PXLongOperation.Exists(UID)) { throw new ApplicationException(GL.Messages.PrevOperationNotCompleteYet); } Save.Press(); CABatch document = this.Document.Current; PXLongOperation.StartOperation(this, delegate() { CABatchEntry.ReleaseDoc(document); }); return(adapter.Get()); }
protected override IEnumerable Handler(PXAdapter adapter) { if (PXLongOperation.Exists(_Graph.UID)) { throw new ApplicationException(PX.Objects.GL.Messages.PrevOperationNotCompleteYet); } _Graph.Actions.PressSave(); CABatch doc = (CABatch)_Graph.Views[_Graph.PrimaryView].Cache.Current; CABatchExt docExt = PXCache <CABatch> .GetExtension <CABatchExt>(doc); if (doc.Released == true && doc.ExportTime.HasValue && !String.IsNullOrEmpty(docExt.ProcessingCenterID) && !docExt.FileTransferTime.HasValue) { PXLongOperation.StartOperation(_Graph, delegate() { TransferDocProcessingCenter(_Graph, doc, docExt); }); } return(adapter.Get()); }
protected virtual void FABookBalance_RowSelected(PXCache sender, PXRowSelectedEventArgs e) { FABookBalance bal = (FABookBalance)e.Row; if (bal == null || PXLongOperation.Exists(UID)) { return; } try { AssetProcess.CheckUnreleasedTransactions(this, bal); } catch (PXException exc) { PXUIFieldAttribute.SetEnabled <FABookBalance.selected>(sender, bal, false); sender.RaiseExceptionHandling <FABookBalance.selected>(bal, null, new PXSetPropertyException(exc.MessageNoNumber, PXErrorLevel.RowWarning)); } }
public virtual IEnumerable export(PXAdapter adapter) { if (PXLongOperation.Exists(UID)) { throw new ApplicationException(GL.Messages.PrevOperationNotCompleteYet); } CABatch doc = this.Document.Current; if (doc != null && doc.Released == true && doc.Hold == false) { PXResult <PaymentMethod, SYMapping> res = (PXResult <PaymentMethod, SYMapping>) PXSelectJoin <PaymentMethod, LeftJoin <SYMapping, On <SYMapping.mappingID, Equal <PaymentMethodExt.aRBatchExportSYMappingID> > >, Where <PaymentMethod.paymentMethodID, Equal <Optional <CABatch.paymentMethodID> > > > .Select(this, doc.PaymentMethodID); PaymentMethod pt = res; PaymentMethodExt ptx = PXCache <PaymentMethod> .GetExtension <PaymentMethodExt>(pt); SYMapping map = res; if (ptx != null && ptx.ARCreateBatchPayment == true && ptx.ARBatchExportSYMappingID != null && map != null) { string defaultFileName = this.GenerateFileName(doc); PXLongOperation.StartOperation(this, delegate() { PX.Api.SYExportProcess.RunScenario(map.Name, SYMapping.RepeatingOption.All, true, true, new PX.Api.PXSYParameter(CABatchEntry.ExportProviderParams.FileName, defaultFileName), new PX.Api.PXSYParameter(CABatchEntry.ExportProviderParams.BatchNbr, doc.BatchNbr) //, //new PX.Api.PXSYParameter(ExportProviderParams.BatchSequenceStartingNbr, "0000") ); }); } else { throw new PXException(CA.Messages.CABatchExportProviderIsNotConfigured); } } return(adapter.Get()); }
public virtual IEnumerable release(PXAdapter adapter) { PXCache cache = Caches[typeof(CATransfer)]; CATransfer transfer = Transfer.Current; if (PXLongOperation.Exists(UID)) { throw new ApplicationException(GL.Messages.PrevOperationNotCompleteYet); } Save.Press(); CheckExpensesOnHold(); List <CARegister> list = new List <CARegister>(); CATran tran = PXSelect <CATran, Where <CATran.tranID, Equal <Required <CATransfer.tranIDIn> > > > .Select(this, transfer.TranIDIn); if (tran != null) { list.Add(CATrxRelease.CARegister(transfer, tran)); } else { throw new PXException(Messages.TransactionNotFound); } tran = PXSelect <CATran, Where <CATran.tranID, Equal <Required <CATransfer.tranIDOut> > > > .Select(this, transfer.TranIDOut); if (tran == null) { throw new PXException(Messages.TransactionNotFound); } PXLongOperation.StartOperation(this, delegate() { CATrxRelease.GroupRelease(list, false); }); List <CATransfer> ret = new List <CATransfer>(); ret.Add(transfer); return(ret); }
public GLConsolSetupMaint() { GLSetup setup = glsetup.Current; ConsolSetupRecords.SetProcessCaption(Messages.ProcSynchronize); ConsolSetupRecords.SetProcessAllCaption(Messages.ProcSynchronizeAll); ConsolSetupRecords.SetProcessDelegate <GLConsolSetupMaint>(Synchronize); PXUIFieldAttribute.SetEnabled(ConsolSetupRecords.Cache, null, true); PXUIFieldAttribute.SetEnabled <GLConsolSetup.lastPostPeriod>(ConsolSetupRecords.Cache, null, false); PXUIFieldAttribute.SetEnabled <GLConsolSetup.lastConsDate>(ConsolSetupRecords.Cache, null, false); ConsolSetupRecords.SetAutoPersist(true); ConsolSetupRecords.Cache.AllowDelete = true; ConsolSetupRecords.Cache.AllowInsert = true; PXUIFieldAttribute.SetRequired <GLConsolSetup.segmentValue>(ConsolSetupRecords.Cache, true); PXUIFieldAttribute.SetRequired <GLConsolSetup.sourceLedgerCD>(ConsolSetupRecords.Cache, true); Save.StateSelectingEvents += new PXFieldSelecting(delegate(PXCache sender, PXFieldSelectingEventArgs e) { e.ReturnState = PXButtonState.CreateInstance(e.ReturnState, null, null, null, null, null, false, PXConfirmationType.Unspecified, null, null, null, null, null, null, null, null, null, null, null, null); ((PXButtonState)e.ReturnState).Enabled = !PXLongOperation.Exists(this.UID); }); }
private bool IsLongOperationProcessing(PXGraph graph) => PXLongOperation.Exists(graph);