// GET: NotasFiscais public async Task <IActionResult> Index() { var applicationDbContext = await repositoryNota .GetAllAsync(x => true, x => x.TipoPagamento); return(View(applicationDbContext)); }
// GET: Enderecoes public async Task <IActionResult> Index() { var list = await repositoryEndereco .GetAllAsync(null, e => e.Cidade); return(View(list)); }
// GET: ItemNotas public async Task <IActionResult> Index() { var applicationDbContext = await repositoryItemNota .GetAllAsync(x => true, x => x.NotaFiscal, x => x.Produto); return(View(applicationDbContext)); }
// GET: Clientes public async Task <IActionResult> Index() { var applicationDbContext = await repositoryCliente .GetAllAsync(x => true, x => x.Endereco); return(View(applicationDbContext)); }
public async Task <IActionResult> Create([Bind("Id,Nome,Cpf,EnderecoId,Numero,Complemento,Password")] Pessoa pessoa) { if (ModelState.IsValid) { await repositoryPessoa.InsertAsync(pessoa); return(RedirectToAction(nameof(Index))); } ViewData["EnderecoId"] = new SelectList(await repositoryEndereco.GetAllAsync(), "Id", "Cep", pessoa.Id); return(View(pessoa)); }
// GET: NotasFiscais/Edit/5 public async Task <IActionResult> Edit(Guid?id) { if (id == null) { return(NotFound()); } var notaFiscal = await repositoryNota.GetAsync(id); if (notaFiscal == null) { return(NotFound()); } var list = await repositoryPagamento.GetAllAsync(); ViewData["TipoPagamentoId"] = new SelectList(repositoryPagamento.GetAll(), "Id", "Nome", notaFiscal.TipoPagamentoId); return(View(notaFiscal)); }
// GET: Cidades/Edit/5 public async Task <IActionResult> Edit(int?id) { if (id == null) { return(NotFound()); } var cidade = await repositoryCidade.GetAsync(id.Value); if (cidade == null) { return(NotFound()); } var list = await repositoryEstado.GetAllAsync(); ViewData["EstadoId"] = new SelectList(list, "Id", "Nome", cidade.EstadoId); return(View(cidade)); }
// GET: Produtos/Edit/5 public async Task <IActionResult> Edit(long?id) { if (id == null) { return(NotFound()); } var produto = await repositoryProduto.GetAsync(id.Value); if (produto == null) { return(NotFound()); } var list = await repositoryMarca.GetAllAsync(); ViewData["MarcaId"] = new SelectList(list, "Id", "Nome", produto.MarcaId); return(View(produto)); }
// GET: Clientes/Edit/5 public async Task <IActionResult> Edit(string id) { if (string.IsNullOrWhiteSpace(id)) { return(NotFound()); } var cliente = await repositoryCliente.GetAsync(id); if (cliente == null) { return(NotFound()); } var list = await repositoryEndereco.GetAllAsync(); ViewData["EnderecoId"] = new SelectList(repositoryEndereco.GetAll(), "Id", "Cep", cliente.EnderecoId); return(View(cliente)); }
// GET: Cidades public async Task <IActionResult> Index(int?id) { var applicationDbContext = await repositoryCidade.GetAllAsync(c => id == null || c.EstadoId == id, c => c.Estado); return(View(applicationDbContext)); }
// GET: Produtos public async Task <IActionResult> Index(int?id) { var applicationDbContext = await repositoryProduto.GetAllAsync(c => id == null || c.MarcaId == id, c => c.Marca); return(View(applicationDbContext)); }
// GET: FormaPagamentoes public async Task <IActionResult> Index() { var applicationDbContext = await repositoryFormaPagamento.GetAllAsync(); return(View(applicationDbContext)); }
// GET: TipoPagamentos public async Task <IActionResult> Index(int?id) { var applicationDbContext = await repositoryTipoPagamento.GetAllAsync(c => id == null || c.FormaPagamentoId == id, c => c.FormaPagamento); return(View(applicationDbContext)); }