コード例 #1
0
 public void Salvar(tb_grade _grade)
 {
     try
     {
         _DAO.Add(_grade);
         _DAO.SaveChanges();
     }
     catch (Exception ex)
     {
         throw new Exception("Erro ao salvar grade." + ex.Message);
     }
 }
コード例 #2
0
 public void Deletar(tb_grade _grade)
 {
     try
     {
         _grade = _DAO.Find(g => g.cod_grade == _grade.cod_grade).First <tb_grade>();
         _DAO.Delete(_grade);
         _DAO.SaveChanges();
     }
     catch (Exception ex)
     {
         throw new Exception("Não possível excluir grade." + ex.Message);
     }
 }