Exemple #1
0
        private void btnItemGravar_Click(object sender, EventArgs e)
        {
            CAMADAS.MODEL.Itens item     = new CAMADAS.MODEL.Itens();
            CAMADAS.BLL.Itens   bllItens = new CAMADAS.BLL.Itens();
            item.id           = Convert.ToInt32(lblItemID.Text);
            item.emprestimoID = Convert.ToInt32(lblEmpID.Text);
            item.livroID      = Convert.ToInt32(txtLivroID.Text);
            item.entrega      = Convert.ToDateTime("1/1/1900");

            bllItens.Insert(item);
            dgvItens.DataSource = bllItens.SelectByEmp(Convert.ToInt32(lblEmpID.Text));
        }
        private void ButGravarLivro_Click(object sender, EventArgs e)
        {
            CAMADAS.MODEL.Itens itens    = new CAMADAS.MODEL.Itens();
            CAMADAS.BLL.Itens   BllItens = new CAMADAS.BLL.Itens();
            itens.ID            = Convert.ToInt32(LblItemID.Text);
            itens.EMPRESTIMO_ID = Convert.ToInt32(lblIDEmp.Text);
            itens.LIVRO_ID      = Convert.ToInt32(textBoxIdLivro.Text);
            itens.ENTREGA       = Convert.ToDateTime("1/1/1990");

            BllItens.Insert(itens);
            DgvLivros.DataSource = BllItens.Select();
        }
Exemple #3
0
        private void btnItemDevolver_Click(object sender, EventArgs e)
        {
            CAMADAS.MODEL.Itens item = new CAMADAS.MODEL.Itens();
            item.id           = Convert.ToInt32(lblItemEmp.Text);
            item.emprestimoID = Convert.ToInt32(lblEmpID.Text);
            item.livroID      = Convert.ToInt32(txtLivro.Text);



            CAMADAS.BLL.Itens bllItens = new CAMADAS.BLL.Itens();
            if (lblItemEmp.Text != "-1")
            {
                bllItens.Devolver(item);
            }

            dgvItens.DataSource = bllItens.SelectByEmp(Convert.ToInt32(lblEmpID.Text));
        }
Exemple #4
0
        private void btnDevolver_Click(object sender, EventArgs e)
        {
            if (lblItemID.Text != "-1" && dtpEntrega.Value == Convert.ToDateTime("1/1/1900"))
            {
                CAMADAS.BLL.Itens   bllItens = new CAMADAS.BLL.Itens();
                CAMADAS.MODEL.Itens item     = new CAMADAS.MODEL.Itens();
                item.id           = Convert.ToInt32(lblItemID.Text);
                item.emprestimoID = Convert.ToInt32(lblEmpID.Text);
                item.livroID      = Convert.ToInt32(txtLivroID.Text);

                bllItens.Devolver(item);

                dgvItens.DataSource = bllItens.SelectByEmp(item.emprestimoID);
            }
            else
            {
                MessageBox.Show("Livro invalido ou já foi devolvido!!!");
            }
        }