public async Task <IActionResult> Edit(long id, [Bind("LaboratoryTestId,LabTestCategoryName,LabTestName")] LaboratoryTest laboratoryTest) { if (id != laboratoryTest.LaboratoryTestId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(laboratoryTest); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!LaboratoryTestExists(laboratoryTest.LaboratoryTestId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(laboratoryTest)); }
public static Dictionary <string, string> GetDynamicParameters(this LaboratoryTest laboratoryTest) { if (laboratoryTest == null) { return(new Dictionary <string, string>()); } return(new Dictionary <string, string> { { "D003", laboratoryTest.Code?.Value }, { "D004", laboratoryTest.Code?.DisplayName }, { "D005", laboratoryTest.ResultValue?.Value }, { "D006", laboratoryTest.ResultValue?.Unit }, { "D012", laboratoryTest.DateRange?.DateLow?.Value }, { "D013", laboratoryTest.DateRange?.DateHigh?.Value }, { "D014", laboratoryTest.Code?.CodeSystem?.Value }, { "D015", laboratoryTest.Code?.CodeSystemName }, { "D016", laboratoryTest.DataSubType }, { "D017", laboratoryTest.ResultValue?.Code?.Value }, { "D018", laboratoryTest.ResultValue?.Code?.DisplayName }, { "D019", laboratoryTest.ResultValue?.Type.ToString() }, { "D020", laboratoryTest.ResultValue?.Code?.CodeSystem?.Value }, { "D022", laboratoryTest.Reason?.Value }, { "D023", laboratoryTest.Reason?.CodeSystem?.Value } }); }
public async Task <IActionResult> Create([Bind("LaboratoryTestId,LabTestCategoryName,LabTestName")] LaboratoryTest laboratoryTest) { if (ModelState.IsValid) { _context.Add(laboratoryTest); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(laboratoryTest)); }