Beispiel #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();
        }
Beispiel #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;
        }
Beispiel #3
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();
        }
Beispiel #4
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);
        }
Beispiel #5
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;
        }
Beispiel #6
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();
        }