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"); }
private void CarregaInfoExperimentoUm(long idExperimento) { var experimentoUm = ExperimentoUmService.GetById(idExperimento); if (experimentoUm != null) { idExperimentoUm = idExperimento; tbInstrucao1.Text = experimentoUm.InstrucaoInicial; tbInstrucaoLinhaDeBase.Text = experimentoUm.InstrucaoLinhaDeBase; nudTelaPretaInicial1.Value = experimentoUm.TempoTelaPretaInicial; nudTelaPretaITI.Value = experimentoUm.TempoTelaPretaITI; nudTempoEstimulo.Value = experimentoUm.TempoApresentacaoEstimulo; nudTamanhoBloco.Value = experimentoUm.TamanhoBlocoTentativas; nudSequenciaInicial.Value = experimentoUm.TamanhoSequenciaInicial; nudAcertosPreTreino.Value = experimentoUm.CriterioAcertoPreTreino; nudTalvezLinhaDeBase.Value = experimentoUm.CriterioTalvezLinhaDeBase; nudBlocosFaseExperimental.Value = experimentoUm.NumeroBlocosFaseExperimental; } }