CloverExamplePOS.CloverExamplePOSForm.PreAuthListChanged C# (CSharp) Method

PreAuthListChanged() public method

public PreAuthListChanged ( POSPayment payment, Store action ) : void
payment POSPayment
action Store
return void
        public void PreAuthListChanged(POSPayment payment, Store.PreAuthAction action)
        {
            if (action == Store.PreAuthAction.ADDED)
            {
                ListViewItem lvi = new ListViewItem();
                lvi.Tag = payment;
                lvi.SubItems.Add(new ListViewItem.ListViewSubItem());

                lvi.SubItems[0].Text = "PRE-AUTH";
                lvi.SubItems[1].Text = (payment.Amount / 100.0).ToString("C2");

                PreAuthListView.Items.Add(lvi);
            }
            else if (action == Store.PreAuthAction.REMOVED)
            {
                foreach (ListViewItem lvi in PreAuthListView.Items)
                {
                    if (lvi.Tag.Equals(payment))
                    {
                        PreAuthListView.Items.Remove(lvi);
                        break;
                    }
                }
            }
            SaleButton.ContextMenu.MenuItems[1].Enabled = Store.PreAuths.Count > 0;
            autoResizeColumns(PreAuthListView);
        }
CloverExamplePOSForm