protected virtual void Filter_RowSelected(PXCache sender, PXRowSelectedEventArgs e)
		{
			if (e.Row == null) return;
			Filter row = (Filter)e.Row;
			bool allDataIsFilled = !string.IsNullOrEmpty(row.OldPaymentMethodID) 
				&& !string.IsNullOrEmpty(row.OldCCProcessingCenterID) 
				&& !string.IsNullOrEmpty(row.NewCCProcessingCenterID);
			CustomerPaymentMethodList.SetProcessEnabled(allDataIsFilled);
			CustomerPaymentMethodList.SetProcessAllEnabled(allDataIsFilled);
			if (allDataIsFilled)
			{
				CCProcessingCenter newCCPC = NewProcessingCenter.Select();
				string oldProcCenterId = OldProcessingCenter.SelectSingle()?.ProcessingCenterID;
				string newProcCenterId = NewProcessingCenter.SelectSingle()?.ProcessingCenterID;
				CustomerPaymentMethodList.SetParametersDelegate(cpm =>
				{
					WebDialogResult result = filter.Ask(PXMessages.LocalizeFormatNoPrefix(Messages.PaymentMethodConverterWarning, oldProcCenterId, newProcCenterId), MessageButtons.OKCancel);
					return result == WebDialogResult.OK ? true : false;
				});
				CustomerPaymentMethodList.SetProcessDelegate(cpm => ConvertCustomerPaymentMethod(row, cpm, newCCPC));
			}

			ShowUnknownPluginWarningIfNeeded(row, OldProcessingCenter.Select(), nameof(Filter.OldCCProcessingCenterID));
			ShowUnknownPluginWarningIfNeeded(row, NewProcessingCenter.Select(), nameof(Filter.NewCCProcessingCenterID));
		}
Beispiel #2
0
        protected virtual void APIntegrityCheckFilter_RowSelected(PXCache sender, PXRowSelectedEventArgs e)
        {
            bool errorsOnForm = PXUIFieldAttribute.GetErrors(sender, null, PXErrorLevel.Error, PXErrorLevel.RowError).Count > 0;

            APVendorList.SetProcessEnabled(!errorsOnForm);
            APVendorList.SetProcessAllEnabled(!errorsOnForm);

            APIntegrityCheckFilter filter = Filter.Current;

            APVendorList.SetProcessDelegate <APReleaseProcess>(
                delegate(APReleaseProcess re, Vendor vend)
            {
                re.Clear(PXClearOption.PreserveTimeStamp);
                re.IntegrityCheckProc(vend, filter.FinPeriodID);
            }
                );

            //For perfomance recomended select not more than maxVendorCount vendors,
            //because the operation is performed for a long time.
            const int maxVendorCount = 5;

            APVendorList.SetParametersDelegate(delegate(List <Vendor> list)
            {
                bool processing = true;
                if (PX.Common.PXContext.GetSlot <AUSchedule>() == null && list.Count > maxVendorCount)
                {
                    WebDialogResult wdr = APVendorList.Ask(Messages.ContinueValidatingBalancesForMultipleVendors, MessageButtons.OKCancel);
                    processing          = wdr == WebDialogResult.OK;
                }
                return(processing);
            });
        }
Beispiel #3
0
        protected virtual void ARIntegrityCheckFilter_RowSelected(PXCache sender, PXRowSelectedEventArgs e)
        {
            ARIntegrityCheckFilter filter = Filter.Current;

            ARCustomerList.SetProcessDelegate <ARReleaseProcess>(
                delegate(ARReleaseProcess re, Customer cust)
            {
                re.Clear(PXClearOption.PreserveTimeStamp);
                re.IntegrityCheckProc(cust, filter.FinPeriodID);
            }
                );

            //For perfomance recomended select not more than maxCustomerCount customers,
            //becouse the operation is performed for a long time.
            const int maxCustomerCount = 5;

            ARCustomerList.SetParametersDelegate(delegate(List <Customer> list)
            {
                bool processing = true;

                if (list.Count > maxCustomerCount)
                {
                    WebDialogResult wdr = ARCustomerList.Ask(Messages.ContinueValidatingBalancesForMultipleCustomers, MessageButtons.OKCancel);
                    processing          = wdr == WebDialogResult.OK;
                }
                return(processing);
            });
        }