コード例 #1
0
        public async Task <ActionResult> Delete(AboutViewModel model)
        {
            model.CreatedOn = DateTime.Now;
            await _aboutService.Delete(model);

            return(View());
        }
コード例 #2
0
        public ActionResult DeleteConfirmed(int id)
        {
            About about = aboutservice.Find(id);

            aboutservice.Delete(about);
            this.uow.SaveChanges();
            return(RedirectToAction("IndexAdmin", "About"));
        }
コード例 #3
0
        public IActionResult Delete(int id)
        {
            var result = aboutManager.Delete(id);

            if (result.Success)
            {
                return(Ok(result));
            }
            return(BadRequest(result));
        }
コード例 #4
0
        public IActionResult Delete(About about)
        {
            var result = _aboutService.Delete(about);

            if (result.Success)
            {
                return(View(result));
            }
            return(BadRequest(result.Message));
        }
コード例 #5
0
 public ActionResult Delete(int id)
 {
     try
     {
         _context.Delete(id);
         return(Ok());
     }
     catch (Exception e)
     {
         return(StatusCode(StatusCodes.Status500InternalServerError, e.Message));
     }
 }
コード例 #6
0
        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));
        }