public async Task <IActionResult> Edit(int id, [Bind("TestExamId,TestExamType,TestExamResult,DateOfTestExam,ReaonForTestExam,MedCareLocationId")] TestsExams testsExams) { if (id != testsExams.TestExamId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(testsExams); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TestsExamsExists(testsExams.TestExamId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["MedCareLocationId"] = new SelectList(_context.MedCareLocation, "LocationId", "LocationCity", testsExams.MedCareLocationId); return(View(testsExams)); }
public async Task <IActionResult> Create([Bind("TestsExamsId,TestExamType,TestExamResult,DateOfTestExam,ReaonForTestExam,MedCareLocationId")] TestsExams testsExams) { if (ModelState.IsValid) { _context.Add(testsExams); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(testsExams)); }