Ejemplo n.º 1
0
 public bool DeleteCourse(Course cour) //删除
 {
     if (courDal.Delete(cour) == -2)   //已经删除,不允许再次删除
     {
         return(false);
     }
     else
     {
         return(courDal.Delete(cour) > 0);
     }
 }
Ejemplo n.º 2
0
        public async Task <IActionResult> Delete(int id)
        {
            try
            {
                var result = await udal.Delete(id);

                if (result != null)
                {
                    return(Ok(new { status = false, message = result }));
                }
                else
                {
                    return(NotFound(new { status = false, message = "No record found!" }));
                }
            }
            catch (ExternalException e)
            {
                return(BadRequest(new { status = false, message = e.Message }));
            }
        }