private void btn_frmEmprestimo_Buscar_Click(object sender, RoutedEventArgs e) { locacao = new Locacao(); locacao.IdLocacao = Convert.ToInt16(txt_IdLocacao_Buscar.Text); locacao = LocacaoDAO.VerificarLocacaoPorIdLocacao(locacao); if (!string.IsNullOrEmpty(txt_IdLocacao_Buscar.Text)) { if (locacao != null) { txt_NomeLivro_Locacao.Text = locacao.LocacaoLivro.LivroNome; txt_CodLivro_Locacao.Text = Convert.ToString(locacao.LocacaoLivro.IdLivro); txt_NomePessoa_Locacao.Text = locacao.LocacaoPessoa.PessoaNome; txt_CpfPessoa_Locacao.Text = locacao.LocacaoPessoa.PessoaCpf; txt_Data_Limite_Devolucao.Text = Convert.ToString(locacao.LocacaoDataAluguel); if (locacao.LocacaoStatus == true) { txt_Situacao.Text = "Alugado"; } else { txt_Situacao.Text = "Devolvido"; } } else { MessageBox.Show("Locação não encontrado!", "Locação de Livros", MessageBoxButton.OK, MessageBoxImage.Information); } } else { MessageBox.Show("Favor preencher o campo da busca", "Locação de Livros", MessageBoxButton.OK, MessageBoxImage.Information); } }