public IActionResult Delete(string id) { try { if (SessionIsNull()) { return(Redirect("/Home/Login?mustLogin=true&next=/Level/Delete?id=" + id)); } PlanService ser = new PlanService(); int result = ser.DeleteNode(id); SetViewBag(); if (result == 1) { return(Redirect("/Level/ViewLevel?delete_success=true")); } else { return(Redirect("/Level/ViewLevel?delete_error=true")); } } catch (Exception) { return(Redirect("/Level/ViewLevel?delete_error=true")); } }