private void buttonCartao_Click(object sender, EventArgs e) { FormCard formCard = new FormCard(this); this.Hide(); formCard.ShowDialog(); this.Show(); }
private void buttonCard_Click(object sender, EventArgs e) { double value; if (double.TryParse(textBoxValue.Text, out value)) { FormCard formCard = new FormCard(); DialogResult showFormCard; this.Hide(); showFormCard = formCard.ShowDialog(); if (showFormCard == DialogResult.OK) { this.card = formCard.ReturnValueCard; PasswordForm passwordForm = new PasswordForm(); this.Hide(); showFormCard = passwordForm.ShowDialog(); if (showFormCard == DialogResult.OK) { this.password = passwordForm.ReturnValuePassword; Sale sale = new Sale(value, this.card, this.password); MessageBox.Show(sale.send()); this.Close(); } } else this.Show(); } else MessageBox.Show("Insira um valor válido."); }