public async Task <IActionResult> Cadastro() { var vendedores = await _vendedorService.FindAllAsync(); var viewModel = new VendaFormViewModel { Vendedores = vendedores }; return(View(viewModel)); }
// GET: Vendas/Create public async Task <IActionResult> Create() { var clientes = await _clienteService.FindAllAsync(); var vendedores = await _vendedorService.FindAllAsync(); var formapagtos = await _formaPagtoService.FindAllAsync(); var produtos = await _produtoService.FindAllAsync(); var vwModel = new VendasFormViewModel { Clientes = clientes, Vendedores = vendedores, FormaPagtos = formapagtos, Produtos = produtos }; return(View(vwModel)); }
// GET: Vendedores public async Task <IActionResult> Index() { var vendlist = await _vendedorService.FindAllAsync(); return(View(vendlist)); }
public async Task <IActionResult> Index() { var list = await _vendedorSevice.FindAllAsync(); // Retorna a lista de vendedores para a View return(View(list)); }
public async Task <IActionResult> Index() { var list = await _vendedorService.FindAllAsync(); //Puxar a lista do VendedorService return(View(list)); }
// Operacao assincrona public async Task <IActionResult> Index() //1. O controlador foi chamado { var list = await _vendedorService.FindAllAsync(); //2. Retorna uma lista de vendedores return(View(list)); //3. Passa a lista como um argumento }
public async Task <IActionResult> Index() { var list = await _vendedorService.FindAllAsync(); return(View(list));// vai gerar a lista na index }