Ejemplo n.º 1
0
        public void aluno_matriculado_deve_constar_todos_os_valores_atribuidos()
        {
            var aluno = AlunoStub.AlunoValido;
            var e     = new AlunoMatriculado(aluno.EntityId, aluno);

            e.AggregateId.Should().Be(aluno.EntityId);
            e.Aluno.EntityId.Should().Be(aluno.EntityId);
            e.DataExecucao.Date.Should().Be(DateTime.Today);
        }
Ejemplo n.º 2
0
 public bool Incluir(AlunoMatriculado aluno)
 {
     try
     {
         using (var context = new glassDbEntities())
         {
             context.tb_aluno_matriculado.Add(aluno);
             context.SaveChanges();
             return(true);
         }
     }
     catch (Exception ex)
     {
         throw new Exception(ex.ToString());
     }
 }
Ejemplo n.º 3
0
 public AlunoMatriculado Editar(AlunoMatriculado aluno)
 {
     try
     {
         using (var context = new glassDbEntities())
         {
             var result = context.tb_aluno_matriculado.FirstOrDefault(x => x.Usuario == aluno.Usuario);
             result = aluno;
             context.SaveChanges();
             return(result);
         }
     }
     catch (Exception ex)
     {
         throw new Exception(ex.ToString());
     }
 }