Beispiel #1
0
        private void btnAlterar_Click(object sender, EventArgs e)
        {
            Telas.Cadastros.FrmCadCliente fcu = new Cadastros.FrmCadCliente();
            fcu.Text         = "Alterando o Cliente";
            fcu.button1.Text = "Alterar";
            fcu.Codigo       = Convert.ToInt16(dataGridView1.CurrentRow.Cells[0].Value);
            fcu.txtNome.Text = Convert.ToString(dataGridView1.CurrentRow.Cells[1].Value);
            if (Convert.ToString(dataGridView1.CurrentRow.Cells[2].Value) == "f")
            {
                fcu.rbFem.Checked  = true;
                fcu.rbFem.Enabled  = false;
                fcu.rbMasc.Enabled = false;
            }
            else
            {
                fcu.rbMasc.Checked = true;
                fcu.rbMasc.Enabled = false;
                fcu.rbFem.Enabled  = false;
            }
            fcu.txtEmail.Text = Convert.ToString(dataGridView1.CurrentRow.Cells[3].Value);
            fcu.txtCpf.Text   = Convert.ToString(dataGridView1.CurrentRow.Cells[4].Value);
            fcu.txtTel.Text   = Convert.ToString(dataGridView1.CurrentRow.Cells[5].Value);
            fcu.txtData.Text  = Convert.ToString(dataGridView1.CurrentRow.Cells[6].Value);


            fcu.button1.Click -= fcu.CadastrarCliente;
            fcu.button1.Click += fcu.AlterarCliente;


            fcu.ShowDialog();
        }
Beispiel #2
0
        private void btnConsultar_Click(object sender, EventArgs e)
        {
            Telas.Cadastros.FrmCadCliente fcu = new Cadastros.FrmCadCliente();
            fcu.Text         = "Detalhando o Cliente";
            fcu.txtNome.Text = Convert.ToString(dataGridView1.CurrentRow.Cells[1].Value);
            if (Convert.ToString(dataGridView1.CurrentRow.Cells[2].Value) == "f")
            {
                fcu.rbFem.Checked  = true;
                fcu.rbFem.Enabled  = false;
                fcu.rbMasc.Enabled = false;
            }
            else
            {
                fcu.rbMasc.Checked = true;
                fcu.rbMasc.Enabled = false;
                fcu.rbFem.Enabled  = false;
            }
            fcu.txtEmail.Text = Convert.ToString(dataGridView1.CurrentRow.Cells[3].Value);
            fcu.txtCpf.Text   = Convert.ToString(dataGridView1.CurrentRow.Cells[4].Value);
            fcu.txtTel.Text   = Convert.ToString(dataGridView1.CurrentRow.Cells[5].Value);
            fcu.txtData.Text  = Convert.ToString(dataGridView1.CurrentRow.Cells[6].Value);



            fcu.button1.Visible  = false;
            fcu.txtNome.ReadOnly = true;
            fcu.txtData.ReadOnly = true;

            fcu.txtCpf.ReadOnly   = true;
            fcu.txtTel.ReadOnly   = true;
            fcu.txtEmail.ReadOnly = true;



            fcu.ShowDialog();
        }
 private void btnCli_Click(object sender, EventArgs e)
 {
     Telas.Cadastros.FrmCadCliente n = new Cadastros.FrmCadCliente();
     n.ShowDialog();
 }