Exemplo n.º 1
0
 public void Initilaze()
 {
     BaseSqlTest.SeedDeleteDatabase();
     BaseSqlTest.SeedInsertDatabase();
     _repository = new VendaSqlRepository();
     _service    = new VendaService(_repository);
 }
Exemplo n.º 2
0
 public VendaAppService(IUnitOfWork uow, IVendaService service, IDiscoVendaAppService discoVendaAppService, IDiscoAppService discoAppService, ICashBackAppService cashBackAppService, IMapper mapper) : base(uow, service, mapper)
 {
     _service = service;
     _discoVendaAppService = discoVendaAppService;
     _discoAppService      = discoAppService;
     _cashBackAppService   = cashBackAppService;
 }
Exemplo n.º 3
0
 public VendaTask(IVendaService vendaService)
 {
     _vendaService                 = vendaService;
     CaminhoPastaDeVendas          = ConfigurationManager.AppSettings["CaminhoPastaVendas"];
     CaminhoPastaDeVendasValidas   = ConfigurationManager.AppSettings["CaminhoPastaVendasValidas"];
     CaminhoPastaDeVendasInvalidas = ConfigurationManager.AppSettings["CaminhoPastaVendasInvalidas"];
 }
Exemplo n.º 4
0
 public VendaController(ICategoriaRepository categoriaRepository, IProdutoRepository produtoRepository, IVendaRepository vendaRepository, IVendaService vendaService, IVendaMapper vendaMapper)
 {
     _categoriaRepository = categoriaRepository;
     _produtoRepository   = produtoRepository;
     _vendaRepository     = vendaRepository;
     _vendaService        = vendaService;
     _vendaMapper         = vendaMapper;
 }
 public JobsController(ApplicationDbContext dbContext, INotaFiscalService notaFiscalService,
                       IEmailService emailService, IVendaService vendaService)
 {
     _dbContext         = dbContext;
     _notaFiscalService = notaFiscalService;
     _emailService      = emailService;
     _vendaService      = vendaService;
 }
Exemplo n.º 6
0
 public VendasController(IMapper mapper,
                         IVendaService vendaService,
                         IVendaRepository vendaRepository,
                         IClienteRepository clienteRepository,
                         INotificador notificador) : base(notificador)
 {
     _mapper          = mapper;
     _vendaService    = vendaService;
     _vendaRepository = vendaRepository;
 }
Exemplo n.º 7
0
        public Form1(IVendaService vendaService)
        {
            InitializeComponent();
            _service = vendaService;

            CaminhoPastaDeVendas          = ConfigurationManager.AppSettings["CaminhoPastaVendas"];
            CaminhoPastaDeVendasValidas   = ConfigurationManager.AppSettings["CaminhoPastaVendasValidas"];
            CaminhoPastaDeVendasInvalidas = ConfigurationManager.AppSettings["CaminhoPastaVendasInvalidas"];

            PopularListas();
        }
Exemplo n.º 8
0
 public VendasController(IVendaService vendaService,
                         UserManager <IdentityUser> userManager,
                         IVendaRepository vendaRepository,
                         IMapper mapper,
                         INotificador notificador,
                         IUser user) : base(notificador, user)
 {
     _vendaRepository = vendaRepository;
     _vendaService    = vendaService;
     _mapper          = mapper;
     _userManager     = userManager;
 }
Exemplo n.º 9
0
        public async Task <IActionResult> TransportadoraEntregarVenda(int Id, [FromServices] IVendaService service)
        {
            try
            {
                await service.TransportadoraEntregarVenda(Id);

                return(Ok("Produto entregue com sucesso!"));
            }
            catch (Exception e)
            {
                return(BadRequest(e));
            }
        }
 public VendasController(IVendaRepository vendaRepository,
                         IVendaService vendaService,
                         IProdutoRepository produtoRepository,
                         IClienteRepository clienteRepository,
                         IMapper mapper,
                         INotificador notificador) : base(notificador)
 {
     _vendaRepository   = vendaRepository;
     _vendaService      = vendaService;
     _produtoRepository = produtoRepository;
     _clienteRepository = clienteRepository;
     _mapper            = mapper;
 }
Exemplo n.º 11
0
        public async Task <IActionResult> CancelarVenda(int Id, [FromServices] IVendaService service)
        {
            try
            {
                await service.CancelarVenda(Id);

                return(Ok("Venda cancelada com sucesso!"));
            }
            catch (Exception e)
            {
                return(BadRequest(e));
            }
        }
Exemplo n.º 12
0
        public LojaDiscoController(IAlbumService albumService, IPrecoService precoService, IVendaService vendaService)
        {
            _albumService = albumService;
            _precoService = precoService;
            _vendaService = vendaService;

            var precos = _precoService.ListaPrecos();

            if (precos.Count() == 0)
            {
                _precoService.GravarPrecoAlbum();
            }
        }
Exemplo n.º 13
0
        public async Task <IActionResult> PagamentoAprovado(int Id, [FromServices] IVendaService service)
        {
            try
            {
                await service.PagamentoAprovado(Id);

                return(Ok("Pagamento aprovado com sucesso!"));
            }
            catch (Exception e)
            {
                return(BadRequest(e));
            }
        }
Exemplo n.º 14
0
        public async Task <IActionResult> EnviarVendaParaTransportadora(int Id, [FromServices] IVendaService service)
        {
            try
            {
                await service.EnviarVendaParaTransportadora(Id);

                return(Ok("Pagamento enviado para a transportadora com sucesso!"));
            }
            catch (Exception e)
            {
                return(BadRequest(e));
            }
        }
Exemplo n.º 15
0
        public async Task <IActionResult> Nova([FromServices] IVendaService service)
        {
            var tsc = new TaskCompletionSource <IActionResult>();

            try
            {
                var result = service.NovaVenda();

                tsc.SetResult(RetornoHelper.CreateResponse(result, 200));
            }
            catch (Exception e)
            {
                tsc.SetResult(RetornoHelper.CreateResponse(e.Message, 500));
            }
            return(await tsc.Task);
        }
Exemplo n.º 16
0
        public async Task <IActionResult> removerItem([FromServices] IVendaService service, [FromBody] RemoverItemRequest req)
        {
            var tsc = new TaskCompletionSource <IActionResult>();

            try
            {
                service.RemoverItem(req.VendaId, req.ItemId);

                tsc.SetResult(RetornoHelper.CreateResponse("OK", 200));
            }
            catch (Exception e)
            {
                tsc.SetResult(RetornoHelper.CreateResponse(e.Message, 500));
            }
            return(await tsc.Task);
        }
Exemplo n.º 17
0
 public VendaController(IVendaService service)
 {
     _service = service;
 }
 public VendaController(IVendaService vendaService)
 {
     _vendaService = vendaService;
 }
Exemplo n.º 19
0
 public VendaController(IVendaService vendaApplication, IMapper mapper) : base(mapper, vendaApplication, NOME_SERVICO)
 {
     _vendaApplication = vendaApplication;
     _mapper           = mapper;
 }
Exemplo n.º 20
0
 /// <summary>
 /// Construtor da Classe
 /// </summary>
 /// <param name="vendaservice"></param>
 public CompraController(IVendaService vendaservice)
 {
     _vendaService = vendaservice;
 }
Exemplo n.º 21
0
        public VendaServiceTests()
        {
            sqlAdapterMock = new Mock <IVendaSqlAdapter>();

            vendaService = new VendaService(sqlAdapterMock.Object);
        }
Exemplo n.º 22
0
 public void Initialize()
 {
     service = new VendaService(vendaRepository, impostoRepository, veiculoRepository);
 }
Exemplo n.º 23
0
 public VendasController(IVendaService vendaService)
 {
     this._vendaService = vendaService;
 }
Exemplo n.º 24
0
 public VendaAppService(IVendaService vendaService)
     : base(vendaService)
 {
     _vendaService = vendaService;
 }
Exemplo n.º 25
0
 public VendaController(IVendaService vendaService,
                        IMapper mapper)
 {
     _vendaService = vendaService;
     _mapper       = mapper;
 }
Exemplo n.º 26
0
 public VendaAppService(IVendaService vendaService)
 {
     this.vendaService = vendaService;
 }
Exemplo n.º 27
0
 public VendaAppService(IVendaService service, IProdutoService serviceProduto, IClienteService serviceCliente)
 {
     this._service        = service;
     this._serviceProduto = serviceProduto;
     this._serviceCliente = serviceCliente;
 }
Exemplo n.º 28
0
 public VendasController(IVendaService service) : base(service)
 {
     this.service = service;
 }
Exemplo n.º 29
0
 public VendaController(IVendaService vendaService)
 {
     _vendaService = vendaService;
 }
Exemplo n.º 30
0
 public LivrosController(IAnuncioService anuncioService, IUsuarioService usuarioService, IVendaService vendaService)
 {
     _anuncioService = anuncioService;
     _usuarioService = usuarioService;
     _vendaService   = vendaService;
 }
Exemplo n.º 31
0
 public HomeController(ApplicationDbContext context, INotaFiscalService notaFiscalService, IVendaService vendaService)
 {
     _context           = context;
     _notaFiscalService = notaFiscalService;
     _vendaService      = vendaService;
 }