コード例 #1
0
        public void DeletarAmbiente(int id)
        {
            Ambiente ambiente = Get(a => a.IdAmbiente == id, null, "RecursoAmbiente,AgendaAmbiente").FirstOrDefault();

            if (ambiente.AgendaAmbiente.Any())
            {
                throw new CustomException("Erro ao excluir Ambiente. Já existem turmas criadas com este Ambiente.");
            }
            if (ambiente.RecursoAmbiente.Any())
            {
                SPERepository <RecursoAmbiente> recursoAmbiente = new SPERepository <RecursoAmbiente>();

                recursoAmbiente.Delete(ambiente.RecursoAmbiente);
                recursoAmbiente.Save();
            }
            Delete(id);
        }
コード例 #2
0
ファイル: GenericBL.cs プロジェクト: wilckerson/SENAI-SPE
 public void SetTransactionScope(TransactionRepository transaction)
 {
     transactionScope = transaction;
     _generic         = new SPERepository <TEntity>(transactionScope);
 }