Exemplo n.º 1
0
        protected virtual IEnumerable loadCards(PXAdapter adapter)
        {
            CreditCardsFilter filter = Filter.Current;

            filter.EnableCustomerPaymentDialog = false;
            CCProcessingHelper.CheckHttpsConnection();

            if (!ValidateLoadCardsAction())
            {
                int rowCnt = CustomerCardPaymentData.Select().Count;

                if (rowCnt == 0 || !adapter.ExternalCall ||
                    Filter.Ask(CA.Messages.RelodCardDataDialogMsg, MessageButtons.YesNo) == WebDialogResult.Yes)
                {
                    PXLongOperation.StartOperation(this, delegate
                    {
                        int newCardsCnt = GetCardsAllProfiles();
                        if (newCardsCnt > 0)
                        {
                            this.Persist();
                        }
                    });
                }
            }
            return(adapter.Get());
        }
Exemplo n.º 2
0
        protected virtual IEnumerable setDefaultPaymentMethod(PXAdapter adapter)
        {
            CreditCardsFilter filter = Filter.Current;

            if (!adapter.ExternalCall || PMFilter.AskExt((graph, vName) => filter.OverwritePaymentMethod = false) == WebDialogResult.OK)
            {
                string        paymentMethod             = filter.PaymentMethodId;
                PXFilterRow[] filterRows                = CustomerCardPaymentData.View.GetExternalFilters();
                int           startRow                  = 0;
                int           totalRows                 = 0;
                IEnumerable <CCSynchronizeCard> retList = CustomerCardPaymentData.View.Select(null, null, null, null, null, filterRows, ref startRow, 0, ref totalRows).OfType <CCSynchronizeCard>();

                foreach (CCSynchronizeCard item in retList)
                {
                    if (filter.OverwritePaymentMethod.GetValueOrDefault() == true || item.PaymentMethodID == null)
                    {
                        item.PaymentMethodID = paymentMethod;
                        CustomerCardPaymentData.Update(item);
                    }
                }
            }
            return(adapter.Get());
        }