Пример #1
0
        private void dgvAluguel_DoubleClick(object sender, EventArgs e)
        {
            lblAluID.Text            = dgvAluguel.SelectedRows[0].Cells["id"].Value.ToString();
            txtClienteID.Text        = dgvAluguel.SelectedRows[0].Cells["cliente_id"].Value.ToString();
            cmbCliente.SelectedValue = dgvAluguel.SelectedRows[0].Cells["cliente_id"].Value;
            dtpData.Value            = Convert.ToDateTime(dgvAluguel.SelectedRows[0].Cells["date"].Value.ToString());

            CAMADAS.BLL.Itens bllItens = new CAMADAS.BLL.Itens();
            dgvItens.DataSource = bllItens.SelectByAlu(Convert.ToInt32(lblAluID.Text));
        }
Пример #2
0
        private void button3_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.aluguel_id  = Convert.ToInt32(lblAluID.Text);
            item.cacambas_id = Convert.ToInt32(txtCacambaID.Text);
            item.entrega     = Convert.ToDateTime("1/1/1900");

            bllItens.Insert(item);
            dgvItens.DataSource = bllItens.SelectByAlu(Convert.ToInt32(lblAluID.Text));
        }
Пример #3
0
        private void button4_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.aluguel_id  = Convert.ToInt32(lblAluID.Text);
                item.cacambas_id = Convert.ToInt32(txtCacambaID.Text);

                bllItens.Devolver(item);

                dgvItens.DataSource = bllItens.SelectByAlu(item.aluguel_id);
            }
        }