public async Task <IActionResult> Edit(int id, [Bind("StudyStatusId,StudyStatusDesc")] StudyStatus studyStatus) { if (id != studyStatus.StudyStatusId) { return(RedirectToAction("Index", "Errors")); } if (ModelState.IsValid) { try { _context.Update(studyStatus); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!StudyStatusExists(studyStatus.StudyStatusId)) { return(RedirectToAction("Index", "Errors")); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(studyStatus)); }
public Study(string institution, string title, StudyStatus status) { Institution = institution; Title = title; Status = status; Validate(); }
public async Task <IActionResult> Create([Bind("StudyStatusId,StudyStatusDesc")] StudyStatus studyStatus) { if (ModelState.IsValid) { _context.Add(studyStatus); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(studyStatus)); }