private ExperimentoUm CriaExperimentoUmPelosCampos() { var experimentoUm = new ExperimentoUm { InstrucaoInicial = tbInstrucao1.Text, InstrucaoLinhaDeBase = tbInstrucaoLinhaDeBase.Text, TempoTelaPretaInicial = Convert.ToInt32(nudTelaPretaInicial1.Value), TempoTelaPretaITI = Convert.ToInt32(nudTelaPretaITI.Value), TempoApresentacaoEstimulo = Convert.ToInt32(nudTempoEstimulo.Value), TamanhoBlocoTentativas = Convert.ToInt32(nudTamanhoBloco.Value), TamanhoSequenciaInicial = Convert.ToInt32(nudSequenciaInicial.Value), CriterioAcertoPreTreino = Convert.ToInt32(nudAcertosPreTreino.Value), CriterioTalvezLinhaDeBase = Convert.ToInt32(nudTalvezLinhaDeBase.Value), NumeroBlocosFaseExperimental = Convert.ToInt32(nudBlocosFaseExperimental.Value), CriterioReforcoFaseExperimental = 0, }; ExperimentoUmService.Salvar(experimentoUm); if (experimentoUm.Id != 0) { idExperimentoUm = experimentoUm.Id; } else { experimentoUm.Id = idExperimentoUm; } return(experimentoUm); }
private void btnSalvarExperimento_Click(object sender, EventArgs e) { var experimentoUm = CriaExperimentoUmPelosCampos(); var experimentoDois = CriarExperimentoDoisPelosCampos(); ExperimentoUmService.Salvar(experimentoUm); ExperimentoDoisService.Salvar(experimentoDois); MessageBox.Show("Experimento cadastrado com sucesso!", "Sucesso"); }