Beispiel #1
0
        private void button1_Click_1(object sender, EventArgs e)
        {
            emprestimno = new Emprestimo();
            dadosTabela = new DataTable();

            dadosTabela = emprestimno.listardevolucao(DateTime.Today);
            dtgEmprestimoTelaPrincipal.DataSource = dadosTabela;
        }
Beispiel #2
0
        private void button4_Click(object sender, EventArgs e)
        {
            emprestimno = new Emprestimo();
            dadosTabela = new DataTable();
            if (tabControl1.SelectedTab == tabDevolucao && txtPesquisa.Text != "")
            {
                if (rbLivro.Checked)
                {
                    dadosTabela             = emprestimno.listardevolucao(txtPesquisa.Text, "Livro");
                    dtgDevolucao.DataSource = dadosTabela;
                }
                else if (rbGenero.Checked)
                {
                    dadosTabela             = emprestimno.listardevolucao(txtPesquisa.Text, "Genero");
                    dtgDevolucao.DataSource = dadosTabela;
                }
                else if (rbSaida.Checked)
                {
                    dadosTabela             = emprestimno.listardevolucao(txtPesquisa.Text, "Saida");
                    dtgDevolucao.DataSource = dadosTabela;
                }
                else if (rbAutor.Checked)
                {
                    dadosTabela             = emprestimno.listardevolucao(txtPesquisa.Text, "Autor");
                    dtgDevolucao.DataSource = dadosTabela;
                }
                else if (rbLeitor.Checked)
                {
                    dadosTabela             = emprestimno.listardevolucao(txtPesquisa.Text, "Aluno");
                    dtgDevolucao.DataSource = dadosTabela;
                }
            }

            else if (tabControl1.SelectedTab == tabEmprestimo && txtPesquisa.Text != "")
            {
                if (rbLivro.Checked)
                {
                    dadosTabela = emprestimno.listarEmprestimo(txtPesquisa.Text, "Livro");
                    dtgEmprestimoTelaPrincipal.DataSource = dadosTabela;
                }
                else if (rbGenero.Checked)
                {
                    dadosTabela = emprestimno.listarEmprestimo(txtPesquisa.Text, "Genero");
                    dtgEmprestimoTelaPrincipal.DataSource = dadosTabela;
                }
                else if (rbSaida.Checked)
                {
                    dadosTabela = emprestimno.listarEmprestimo(txtPesquisa.Text, "Saida");
                    dtgEmprestimoTelaPrincipal.DataSource = dadosTabela;
                }
                else if (rbAutor.Checked)
                {
                    dadosTabela = emprestimno.listarEmprestimo(txtPesquisa.Text, "Autor");
                    dtgEmprestimoTelaPrincipal.DataSource = dadosTabela;
                }
                else if (rbLeitor.Checked)
                {
                    dadosTabela = emprestimno.listarEmprestimo(txtPesquisa.Text, "Aluno");
                    dtgEmprestimoTelaPrincipal.DataSource = dadosTabela;
                }
            }
        }