public IActionResult Create(int?id) { if (id == null) { return(NotFound()); } var token = HttpContext.Session.GetString("biodata_details_token"); if (string.IsNullOrEmpty(token)) { return(RedirectToAction(nameof(Index), "Biodata")); } TblBiodata _Biodata = biodata.GetById(id); LabTestDetailsViewModel _labTest = new LabTestDetailsViewModel(_Biodata, methods, specimen); ViewData["Results"] = results; ViewData["Method"] = new SelectList(methods.GetAll(), "Id", "Methodname"); /* ViewData["Biodata"] = new SelectList(_context.TblBiodata, "Id", "Fullname"); * ViewData["Method"] = new SelectList(_context.TlkpTestMethods, "Id", "InsertBy");*/ return(View(_labTest)); }
// GET: Biodata/Details/5 public async Task <IActionResult> Details(int?id) { if (id == null) { return(NotFound()); } var tblBiodata = biodata.GetById(id); HttpContext.Session.SetString("biodata_details_token", "biodata_details_token"); /*var tblBiodata = await _context.TblBiodata * .Include(t => t.GenderNavigation) * .FirstOrDefaultAsync(m => m.Id == id);*/ if (tblBiodata == null) { return(NotFound()); } if (!TryValidateModel(tblBiodata)) { ViewBag.BiodataNotValidated = true; } return(View(tblBiodata)); }