public async Task <ActionResult> Delete(AboutViewModel model) { model.CreatedOn = DateTime.Now; await _aboutService.Delete(model); return(View()); }
public ActionResult DeleteConfirmed(int id) { About about = aboutservice.Find(id); aboutservice.Delete(about); this.uow.SaveChanges(); return(RedirectToAction("IndexAdmin", "About")); }
public IActionResult Delete(int id) { var result = aboutManager.Delete(id); if (result.Success) { return(Ok(result)); } return(BadRequest(result)); }
public IActionResult Delete(About about) { var result = _aboutService.Delete(about); if (result.Success) { return(View(result)); } return(BadRequest(result.Message)); }
public ActionResult Delete(int id) { try { _context.Delete(id); return(Ok()); } catch (Exception e) { return(StatusCode(StatusCodes.Status500InternalServerError, e.Message)); } }
public ActionResult Del(Guid?Id) { ResponseModel response = new ResponseModel(); if (Id != null) { About about = _aboutService.GetById(Id.Value); _aboutService.Delete(about); _unitOfWork.Commit(); response.Success = true; response.Msg = "删除成功!"; response.RedirectUrl = RedirectUrl; } else { response.Success = false; response.Msg = "无效的请求"; } return(Json(response, JsonRequestBehavior.AllowGet)); }