示例#1
0
        public async Task <IActionResult> Edit(int id, [Bind("PurchaseOrderId,LineNumber,ProductId")] FileTransactions fileTransactions)
        {
            if (id != fileTransactions.PurchaseOrderId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(fileTransactions);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!FileTransactionsExists(fileTransactions.PurchaseOrderId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(fileTransactions));
        }
示例#2
0
        public async Task <IActionResult> Create([Bind("PurchaseOrderId,LineNumber,ProductId")] FileTransactions fileTransactions)
        {
            if (ModelState.IsValid)
            {
                _context.Add(fileTransactions);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(fileTransactions));
        }