Пример #1
0
        private void frmPesquisa_FormClosed(object sender, FormClosedEventArgs e)
        {
            cadCliente clienteNovo = new cadCliente("");

            clienteNovo.Visible = true;
            this.Dispose();
        }
Пример #2
0
 private void dgvPesquisa_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
 {
     if (dgvPesquisa.Rows.Count > 0)
     {
         string     valid = Convert.ToString(dgvPesquisa.CurrentRow.Cells[0].Value);
         cadCliente cad   = new cadCliente(valid);
         cad.txtNome.Text = Convert.ToString(dgvPesquisa.CurrentRow.Cells[1].Value);
         string endereco = Convert.ToString(dgvPesquisa.CurrentRow.Cells[2].Value);
         int    virgula  = endereco.IndexOf(',');
         string rua      = endereco.Substring(0, virgula);
         endereco = endereco.Substring(virgula + 1);
         virgula  = endereco.IndexOf(',');
         string bairro = endereco.Substring(0, virgula);
         endereco = endereco.Substring(virgula + 1);
         string numero = endereco;
         cad.txtBairro.Text     = bairro;
         cad.txtNo.Text         = numero;
         cad.txtRua.Text        = rua;
         cad.txtCidade.Text     = Convert.ToString(dgvPesquisa.CurrentRow.Cells[3].Value);
         cad.mskTel.Text        = Convert.ToString(dgvPesquisa.CurrentRow.Cells[4].Value);
         cad.txtEmail.Text      = Convert.ToString(dgvPesquisa.CurrentRow.Cells[6].Value);
         cad.mskCPF.Text        = Convert.ToString(dgvPesquisa.CurrentRow.Cells[7].Value);
         cad.mskRG.Text         = Convert.ToString(dgvPesquisa.CurrentRow.Cells[8].Value);
         cad.mskNascimento.Text = Convert.ToString(dgvPesquisa.CurrentRow.Cells[9].Value);
         this.Visible           = false;
         this.Dispose();
     }
     else
     {
         MessageBox.Show("Não há nenhum dado cadastrado!");
     }
     //cad.txtBairro.Text = Convert.ToString(dgvPesquisa.CurrentRow.Cells[])
 }
Пример #3
0
        private void btnCadastro_Click(object sender, EventArgs e)
        {
            cadCliente novoCliente = new cadCliente("");

            this.Visible = false;
        }