Esempio n. 1
0
        private void RequisicaoForm_Load(object sender, EventArgs e)
        {
            txtIDSetor.Enabled           = false;
            txtNomeProduto.Enabled       = false;
            txtIDProduto.Enabled         = false;
            txtQuantidadeProduto.Enabled = false;
            txtData.Enabled = false;

            gpbPesquisa.Visible = false;

            CAMADAS.BLL.Setor bllSetor = new CAMADAS.BLL.Setor();
            cbSetor.DisplayMember = "nome";
            cbSetor.ValueMember   = "id";
            cbSetor.DataSource    = bllSetor.Select();

            CAMADAS.BLL.Almoxarifado bllAlmoxarifado = new CAMADAS.BLL.Almoxarifado();
            dgvProdutos.DataSource = "";
            dgvProdutos.DataSource = bllAlmoxarifado.Select();



            CAMADAS.BLL.Requisicao bllRequisicao = new CAMADAS.BLL.Requisicao();
            dgvRequisicoes.DataSource = "";
            dgvRequisicoes.DataSource = bllRequisicao.Select();



            habilitaControles(false);
        }
Esempio n. 2
0
        private void btnRemover_Click(object sender, EventArgs e)
        {
            CAMADAS.BLL.Setor bllSetor = new CAMADAS.BLL.Setor();

            string msg    = "Não há dados selecionado para remover";
            string titBox = "Erro";

            if (lblID.Text != "")
            {
                msg    = "Deseja Remover o Setor: " + txtNome.Text;
                titBox = "Remover";
                DialogResult resposta = MessageBox.Show(msg, titBox, MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2);

                if (resposta == DialogResult.Yes)
                {
                    int id = Convert.ToInt32(lblID.Text);
                    bllSetor.Delete(id);
                }
            }
            else
            {
                msg    = "Não há dados selecionado para remover";
                titBox = "Erro";
                MessageBox.Show(msg, titBox, MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }

            limpaControles();
            dgvSetor.DataSource = bllSetor.Select();
        }
Esempio n. 3
0
 private void SetoresForm_Load(object sender, EventArgs e)
 {
     CAMADAS.BLL.Setor bllSetor = new CAMADAS.BLL.Setor();
     dgvSetor.DataSource = "";
     dgvSetor.DataSource = bllSetor.Select();
     habilitaControles(false);
 }
Esempio n. 4
0
        private void btnNovo_Click(object sender, EventArgs e)
        {
            CAMADAS.BLL.Setor bllSetor = new CAMADAS.BLL.Setor();
            cbSetor.DisplayMember = "nome";
            cbSetor.ValueMember   = "id";
            cbSetor.DataSource    = bllSetor.Select();

            habilitaControles(true);
            limpaControles();

            lblID.Text = "-1";
            cbSetor.Focus();
            txtData.Text = DateTime.Now.ToString();
        }
Esempio n. 5
0
        private void btnGravar_Click(object sender, EventArgs e)
        {
            CAMADAS.BLL.Setor bllSetor = new CAMADAS.BLL.Setor();
            string            msg      = "";
            string            titMsg   = "";

            if (lblID.Text == "-1")
            {
                msg    = "Deseja Inserir novo Setor?";
                titMsg = "Inserir";
            }
            else
            {
                msg    = "Deseja Alterar o Setor?";
                titMsg = "Atualizar";
            }

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

            if (resposta == DialogResult.Yes)
            {
                CAMADAS.MODEL.Setor setor = new CAMADAS.MODEL.Setor();
                setor.id   = Convert.ToInt32(lblID.Text);
                setor.nome = txtNome.Text;

                if (lblID.Text == "-1")
                {
                    bllSetor.Insert(setor);
                }
                else
                {
                    bllSetor.Update(setor);
                }
            }

            limpaControles();
            habilitaControles(false);
            dgvSetor.DataSource = bllSetor.Select();
        }