public bool ModifyCourse(Course cour) //修改 { if (courDal.Update(cour) == -2) //已经删除,不允许修改 { return(false); } else { return(courDal.Update(cour) > 0); } }
public async Task <IActionResult> Put(int id, [FromBody] Courses courses) { var result = await udal.Update(id, courses); if (result != null) { return(Ok(new { status = true, Id = result, message = "Successfully Update the enrolled course", })); } else { return(BadRequest(new { status = true, message = "Invalid Input" })); } }