Exemplo n.º 1
0
        public async Task <IActionResult> Edit(int id)
        {
            var model = await _repo.Item(id);

            if (model == null)
            {
                return(NotFound());
            }
            ViewData["Users"] = new SelectList(_user.Users, "Id", "Email");
            return(View(model));
        }
Exemplo n.º 2
0
        public async Task <IActionResult> Create(int freightId)
        {
            Freight freight = await _repoX.Item(freightId);

            if (freight != null)
            {
                InvoiceViewModel ivm = new InvoiceViewModel
                {
                    Freight = freight,
                    Invoice = new Invoice()
                };
                return(View(ivm));
            }
            return(NotFound());
        }