Ejemplo n.º 1
0
        public async Task <IActionResult> Delete(int?id)
        {
            if (id == null)
            {
                @TempData["Error"] = @Resources.Exceptions.notCorrectRequest;
                return(RedirectToAction("Error", "Home"));
            }
            var coach = await _сoachService.GetByIdAsNoTrack((int)id);

            if (coach == null)
            {
                @TempData["Error"] = @Resources.Exceptions.notCorrectRequest;
                return(RedirectToAction("Error", "Home"));
            }
            await _сoachService.Delete(coach, true);

            return(RedirectToAction("Index"));
        }
Ejemplo n.º 2
0
 /// <summary>
 /// 删除
 /// </summary>
 /// <param name="ids"></param>
 /// <returns></returns>
 public ActionResult Delete(string ID)
 {
     return(JResult(ICoachService.Delete(ID)));
 }
Ejemplo n.º 3
0
 public ActionResult DeleteConfirmed(int?id)
 {
     service.Delete(id);
     return(RedirectToAction("AllCoaches"));
 }
Ejemplo n.º 4
0
 public ActionResult DeleteConfirm(int id)
 {
     _service.Delete(id);
     return(RedirectToAction("Index"));
 }