示例#1
0
        private void Cacambas_Load_1(object sender, EventArgs e)
        {
            habilitaControles(false);
            habilitaBotoes(true);

            CAMADAS.BLL.Cacambas bllCacambas = new CAMADAS.BLL.Cacambas();
            dgvCacambas.DataSource = "";
            dgvCacambas.DataSource = bllCacambas.Select();
            limparControles();
        }
示例#2
0
        private void rdbTodos_CheckedChanged(object sender, EventArgs e)
        {
            lblFiltrar.Visible = false;
            txtFiltro.Visible  = false;
            CAMADAS.BLL.Cacambas          bllCacambas = new CAMADAS.BLL.Cacambas();
            List <CAMADAS.MODEL.Cacambas> lstCacambas = new List <CAMADAS.MODEL.Cacambas>();

            lstCacambas            = bllCacambas.Select();
            dgvCacambas.DataSource = "";
            dgvCacambas.DataSource = lstCacambas;
        }
示例#3
0
        public void Devolver(MODEL.Itens item)
        {
            BLL.Cacambas          bllCacambas = new Cacambas();
            List <MODEL.Cacambas> lstCacambas = bllCacambas.SelectByID(item.cacambas_id);

            MODEL.Cacambas cacambas = lstCacambas[0];
            cacambas.situacao = 1;
            bllCacambas.Update(cacambas);
            item.entrega = Convert.ToDateTime(DateTime.Now.ToShortDateString());

            DAL.Itens dalItens = new DAL.Itens();
            dalItens.Update(item);
        }
示例#4
0
        public void Insert(MODEL.Itens item)
        {
            BLL.Cacambas          bllCacambas = new Cacambas();
            List <MODEL.Cacambas> lstCacambas = bllCacambas.SelectByID(item.cacambas_id);

            MODEL.Cacambas cacambas = lstCacambas[0];
            cacambas.situacao = 2;
            bllCacambas.Update(cacambas);


            DAL.Itens dalItens = new DAL.Itens();
            dalItens.Insert(item);
        }
示例#5
0
        private void frmAluguel_Load(object sender, EventArgs e)
        {
            CAMADAS.BLL.Aluguel bllAlu = new CAMADAS.BLL.Aluguel();
            dgvAluguel.DataSource = "";
            dgvAluguel.DataSource = bllAlu.Select();

            CAMADAS.DAL.Clientes dalCli = new CAMADAS.DAL.Clientes();
            cmbCliente.DisplayMember = "nome";
            cmbCliente.ValueMember   = "id";
            cmbCliente.DataSource    = dalCli.Select();

            CAMADAS.BLL.Cacambas bllCacambas = new CAMADAS.BLL.Cacambas();
            cmbCacamba.DisplayMember = "tipo";
            cmbCacamba.ValueMember   = "id";
            cmbCacamba.DataSource    = bllCacambas.Select();
        }
示例#6
0
        private void btnGravar_Click(object sender, EventArgs e)
        {
            CAMADAS.BLL.Cacambas bllCacambas = new CAMADAS.BLL.Cacambas();

            string msg   = string.Empty;
            string caixa = "Gravar";

            if (lblID.Text == "-1")
            {
                msg = "Deseja Inserir Caçamba?";
            }
            else
            {
                msg = "Deseja Alterar Caçamba?";
            }

            DialogResult resposta = MessageBox.Show(msg, caixa, MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1);

            if (resposta == DialogResult.Yes)
            {
                CAMADAS.MODEL.Cacambas cacambas = new CAMADAS.MODEL.Cacambas();
                cacambas.id       = Convert.ToInt32(lblID.Text);
                cacambas.tipo     = txtTIPO.Text;
                cacambas.tamanho  = txtTAMANHO.Text;
                cacambas.valor    = Convert.ToSingle(txtVALOR.Text);
                cacambas.situacao = Convert.ToInt32(txtSITUACAO.Text);

                if (lblID.Text == "-1")
                {
                    bllCacambas.Insert(cacambas);
                }
                else
                {
                    bllCacambas.Update(cacambas);
                }
            }
            // else MessageBox.Show("Gravação Cancelada", "Gravar", MessageBoxButtons.OK, MessageBoxIcon.Information);
            dgvCacambas.DataSource = "";
            dgvCacambas.DataSource = bllCacambas.Select();


            limparControles();
            habilitaControles(false);
            habilitaBotoes(true);
        }
示例#7
0
        private void verificaCacamba()
        {
            int id = Convert.ToInt32(txtCacambaID.Text);

            CAMADAS.BLL.Cacambas          bllCacambas = new CAMADAS.BLL.Cacambas();
            List <CAMADAS.MODEL.Cacambas> lstCacambas = bllCacambas.SelectByID(id);

            if (lstCacambas.Count() != 0)
            {
                if (lstCacambas[0].situacao != 1)
                {
                    MessageBox.Show("Caçamba " + lstCacambas[0].tipo.Trim() + " Alugada");
                    cmbCacamba.Focus();
                }
            }
            else
            {
                MessageBox.Show("Cacamba Invalida");
                cmbCacamba.Focus();
            }
            cmbCacamba.SelectedValue = Convert.ToInt32(txtCacambaID.Text);
        }
示例#8
0
        private void btnFiltrar_Click(object sender, EventArgs e)
        {
            CAMADAS.BLL.Cacambas          bllCacambas = new CAMADAS.BLL.Cacambas();
            List <CAMADAS.MODEL.Cacambas> lstCacambas = new List <CAMADAS.MODEL.Cacambas>();

            if (rdbTodos.Checked)
            {
                lstCacambas = bllCacambas.Select();
            }

            else if (rdbTipo.Checked)
            {
                lstCacambas = bllCacambas.SelectByTipo(txtFiltro.Text);
            }
            else
            {
                int id = Convert.ToInt32(txtFiltro.Text);
                lstCacambas = bllCacambas.SelectByID(id);
            }
            dgvCacambas.DataSource = "";
            dgvCacambas.DataSource = lstCacambas;
        }
示例#9
0
        private void btnRemover_Click(object sender, EventArgs e)
        {
            CAMADAS.BLL.Cacambas bllCacambas = new CAMADAS.BLL.Cacambas();
            if (lblID.Text != "-1")
            {
                string       msg  = "Deseja Remover?";
                DialogResult resp = MessageBox.Show(msg, "Remover", MessageBoxButtons.YesNo, MessageBoxIcon.Information, MessageBoxDefaultButton.Button2);
                if (resp == DialogResult.Yes)
                {
                    int idCacambas = Convert.ToInt32(lblID.Text);
                    bllCacambas.Delete(idCacambas);
                }
            }
            else
            {
                MessageBox.Show("Sem dados para Remover", "Remover", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }

            dgvCacambas.DataSource = "";
            dgvCacambas.DataSource = bllCacambas.Select();
            limparControles();
        }