private void btnProsseguir_Click(object sender, EventArgs e) { if (AnimalSelecionado == null) { return; } var comportamentos = animalComportamentoAppService.GetAll(this._idCaixa, Guid.Parse(Settings.Default.Logado), this.cbAgrupado.Checked); dataGridRelatorio.DataSource = comportamentos; dataGridRelatorio.AutoGenerateColumns = true; btnExportExcel.Enabled = comportamentos.Any(); }
public void DeveRetornarTodosOsRelatoriosComportamentaisLabirintoEmCruz_ReturnTodosOsRelatoriosDoUsuario() { var idUsuario = Guid.NewGuid(); var idCaixa = Guid.NewGuid(); var usuario = UsuarioFactory.CriarUmUsuarioValido(idUsuario); var usuarioViewModel = UsuarioViewModelFactory.CriarUmUsuarioValido(idUsuario); var listaAnimalComportamento = new List <AnimalComportamento> { AnimalComportamentoFactory.CriarUmAnimalComportamento(usuario) }; var listaRelatorioComportamentoLabirintoEmCruz = new List <RelatorioComportamentoLabirintoEmCruz> { RelatorioComportamentoLabirintoEmCruzFactory.CriarUmRelatorioComportamentoLabirintoEmCruz() }; _animalComportamentoService.GetAll(idCaixa, idUsuario, true).Returns(listaAnimalComportamento); _mapper.Map <IEnumerable <RelatorioComportamentoLabirintoEmCruz> >(listaAnimalComportamento).Returns(listaRelatorioComportamentoLabirintoEmCruz); var retorno = animalComportamentoAppService.GetAll(idCaixa, idUsuario, true); Assert.IsNotNull(retorno); Assert.AreEqual(listaRelatorioComportamentoLabirintoEmCruz, retorno); _mapper.Received().Map <IEnumerable <RelatorioComportamentoLabirintoEmCruz> >(listaAnimalComportamento); _animalComportamentoService.Received().GetAll(idCaixa, idUsuario, true); }
private void btnReset_Click(object sender, EventArgs e) { try { if (_animalComportamentoAppService.GetAll().Where(x => x.IdAnimal == this.IdAnimalEmAnalise).Any()) { if (MessageBox.Show("Existe Comportamento para este animal, deseja Excluir?", "Encontramos comportamento para o animal Selecionado", MessageBoxButtons.YesNo) == System.Windows.Forms.DialogResult.Yes) { this._animalComportamentoAppService.DeleteComportamentoAnimal(this.IdAnimalEmAnalise); MessageBox.Show("Comportamentos Excluídos com Sucesso"); } } this.timerVideo.Enabled = false; this.trackBarVideoProgress.Value = 0; this.tracVolume.Value = 5; this.lblTempoVideo.Text = "00:00:00 / 00:00:00"; this.video.Stop(); this.lblComportamento.Text = string.Empty; this.video.Dispose(); } catch { } }