private void swypepaybtn_Click(object sender, EventArgs e) { try { if (Total == 0) { MessageBox.Show("Sorry, Your Payment Cart is Empty. Please select a product first!"); return; } swypepayform pf1 = new swypepayform(); pf1.AmountToPay = Total; pf1.PayedEv += pf1_cashlessPayedEv; pf1.ShowDialog(); for (int i = 0; i < 10; i++) { try { tblProduct selected = (tblProduct)(lbProductsToBuy.SelectedItem); Total -= (decimal)selected.productPrice; products.Remove(selected); } catch { //MessageBox.Show("Nothing to delete !"); } } } catch { } }
private void button12_Click(object sender, EventArgs e) { swypepayform pf1 = new swypepayform(); pf1.AmountToPay = AmountToPay; pf1.PayedEv += PayedEv; pf1.ShowDialog(); this.Close(); }