Пример #1
0
 public IActionResult Delete(int id)
 {
     if (_urlService.Delete(id))
     {
         return(NoContent());
     }
     else
     {
         return(NotFound());
     }
 }
        public JsonResult UrlDelete(int urlId)
        {
            bool rtnResult  = false;
            var  resultData = _urlService.GetUrlById(urlId);

            if (resultData.Success)
            {
                if (resultData.Data.UserId == SessionUserId)
                {
                    _urlService.Delete(resultData.Data);
                    var sResultData = _urlSchedulerService.GetUrlSchedulerListByUrlId(urlId);
                    if (sResultData.Success)
                    {
                        _urlSchedulerService.Delete(sResultData.Data);
                        rtnResult = true;
                        _customScheduler.DeleteJob(setJob(resultData.Data, sResultData.Data));
                    }
                }
            }
            return(Json(rtnResult));
        }