private ExperimentoDois CriarExperimentoDoisPelosCampos() { var experimentoDois = new ExperimentoDois { InstrucaoInicial = tbInstrucao2.Text, QuantidadeBlocosLinhaDeBase = Convert.ToInt32(nudBlocosLinhaDeBase.Value), QuantidadeBlocosCondicao1 = Convert.ToInt32(nudBlocosCondicao1.Value), PontosTalvezErro1 = Convert.ToInt32(nudTalvezErro1.Value), PontosTalvezAcerto1 = Convert.ToInt32(nudTalvezAcerto1.Value), PontosCertezaErro1 = Convert.ToInt32(nudCertezaErro1.Value), PontosCertezaAcerto1 = Convert.ToInt32(nudCertezaAcerto1.Value), QuantidadeBlocosCondicao2 = Convert.ToInt32(nudBlocosCondicao2.Value), PontosTalvezErro2 = Convert.ToInt32(nudTalvezErro2.Value), PontosTalvezAcerto2 = Convert.ToInt32(nudTalvezAcerto2.Value), PontosCertezaErro2 = Convert.ToInt32(nudCertezaErro2.Value), PontosCertezaAcerto2 = Convert.ToInt32(nudCertezaAcerto2.Value), PontosPorGrau = Convert.ToInt32(nudPontosPorGrau.Value) }; ExperimentoDoisService.Salvar(experimentoDois); if (experimentoDois.Id != 0) { idExperimentoDois = experimentoDois.Id; } else { experimentoDois.Id = idExperimentoDois; } return(experimentoDois); }
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 CarregaInfoExperimentoDois(long idExperimento) { var experimentoDois = ExperimentoDoisService.GetById(idExperimento); if (experimentoDois != null) { idExperimentoDois = idExperimento; tbInstrucao2.Text = experimentoDois.InstrucaoInicial; nudBlocosLinhaDeBase.Value = experimentoDois.QuantidadeBlocosLinhaDeBase; nudBlocosCondicao1.Value = experimentoDois.QuantidadeBlocosCondicao1; nudTalvezErro1.Value = experimentoDois.PontosTalvezErro1; nudTalvezAcerto1.Value = experimentoDois.PontosTalvezAcerto1; nudCertezaErro1.Value = experimentoDois.PontosCertezaErro1; nudCertezaAcerto1.Value = experimentoDois.PontosCertezaAcerto1; nudBlocosCondicao2.Value = experimentoDois.QuantidadeBlocosCondicao2; nudTalvezErro2.Value = experimentoDois.PontosTalvezErro2; nudTalvezAcerto2.Value = experimentoDois.PontosTalvezAcerto2; nudCertezaErro2.Value = experimentoDois.PontosCertezaErro2; nudCertezaAcerto2.Value = experimentoDois.PontosCertezaAcerto2; nudPontosPorGrau.Value = experimentoDois.PontosPorGrau; } }