Exemple #1
0
 private void btn_altal_Click(object sender, EventArgs e)
 {
     try
     {
         int   Id = int.Parse(txtid.Text);
         Aluno a  = DAO.BuscaPorId(Id);
         a.Email    = txtb_email.Text;
         a.Idade    = int.Parse(txtb_id.Text);
         a.Nome     = txtb_nome.Text;
         a.NomeResp = txtb_nomeresp.Text;
         a.Telefone = int.Parse(txtb_tel.Text);
         a.CodTurma = int.Parse(txtb_turma.Text);
         a.Senha    = txtsenha.Text;
         DAO.Alt();
         btn_limpal_Click(sender, e);
     }
     catch { MessageBox.Show("Ocorreu algum erro, tente novamente"); }
 }
        public ActionResult EmiteBoletoAluno(int?IDAluno)
        {
            if (IDAluno != null)
            {
                AlunoDAO alunoDAO = new AlunoDAO();
                Aluno    aluno;
                aluno         = alunoDAO.BuscaPorId((int)IDAluno);
                ViewBag.Aluno = aluno;
                string boletoHTML = MontaBoletoHTML(ViewBag.Aluno);
                //boletoHTML = Regex.Replace(boletoHTML, @"\t|\n|\r", "");
                GeraBoletoArquivo(aluno);
                ViewBag.BoletoHTML = boletoHTML;
            }

            return(View());
        }
        public ActionResult AlteraAluno(int IDAluno)
        {
            if (IDAluno > 0)
            {
                SetarValoresDeCadastroNaViewBag();
                AlunoDAO alunoDAO = new AlunoDAO();
                Aluno    aluno    = new Aluno();
                aluno = alunoDAO.BuscaPorId(IDAluno);
                //alunoDAO.Adiciona(aluno);
                ViewBag.Aluno = aluno;

                return(View(aluno));
            }
            else
            {
                return(View("ListaGridAluno"));
            }
        }