//same code for the other card providers public Visa(ccForm obj) : base(obj) { }
public MasterCard(ccForm obj) : base(obj) { }
public DiscoverCard(ccForm obj) : base(obj) { }
public AmericanExpress(ccForm obj) : base(obj) { }
public CreditCard(ccForm obj) { inst = obj; }
//the purchase button private void purchase_Click(object sender, EventArgs e) { //Once pressed, a messagebox will prompt for a confirmation, options yes or no DialogResult confirm = MessageBox.Show("Are you sure you want to purchase this property?", "CONFIRM YOUR PURCHASE", MessageBoxButtons.YesNo, MessageBoxIcon.Information); if (confirm == DialogResult.Yes && status.Text == "Active") //if yes has been selected { ccForm childForm4 = new ccForm(this.address.Text, this); //passes the address so the form can utilize it childForm4.Show();//Opens up the credit card prompt form } else if (confirm == DialogResult.Yes && status.Text == "Sold") MessageBox.Show("This property is unavailable for purchase!", "WARNING!"); if (confirm == DialogResult.No) MessageBox.Show("Purchase canceled", "Cancel"); }