Exemple #1
0
        private void txtCodCliente_Leave(object sender, EventArgs e)
        {
            try
            {
                ControleCliente cliente = new ControleCliente();
                if (Convert.ToInt32(txtCodCliente.Text) == 298)
                {
                    lbComprador.Visible      = true;
                    txtNomeComprador.Visible = true;
                }

                if (cliente.VerificaCliente(Convert.ToInt32(txtCodCliente.Text)) == null)
                {
                    //PERGUNTA SE DESEJA CADASTRAR UM NOVO CLIENTE
                    DialogResult d = MessageBox.Show("Cliente nao cadastro, DESEJA CADASTRAR AGORA ?", "AVISO!!", MessageBoxButtons.YesNo);
                    if (d.ToString() == "Yes")
                    {
                        frmCadClientes frm = new frmCadClientes();
                        frm.ShowDialog();
                        frm.Dispose();
                        if (frm.codigo != 0)
                        {
                            PreencheCampos(cliente.BuscaInt(Convert.ToInt32(frm.codigo)));
                        }

                        return;
                    }
                    else
                    {
                        txtCodCliente.Clear();
                        txtCodCliente.Focus();
                        return;
                    }
                }
                else
                {
                    PreencheCampos(cliente.BuscaInt(Convert.ToInt32(txtCodCliente.Text)));
                }
            }
            catch
            {
            }
        }
Exemple #2
0
        private void cLIENTESToolStripMenuItem_Click(object sender, EventArgs e)
        {
            frmCadClientes frmCadCliente = new frmCadClientes();

            frmCadCliente.ShowDialog();
        }