示例#1
0
        private void btnAlterar_Click(object sender, EventArgs e)
        {
            frmCCliente ofrmCCliente = new frmCCliente();

            if (txtCodigo.Text == string.Empty || txtCodigo.Text == "0")
            {
                ofrmCCliente.ShowDialog();
            }
            else
            {
                ofrmCCliente.txtCodigo.Text      = txtCodigo.Text;
                ofrmCCliente.txtNome.Text        = tbxNome.Text;
                ofrmCCliente.txtCEP.Text         = tbxCEP.Text;
                ofrmCCliente.txtBairro.Text      = tbxBairro.Text;
                ofrmCCliente.txtEndereco.Text    = tbxEnd.Text;
                ofrmCCliente.txtNumero.Text      = tbxNumero.Text;
                ofrmCCliente.txtComplemento.Text = tbxComp.Text;

                ofrmCCliente.txtCidade.Text = oCliente.strCidade;
                ofrmCCliente.txtUF.Text     = oCliente.strEstado;
                ofrmCCliente.txtCPF.Text    = oCliente.strCPF;

                oCliente.Consultar(0);

                foreach (string tel in oCliente.strTelefones)
                {
                    ofrmCCliente.lstTelefones.Items.Add(tel);
                }

                ofrmCCliente.ShowDialog();
                oCliente = null;
                oCliente = new Cliente();
            }
        }
示例#2
0
        private void btnICliente_Click(object sender, EventArgs e)
        {
            frmCCliente ofrmCCliente = new frmCCliente();

            ofrmCCliente.ShowDialog();
            CarregarGrid();
            CarregarGridTel();
        }
示例#3
0
        private void button2_Click(object sender, EventArgs e)
        {
            if (grdCliente.SelectedCells.Count != 0)
            {
                frmCCliente ofrmCCliente = new frmCCliente();

                if (Convert.ToBoolean(grdCliente.SelectedCells[11].Value))
                {
                    ofrmCCliente.rdbPF.Checked = true;
                }
                else
                {
                    ofrmCCliente.rdbPJ.Checked = true;
                }


                if (ofrmCCliente.rdbPF.Checked)
                {
                    ofrmCCliente.txtCPF.Text = grdCliente.SelectedCells[1].Value.ToString();
                }
                else
                {
                    ofrmCCliente.txtCNPJ.Text = grdCliente.SelectedCells[2].Value.ToString();
                }

                oCliente.intCodigo               = Convert.ToInt32(grdCliente.SelectedCells[0].Value);
                ofrmCCliente.txtNome.Text        = grdCliente.SelectedCells[3].Value.ToString();
                ofrmCCliente.txtCEP.Text         = grdCliente.SelectedCells[4].Value.ToString();
                ofrmCCliente.txtEndereco.Text    = grdCliente.SelectedCells[5].Value.ToString();
                ofrmCCliente.txtNumero.Text      = grdCliente.SelectedCells[6].Value.ToString();
                ofrmCCliente.txtComplemento.Text = grdCliente.SelectedCells[7].Value.ToString();
                ofrmCCliente.txtBairro.Text      = grdCliente.SelectedCells[8].Value.ToString();
                ofrmCCliente.txtCidade.Text      = grdCliente.SelectedCells[9].Value.ToString();
                ofrmCCliente.txtUF.Text          = grdCliente.SelectedCells[10].Value.ToString();


                oCliente.ConsultarTel();

                ofrmCCliente.txtCodigo.Text = oCliente.intCodigo.ToString();

                foreach (string tel in oCliente.strTelefones)
                {
                    ofrmCCliente.lstTelefones.Items.Add(tel);
                }

                ofrmCCliente.ShowDialog();
                oCliente = null;
                oCliente = new Cliente();
                CarregarGrid();
            }
        }
示例#4
0
        private void btnNovo_Click(object sender, EventArgs e)
        {
            frmCCliente ofrmCliente = new frmCCliente();

            ofrmCliente.Show();
        }