private void btnEditar_Click_1(object sender, EventArgs e)
        {
            string telefoneCasaSemMascara  = mskTelefone.Text.Replace("-", "").Replace("(", "").Replace(")", "").Replace(" ", "");
            string cepSemMascara           = mskCep.Text.Replace("-", "");
            string telefoneMaeSemMascara   = mskTelefoneMae.Text.Replace("-", "").Replace("(", "").Replace(")", "").Replace(" ", "");
            string telefonePaiSemMascara   = mskTelefonePai.Text.Replace("-", "").Replace("(", "").Replace(")", "").Replace(" ", "");
            string telefoneAlunoSemMascara = mskTelefoneAluno.Text.Replace("/", "").Replace(".", "").Replace("-", "");
            string cpfSemMascara           = mskCpf.Text.Replace(".", "").Replace("-", "");
            string cnpjSemMascara          = mskCnpj.Text.Replace("/", "").Replace(".", "").Replace("-", "");

            if (Validar() == true)
            {
                if ((txtBusca.Text != "") && (cnpjSemMascara != "") && (txtCodSemestre.Text != "") && (cboContrato.Text != ""))
                {
                    aluno.NomeAluno            = txtNome.Text;
                    aluno.Sexo                 = cboSexo.Text;
                    aluno.Idade                = int.Parse(txtIdade.Text);
                    aluno.Grau_instrucao       = txtGrau.Text;
                    aluno.Cep                  = cepSemMascara;
                    aluno.Rua                  = txtEndereco.Text;
                    aluno.Numero               = int.Parse(txtNumero.Text);
                    aluno.Bairro               = txtBairro.Text;
                    aluno.Cidade               = txtCidade.Text;
                    aluno.Estado               = txtEstado.Text;
                    aluno.Cidade               = txtCidade.Text;
                    aluno.Telefone1            = mskTelefone.Text;
                    aluno.Identidade           = txtId.Text;
                    aluno.Cpf                  = cpfSemMascara;
                    aluno.Email                = txtEmail.Text;
                    aluno.Carteira_de_trabalho = txtCarteira.Text;
                    aluno.NomePai              = txtNomePai.Text;
                    aluno.NomeMae              = txtNomeMae.Text;
                    aluno.TelefonePai          = telefonePaiSemMascara;
                    aluno.TelefoneMae          = telefoneMaeSemMascara;
                    aluno.NomeCurso            = txtNomeCurso.Text;
                    aluno.CodTurma             = txtCodTurma.Text;
                    aluno.StatusAluno          = cboStatusAluno.Text;
                    aluno.TelefoneAluno2       = mskTelefoneAluno.Text;
                    aluno.Empresa_cnpj         = cnpjSemMascara;
                    aluno.Semestre_codSemestre = txtCodSemestre.Text;
                    aluno.TipoContrato         = cboContrato.Text;

                    if (aluno.Editar(idClicado) == true)
                    {
                        MessageBox.Show("Aluno atualizado com sucesso!");
                        dgvEditarAlunos.DataSource = aluno.RetAluno();
                    }
                    else
                    {
                        MessageBox.Show("Atualização não concluída tente novamente.");
                    }
                }
            }
            else
            {
                MessageBox.Show("Atualização não concluída. Tente novamente.");
            }
        }
Beispiel #2
0
 private void frmVerAluno_Load(object sender, EventArgs e)
 {
     dgvVerAlunos.DataSource = aluno.RetAluno();
 }
Beispiel #3
0
 private void dgvVisualizarAluno_CellContentClick(object sender, DataGridViewCellEventArgs e)
 {
     dgvVisualizarAluno.DataSource = aluno.RetAluno();
 }
 private void frmExcluirAluno_Load(object sender, EventArgs e)
 {
     dgvAlunoExcluir.DataSource = aluno.RetAluno();
 }
 private void frmBuscarDados_Load(object sender, EventArgs e)
 {
     dgvBuscarDados.DataSource = aluno.RetAluno();
 }