示例#1
0
 public PartialViewResult Edit(int id)
 {
     aluno a = new aluno();
     if (id != 0)
     {
         a = alunoModel.obterAluno(id);
     }
     return PartialView(a);
 }
示例#2
0
 public void InicializarTest()
 {
     aluno1 = new aluno()
     {
         IdAluno = 1,
         Nome = "AlunoTeste1",
         CPF = "11111111111",
         Matricula = "11111111"
     };
 }
示例#3
0
 public void Garantir_Que_2_Alunos_Sao_Iguais_Quando_Tem_Mesmo_Login()
 {
     aluno2 = new aluno()
     {
         IdAluno = 2,
         Nome = "AlunoTeste1",
         CPF = "22222222222",
         Matricula = "22222222"
     };
     Assert.AreEqual(aluno1.Nome, aluno2.Nome);
 }
示例#4
0
 public void Garantir_Que_2_Alunos_Sao_Iguais_Quando_Tem_Mesmo_Id()
 {
     aluno2 = new aluno()
     {
         IdAluno = 1,
         Nome = "AlunoTeste2",
         CPF = "22222222222",
         Matricula = "22222222"
     };
     Assert.AreEqual(aluno1.IdAluno, aluno2.IdAluno);
 }
示例#5
0
 public ActionResult Edit(aluno a)
 {
     string erro = null;
     if (a.IdAluno == 0)
         erro = alunoModel.adicionarAluno(a);
     else
         erro = alunoModel.editarAluno(a);
     if (erro == null)
     {
         return RedirectToAction("Index");
     }
     else
     {
         ViewBag.Erro = erro;
         return View(a);
     }
 }
示例#6
0
 /// <summary>
 /// Deprecated Method for adding a new object to the Aluno EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToAluno(aluno aluno)
 {
     base.AddObject("Aluno", aluno);
 }
示例#7
0
 /// <summary>
 /// Create a new aluno object.
 /// </summary>
 /// <param name="idAluno">Initial value of the IdAluno property.</param>
 /// <param name="nome">Initial value of the Nome property.</param>
 /// <param name="cPF">Initial value of the CPF property.</param>
 /// <param name="matricula">Initial value of the Matricula property.</param>
 public static aluno Createaluno(global::System.Int32 idAluno, global::System.String nome, global::System.String cPF, global::System.String matricula)
 {
     aluno aluno = new aluno();
     aluno.IdAluno = idAluno;
     aluno.Nome = nome;
     aluno.CPF = cPF;
     aluno.Matricula = matricula;
     return aluno;
 }