예제 #1
0
 public override IEnumerable <ProdutoModel> List(long idEmpresa)
 {
     try
     {
         return(_report.List(idEmpresa));
     }
     catch (Exception ex)
     {
         Logger.Log.Error(ex);
         throw;
     }
 }
예제 #2
0
파일: TestBase.cs 프로젝트: lsgolt94/SpaWeb
        protected void DeleteEmpresa()
        {
            EmpresaModel empresa = repoEmpresa.FindIncludingAll(_empresa.Id);

            var atendimentos = reportAtendimento.Relatorio(empresa.Id, null, null, null, null, null, null, null, null);

            if (atendimentos != null)
            {
                atendimentos.ForEach(a => repoAtendimento.Delete(a.Id));
            }

            var clientes = reportCliente.List(empresa.Id);

            if (clientes != null)
            {
                clientes.ToList().ForEach(a => repoCliente.Delete(a.Id));
            }

            var origens = reportOrigem.List(empresa.Id);

            if (origens != null)
            {
                origens.ToList().ForEach(a => repoOrigem.Delete(a.Id));
            }

            var funcionarios = reportFuncionario.List(empresa.Id);

            if (funcionarios != null)
            {
                funcionarios.ToList().ForEach(a => repoFuncionario.Delete(a.Id));
            }

            var servicos = reportServico.List(empresa.Id);

            if (servicos != null)
            {
                servicos.ToList().ForEach(a => repoServico.Delete(a.Id));
            }

            var produtos = reportProduto.List(empresa.Id);

            if (produtos != null)
            {
                produtos.ToList().ForEach(a => repoProduto.Delete(a.Id));
            }

            if (empresa.IsNotNull())
            {
                repoEmpresa.Delete(_empresa.Id);
            }
        }