public async Task <IActionResult> Edit(int id, [Bind("TestId,TestVersion,UserId,EcuId,Name,DateCreated,DateRun")] Test test) { if (id != test.TestId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(test); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TestExists(test.TestId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["EcuId"] = new SelectList(_context.Ecu, "EcuId", "EcuModel", test.EcuId); ViewData["UserId"] = new SelectList(_context.User, "UserId", "Email", test.UserId); return(View(test)); }
public async Task <IActionResult> Edit(int id, [Bind("UserId,FirstName,LastName,Password,Email,Privilege")] User user) { if (id != user.UserId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(user); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!UserExists(user.UserId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(user)); }
public async Task <IActionResult> Edit(int id, [Bind("BatchId,BatchVersion,TestId,TestVersion,ProcId,ReqId,Parameters,Passed,Order")] TestProc testProc) { if (id != testProc.TestId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(testProc); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TestProcExists(testProc.TestId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["BatchId"] = new SelectList(_context.Batch, "BatchId", "Status", testProc.BatchId); ViewData["ProcId"] = new SelectList(_context.Procedure, "ProcId", "Description", testProc.ProcId); ViewData["ReqId"] = new SelectList(_context.Requirement, "ReqId", "Description", testProc.ReqId); ViewData["TestId"] = new SelectList(_context.Test, "TestId", "TestId", testProc.TestId); return(View(testProc)); }
public async Task <IActionResult> Edit(int id, [Bind("BatchId,BatchVersion,TestId,TestVersion,Passed")] BatchTest batchTest) { if (id != batchTest.BatchId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(batchTest); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!BatchTestExists(batchTest.BatchId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["BatchId"] = new SelectList(_context.Batch, "BatchId", "Status", batchTest.BatchId); ViewData["TestId"] = new SelectList(_context.Test, "TestId", "TestId", batchTest.TestId); return(View(batchTest)); }
public async Task <IActionResult> Remove(int id, int version) { var batch = await _context.Batch.SingleOrDefaultAsync(m => (m.BatchId == id && m.BatchVersion == version)); _context.Update(batch); if (batch.Status.Equals("Complete")) { batch.Display = 0; } else if (batch.Status.Equals("Queued")) { batch.Status = "Made"; } await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Queues))); }