예제 #1
0
        public IActionResult DeleteQuest(Quest questToDelete)
        {
            if (questToDelete == null)
            {
                ViewBag.ErrorMessage = "Sorry, there was an error in communication.";
                return(View($"Error"));
            }

            var questToDeleteFromDb = _questDAO.FindOneRecordBy(questToDelete.Id);

            _questDAO.DeleteRecord(questToDelete.Id);
            TempData["QuestMessage"] = $"You have deleted the \"{questToDeleteFromDb.Name}\" Quest!";
            return(RedirectToAction($"ViewAllQuests", $"Quest"));
        }
예제 #2
0
 public IActionResult Delete(Group groupToDelete)
 {
     _groupDAO.DeleteRecord(groupToDelete.Id);
     return(RedirectToAction("Index", "Group"));
 }