예제 #1
0
파일: Oferta.cs 프로젝트: hmattoso/scc
 public Oferta(Anunciante anunciante, string tipoOferta, Endereco enderecoOferta, DateTime inicio, DateTime fim, string tituloOferta, string descritivoOferta, string imagem)
 {
     this.anunciante = anunciante;
     this.tipoOferta = tipoOferta == "Serviço" ? TipoOferta.SERVICO : TipoOferta.PRODUTO;
     this.enderecoOferta = enderecoOferta;
     this.Inicio = inicio;
     this.Fim = fim;
     this.Titulo = tituloOferta;
     this.Descritivo = descritivoOferta;
     this.Imagem = imagem;
 }
예제 #2
0
        public void CadastrarAnunciante(Anunciante anunciante)
        {
            IRepositorioAnunciante repo = FactoryRepository.getInstance.criarRepositorioAnunciante();

            repo.IniciarTransacao();
            try
            {
                repo.Salvar(anunciante);
                repo.FinalizarTransacao();
            }
            catch (Exception)
            {
                repo.CancelarTransacao();
                throw;
            }
        }
예제 #3
0
        public void cadastrar_anunciante()
        {
            Anunciante anunciante = new Anunciante()
            {
                CNPJ = "03.847.655/0001-98",
                Nome = "PUBLICADOR S/A",
                NomeFantasia = "PUBLIQUE",
                InscricaoEstadual = "12345",
                InscricaoMunicipal = "123456",
                WebSite = "www.publique.com.br",
                Contato = new Contato() { Email = "*****@*****.**", TelefoneCelular = "2178510959", TelefoneFixo = "2126972802" },
                Login = new Login() { Usuario = "hmattoso", Senha = "54321", Bloqueado = false }
            };

            IServicoAnunciante servicoAnunciante = FactoryService.getInstance.criarServicoAnunciante();
            servicoAnunciante.CadastrarAnunciante(anunciante);

            Anunciante anuncianteGravado = ConsultaService.ObterUm<Anunciante>(a => a.Login.Usuario == "hmattoso");

            Assert.AreEqual(anunciante.Id, anuncianteGravado.Id);
        }
예제 #4
0
 public void CadastrarAnunciante(AnuncianteContract anuncianteContract)
 {
     Anunciante anunciante = new Anunciante(anuncianteContract.CNPJ, anuncianteContract.NomeFantasia, anuncianteContract.Nome, anuncianteContract.InscricaoMunicipal, anuncianteContract.InscricaoEstadual, anuncianteContract.WebSite);
     IServicoAnunciante servicoAnunciante = FactoryService.getInstance.criarServicoAnunciante();
     servicoAnunciante.CadastrarAnunciante(anunciante);
 }