private void Unovo()
 {
     u.limparMTextBoxes(this);
     u.limparTextBoxes(this);
     u.DisableTxt(this);
     u.DisableMasked(this);;
     u.DisableDataGrid(this);
     u.DisableCombo(this);
     btnNovo.Enabled          = true;
     btnExcluir.Enabled       = false;
     btnSalvar.Enabled        = false;
     buttonCancelareg.Enabled = false;
     btnNovo.Focus();
 }
Example #2
0
 private void Unovo()
 {
     u.limparCombo(this);
     u.limparMTextBoxes(this);
     u.limparTextBoxes(this);
     u.DisableCombo(this);
     u.DisableTxt(this);
     btnNovo.Enabled         = true;
     btnSair.Enabled         = true;
     btnSalvar.Enabled       = false;
     btnTransmitir.Enabled   = false;
     btnInsProduto.Enabled   = false;
     btnPProduto.Enabled     = false;
     comboBox1.SelectedValue = 1;
 }
 private void Ulimpa()
 {
     u.limparTextBoxes(this);
     u.CheckBoxUnchecked(this);
     u.DisableCheck(this);
     u.DisableTxt(this);
     u.CheckBoxUnchecked(this);
     btnChamaPesquisa.Enabled        = true;
     btnExcluir.Enabled              = false;
     btnNovo.Enabled                 = true;
     btnSalvar.Enabled               = false;
     buttonSaiCadClientes.Enabled    = true;
     buttonCancelaCadcliente.Enabled = false;
     txtCodigo.Enabled               = false;
 }
Example #4
0
 private void Unovo()
 {
     u.limparCombo(this);
     u.limparMTextBoxes(this);
     u.limparTextBoxes(this);
     u.DisableCombo(this);
     u.DisableTxt(this);
     u.DisableMasked(this);
     u.DisableDataGrid(this);
     btnNovo.Enabled       = true;
     btnSair.Enabled       = true;
     btnSalvar.Enabled     = false;
     btnInsProduto.Enabled = false;
     btnPProduto.Enabled   = false;
     dataGridView1.Rows.Clear();
 }
Example #5
0
 private void Unovo()
 {
     panel1.Visible = false;
     u.limparMTextBoxes(this);
     u.limparTextBoxes(this);
     u.limparCombo(this);
     u.DisableTxt(this);
     u.DisableCombo(this);
     textBoxCodPoduto.Enabled = false;
     btnNovo.Enabled          = true;
     btnExcluir.Enabled       = false;
     btnSalvar.Enabled        = false;
     textBoxVlVenda.Text      = "0,00";
     textBoxMarge.Text        = "0,00";
     textBoxEstoque.Text      = "0,00";
     textBox1CustoPro.Text    = "0,00";
     txtAliqCofins.Text       = "0,00";
     txtAliqIcms.Text         = "0,00";
     txtAliqIpi.Text          = "0,00";
     txtAliqPis.Text          = "0,00";
     buttonCancela.Enabled    = false;
     btnNovo.Focus();
 }
        private void btnExcluir_Click(object sender, EventArgs e)
        {
            cliente.ID = Convert.ToInt32(textBoxCodCliente.Text);

            DialogResult escolha = MessageBox.Show("Deseja realmente excluir esse registro ?", "Mensagem do Sitema", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);

            if (escolha == DialogResult.Cancel)
            {
                u.limparTextBoxes(this);
                u.limparMTextBoxes(this);
                u.DisableTxt(this);
                u.DisableMasked(this);
                btnPcidade.Enabled = false;
                btnExcluir.Enabled = false;
                btnSalvar.Enabled  = false;
                buttonCancelaCadcliente.Enabled = false;
                btnNovo.Enabled = true;
                btnNovo.Enabled = true;
                btnNovo.Focus();
            }
            else
            {
                string sql = "DELETE FROM CLIENTES WHERE cod_cliente =" + cliente.ID;

                SqlConnection con = new SqlConnection();
                con.ConnectionString = utils.ConexaoDb();
                SqlCommand cmd = new SqlCommand(sql, con);
                cmd.CommandType = CommandType.Text;
                con.Open();
                clientesDataGridView.Refresh();

                try
                {
                    int i = cmd.ExecuteNonQuery();
                    if (i > 0)
                    {
                        u.messageboxSucesso();
                    }
                }
                catch (Exception ex)
                {
                    u.messageboxErro(ex.ToString());
                }
                finally
                {
                    con.Close();
                }
            }
            u.limparMTextBoxes(this);
            u.limparTextBoxes(this);
            btnNovo.Enabled                      = true;
            textBoxCodCliente.Enabled            = false;
            btnPcidade.Enabled                   = false;
            txtCodCid.Enabled                    = false;
            textBoxNumero.Enabled                = false;
            textBoxBairroCliente.Enabled         = false;
            textBoxCidadeCliente.Enabled         = false;
            textBoxEmailCliente.Enabled          = false;
            textBoxEndereco.Enabled              = false;
            textBoxNomeCliente.Enabled           = false;
            textBoxObs.Enabled                   = false;
            maskedTextBoxCel.Enabled             = false;
            maskedTextBoxCepCliente.Enabled      = false;
            maskedTextBoxCpf.Enabled             = false;
            maskedTextBoxDatanas.Enabled         = false;
            maskedTextBoxTelefoneCliente.Enabled = false;
            btnNovo.Enabled                      = true;
            btnExcluir.Enabled                   = false;
            btnSalvar.Enabled                    = false;
            buttonCancelaCadcliente.Enabled      = false;
            btnNovo.Focus();
        }
 private void FormCadCFOP_Load(object sender, EventArgs e)
 {
     u.DisableTxt(this);
     limpa();
 }