public void SaveCurrentContextValues(string companyName, object parentLongOperationKey) { this._parentFinished = false; this._parentLongOperationKey = parentLongOperationKey; this.CompanyName = companyName; this.UserNameForLoginScope = PXDatabase.Companies.Length > 0 ? PXAccess.GetUserName() + "@" + this.CompanyName : PXAccess.GetUserName(); this.BranchID = PXContext.GetBranchID(); this.BusinessDate = PXContext.GetBusinessDate(); this.ScreenID = PXContext.GetScreenID(); }
private void StopPaymentIfOutstandingLienWaiversExist(PXCache cache, APRegister document) { var originalDocument = cache.GetOriginal(document) as APRegister; if (originalDocument?.Status != document.Status && document.Hold == false && PXContext.GetScreenID() == Constants.ScreenIds.ChecksAndPayments) { if (originalDocument?.Status == APDocStatus.Hold) { lienWaiverProcessingValidationService.ValidateLienWaiversOnManualStatusChange(document, LienWaiverSetup.Current?.ShouldStopPayments); } else { lienWaiverProcessingValidationService.ValidateLienWaivers(document, LienWaiverSetup.Current?.ShouldStopPayments); } } }
private int RefreshTotal(string screenID, string viewName, out int read, out int unread) { read = -1; unread = -1; string actualScreenID = PXContext.GetScreenID(); using (new PXPreserveScope()) { try { PXContext.SetScreenID(screenID); PXGraph graph = CreateGraph(screenID); if (graph == null || graph.PrimaryView == null) { return(-1); } if (viewName == null) { viewName = graph.PrimaryView; } PXView view = graph.Views[viewName]; PXView viewFilters; PXFilterRow[] filters = null; if (graph.Views.TryGetValue(viewName + PXFilterableAttribute.FilterHeaderName, out viewFilters)) { foreach (FilterHeader fHeader in viewFilters.SelectMulti()) { if (fHeader.IsDefault == true) { int s = 0; int t = 0; IList f = graph.ExecuteSelect(viewName + PXFilterableAttribute.FilterRowName, new object[] { fHeader.FilterID }, null, null, null, new PXFilterRow[] { new PXFilterRow(typeof(FilterRow.isUsed).Name, PXCondition.EQ, true, null) }, ref s, 0, ref t) as IList; if (f != null && f.Count > 0) { filters = new PXFilterRow[f.Count]; PXCache frc = graph.Caches[typeof(FilterRow)]; for (int i = 0; i < f.Count; i++) { FilterRow r = (FilterRow)f[i]; var filter = new PXFilterRow(r.DataField, (PXCondition)r.Condition, frc.GetValueExt(r, "ValueSt"), frc.GetValueExt(r, "ValueSt2")); if (r.OpenBrackets != null) { filter.OpenBrackets = r.OpenBrackets.Value; } if (r.CloseBrackets != null) { filter.CloseBrackets = r.CloseBrackets.Value; } filter.OrOperator = r.Operator == 1; filters[i] = filter; } } break; } } } int start = 0; int total = 0; read = -1; unread = -1; using (var scope = new PXFieldScope(view, typeof(CRActivity.noteID), typeof(EPView.status))) foreach (object record in view.Select(null, null, null, null, null, filters, ref start, 101, ref total)) { PXResult result = record as PXResult; if (result != null) { EPView v = result.GetItem <EPView>(); if (v != null) { if (v.Status != null && v.Status == EPViewStatusAttribute.VIEWED) { read += 1; } else { unread += 1; } } } } if (read != -1 || unread != -1) { read += 1; unread += 1; } return(total); } finally { PXContext.SetScreenID(actualScreenID); } } }
public static bool IsTaxBillsAndAdjustmentsScreenId() { return(PXContext.GetScreenID() == Constants.ScreenIds.TaxBillsAndAdjustments || PXContext.GetScreenID() == Constants.ScreenIds.TaxBillsAndAdjustmentsGenericInquiry); }
public static bool IsPreparePaymentsScreenId() { return(PXContext.GetScreenID() == Constants.ScreenIds.PreparePayments); }
public static bool IsChecksAndPaymentsScreenId() { return(PXContext.GetScreenID() == Constants.ScreenIds.ChecksAndPayments); }
public static bool IsInvoicesScreenId() { return(PXContext.GetScreenID() == Constants.ScreenIds.Invoices || PXContext.GetScreenID() == Constants.ScreenIds.InvoicesGenericInquiry); }