コード例 #1
0
 public IActionResult Delete(string id)
 {
     try
     {
         if (SessionIsNull())
         {
             return(Redirect("/Home/Login?mustLogin=true&next=/Curriculum/Delete?id=" + id));
         }
         PlanService ser    = new PlanService();
         int         result = ser.DeleteCurriculum(id);
         SetViewBag();
         if (result == 1)
         {
             return(Redirect("/Curriculum/ViewCurriculum?delete_success=true"));
         }
         else
         {
             return(Redirect("/Curriculum/ViewCurriculum?delete_error=true"));
         }
     }
     catch (System.Exception)
     {
         return(Redirect("/Curriculum/ViewCurriculum?delete_error=true"));
     }
 }
コード例 #2
0
        public JsonResult DeleteCurriculum2(string id)
        {
            PlanService ser    = new PlanService();
            int         result = ser.DeleteCurriculum(id);

            SetViewBag();

            return(Json(result));
        }