private void carregarDadosDetalhados()
        {
            CarregarListaDeAlunos();
            Aluno aluno = new Aluno();

            if (grvAluno.SelectedDataKey != null && Convert.ToInt32(grvAluno.SelectedDataKey.Values[0]) > 0)
            {
                aluno.IdPessoa = Convert.ToInt32(grvAluno.SelectedDataKey.Values[0]);
            }
            else
            {
                aluno.IdPessoa = id;
            }
            List <Aluno> detalhes = SvcAluno.BuscarPorNomeEId(aluno);

            foreach (var item in detalhes)
            {
                lblNome.Text       = item.Nome;
                lblNascimento.Text = item.Nascimento.ToShortDateString();
                lblIdade.Text      = $"{item.Idade.ToString()} Anos";
                lblSexo.Text       = item.Descricao;
                lblCpf.Text        = item.Cpf;
                lblWhatsApp.Text   = item.WhatsApp;
                lblEmail.Text      = item.Email;
                lblTelefone.Text   = item.Telefone;
                id = item.IdPessoa;
            }
            pnlDadosPessoais.Visible = true;
            LimparSearch();
        }
Example #2
0
        public void TesDeleteAluno()
        {
            Aluno aluno = new Aluno();

            aluno.IdPessoa = 5;
            SvcAluno.DeletarAluno(aluno);
        }
Example #3
0
        private void PreenherCampos()
        {
            Aluno aluno = new Aluno();

            aluno.IdPessoa = codigo;
            var dados = SvcAluno.BuscarPorNomeEId(aluno);

            foreach (var item in dados)
            {
                txbNome.Text       = item.Nome;
                txbNascimento.Text = item.Nascimento.ToString("yyyy-MM-dd");
                if (item.SiglaSexo == "M")
                {
                    Masculino.Checked = true;
                }
                if (item.SiglaSexo == "F")
                {
                    Feminino.Checked = true;
                }
                txbCpf.Text      = item.Cpf;
                txbWhatsApp.Text = item.WhatsApp;
                txbTelefone.Text = item.Telefone;
                txbEmail.Text    = item.Email;
            }
        }
Example #4
0
        public void TesBuscaAlunoDetalhado()
        {
            Aluno aluno = new Aluno();

            aluno.Nome = "";

            var x = SvcAluno.BuscarAluno(aluno);
        }
Example #5
0
        public void TesBuscaAlunoDetalhadobuca()
        {
            Aluno aluno = new Aluno();

            aluno.IdPessoa = 4;
            aluno.Nome     = "Arlete Santana";

            var x = SvcAluno.BuscarPorNomeEId(aluno);
        }
        protected void CarregarListaDeAlunos()
        {
            Aluno aluno = new Aluno();

            aluno.Nome = txtSearch.Text;
            var nome = SvcAluno.BuscarAluno(aluno);

            grvAluno.DataSource = nome;
            grvAluno.DataBind();
            grvAluno.ShowHeader = false;
        }
Example #7
0
        public void TesCadastroAluno()
        {
            Aluno aluno = new Aluno();

            aluno.Nome       = "Claudinir Santos";
            aluno.Cpf        = "05365128976";
            aluno.Nascimento = DateTime.Parse("1990-09-02");
            aluno.Telefone   = "48991443211";
            aluno.Email      = "*****@*****.**";
            aluno.WhatsApp   = "48991483355";
            SvcAluno.InserirDadosAluno(aluno);
        }
Example #8
0
        public void TesAtualizaAluno()
        {
            Aluno aluno = new Aluno();

            aluno.Nome       = "Arlete Santana";
            aluno.Cpf        = "05465118934";
            aluno.Nascimento = DateTime.Parse("1980-11-18");
            aluno.Telefone   = "4833696677";
            aluno.Email      = "*****@*****.**";
            aluno.WhatsApp   = "48991480381";
            aluno.IdPessoa   = 4;
            SvcAluno.AtualizarDadosAluno(aluno);
        }
Example #9
0
 protected void btnCadastrar_OnClick(object sender, EventArgs e)
 {
     if (!Masculino.Checked && !Feminino.Checked)
     {
         lblSexo.CssClass = "labelAlerta";
         lblSexo.Text     = "Selecione o sexo";
     }
     else if (txbNascimento == null || txbNascimento.Text == "")
     {
         pnlNascimento.CssClass = "labelAlerta";
         pnlNascimento.Text     = "Preencha a data";
     }
     else
     {
         Aluno aluno = new Aluno();
         aluno.IdPessoa   = codigo;
         aluno.Nome       = txbNome.Text;
         aluno.Genero     = (ESexo)VerificaSexo();
         aluno.Nascimento = Convert.ToDateTime(txbNascimento.Text);
         aluno.Cpf        = txbCpf.Text;
         aluno.WhatsApp   = txbWhatsApp.Text;
         aluno.Telefone   = txbTelefone.Text;
         aluno.Email      = txbEmail.Text;
         if (aluno.IdPessoa <= 0)
         {
             SvcAluno.InserirDadosAluno(aluno);
             Response.Redirect($"DadosPessoaisAluno.aspx?Aluno={aluno.UltimoRegistroSql}");
         }
         else
         {
             SvcAluno.AtualizarDadosAluno(aluno);
             Response.Redirect($"DadosPessoaisAluno.aspx?Aluno={codigo}");
         }
         LimparCampos();
     }
 }