Exemple #1
0
 private void buttonPayment_Click(object sender, EventArgs e)
 {
     try
     {
         foreach (ListViewItem item in listView.SelectedItems)
         {
             int         id      = Convert.ToInt16(item.Tag);
             Invoice     invoice = new Invoice(id);
             paymentForm form    = new paymentForm(this.context, invoice);
             form.ShowDialog(this);
             loadList();
         }
     }
     catch (Exception ex)
     {
         Tools.ShowError("Unable to load invoice to perform payment\n" + ex.Message);
     }
 }
 private void buttonPayment_Click(object sender, EventArgs e)
 {
     try
     {
         if (MessageBox.Show("Are you sure you want to pay the customer without selecting a invoice?", "Payment direct to customer", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes)
         {
             foreach (ListViewItem item in listView.SelectedItems)
             {
                 int         id       = Convert.ToInt16(item.Tag);
                 Customer    customer = new Customer(id);
                 paymentForm form     = new paymentForm(this.context, customer);
                 form.ShowDialog(this);
                 loadList();
             }
         }
     }
     catch (Exception ex)
     {
         Tools.ShowError("Unable to load customer to perform payment\n" + ex.Message);
     }
 }
 private void buttonPayment_Click(object sender, EventArgs e)
 {
     try
     {
         foreach (ListViewItem item in listView.SelectedItems)
         {
             int id = Convert.ToInt16(item.Tag);
             Invoice invoice = new Invoice(id);
             paymentForm form = new paymentForm(this.context, invoice);
             form.ShowDialog(this);
             loadList();
         }
     }
     catch (Exception ex)
     {
         Tools.ShowError("Unable to load invoice to perform payment\n" + ex.Message);
     }
 }
 private void buttonPayment_Click(object sender, EventArgs e)
 {
     try
     {
         if (MessageBox.Show("Are you sure you want to pay the customer without selecting a invoice?", "Payment direct to customer", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes)
         {
             foreach (ListViewItem item in listView.SelectedItems)
             {
                 int id = Convert.ToInt16(item.Tag);
                 Customer customer = new Customer(id);
                 paymentForm form = new paymentForm(this.context, customer);
                 form.ShowDialog(this);
                 loadList();
             }
         }
     }
     catch (Exception ex)
     {
         Tools.ShowError("Unable to load customer to perform payment\n" + ex.Message);
     }
 }