protected override async void BtnProximo_Click(object sender, EventArgs e) { Cursor = Cursors.WaitCursor; using (ParticipanteRepository repository = new ParticipanteRepository()) { participante = await repository.Salvar(new Participante() { IdParticipante = 0, Nome = txtNome.Text, Telefone = txtTelefone.Text }); Cursor = Cursors.Default; using (FrmPerguntas frmPergunta = new FrmPerguntas(participante, 1)) { frmPergunta.ShowDialog(); using (FrmAgradecimento frmAgradecimento = new FrmAgradecimento()) { frmAgradecimento.ShowDialog(); Close(); } } } base.BtnProximo_Click(sender, e); }
protected override async void BtnProximo_Click(object sender, EventArgs e) { Cursor = Cursors.WaitCursor; using (RespostaRepository repository = new RespostaRepository()) { var respostaSelecionada = (TipoResposta)ChkListBox.SelectedItem; var resposta = await repository.Salvar(new Resposta( participante.IdParticipante, respostaSelecionada?.IdTipoResposta ?? null, pergunta.IdPergunta) { IdResposta = 0, Observacao = TxtObservacao.Text }); Cursor = Cursors.Default; if (await SelecionarPergunta(sequencia + 1) != null) { using (FrmPerguntas frmPergunta = new FrmPerguntas(participante, ++sequencia)) { frmPergunta.ShowDialog(); Close(); } } else { Close(); } } base.BtnProximo_Click(sender, e); }