private void buttonOk_Click(object sender, EventArgs e) { double value; if (double.TryParse(textBoxValue.Text, out value)) { Sale sale = new Sale(double.Parse(this.textBoxValue.Text), null, null); Student student = new Student(); student.Id = this.studentId; sale.Student = student; sale.IsReload = true; MessageBox.Show(sale.send()); this.Close(); } else MessageBox.Show("Insira um valor válido."); }
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."); }