예제 #1
0
        public IActionResult CategoryDelete(int CategoryId)
        {
            var entity = _categoryServices.GetById(CategoryId);

            _categoryServices.Delete(entity);
            return(RedirectToAction("CategoryList"));
        }
예제 #2
0
        public IActionResult ArticleCategoryDeleteAdmin(int CategoryId)
        {
            var entity = _categoryServices.GetById(CategoryId);

            _categoryServices.Delete(entity);
            var name = entity.Tittle;

            TempData.Put("message", new AlertMessage()
            {
                Title     = "Kategori Silme",
                Message   = $"{name} Kategorisi Başarıyla Silindi",
                AlertType = "danger"
            });
            return(RedirectToAction("ArticleCategoryListAdmin"));
        }
        public async Task <ActionResult> Delete(long id)
        {
            #region Start the watch
            var watch = new Stopwatch();
            watch.Start();
            #endregion

            var result = await _entityServices.Delete(id);

            #region End the watch
            watch.Stop();
            result.Meta.TotalProcessingTime = watch.ElapsedMilliseconds;
            #endregion

            return(Ok(result));
        }
        public IActionResult CategoryDelete(int categoryId)
        {
            var entity = _categoryServices.GetById(categoryId);

            if (entity != null)
            {
                _categoryServices.Delete(entity);
            }

            var msg = new AlertMessage()
            {
                Message   = $"{entity.Name} isimli kategori silindi",
                AlertType = "danger"
            };

            TempData["message"] = JsonConvert.SerializeObject(msg);

            return(RedirectToAction("CategoryList"));
        }
        public ActionResult DeletedConfirmed(string categoryName)
        {
            var category = new CategoryViewModel();

            try
            {
                if (string.IsNullOrWhiteSpace(categoryName))
                {
                    ViewBag.Error = _localizer["EmptyReference"];
                    return(View(category));
                }

                _categoryServices.Delete(categoryName);

                return(RedirectToAction(nameof(Index)));
            }
            catch (Exception ex)
            {
                ViewBag.Error = ex.Message;
                return(RedirectToAction(nameof(Delete), "Category", new { categoryName }));
            }
        }
예제 #6
0
        public JsonResult Delete(int id)
        {
            if (id == 0)
            {
                return(Json(0));
            }
            var category = _categoryServices.GetById(id);

            if (category == null)
            {
                return(Json(0));
            }
            try
            {
                _categoryServices.Delete(category);
                return(Json(1));
            }
            catch (Exception)
            {
                return(Json(0));
            }
        }
예제 #7
0
        public async Task <JsonResult> Delete(int id)
        {
            var c = await _categoryServices.Delete(id);

            return(Json(new { isSuccess = true }));
        }
        public IResponseDTO Delete(int id)
        {
            var result = ServicesCategory.Delete(id);

            return(result);
        }
 public ActionResult Delete(int id)
 {
     _Categories.Delete(id);
     return(Ok());
 }
예제 #10
0
 public IActionResult DeleteCategoryFromDb(int id)
 {
     _categoryServices.Delete(id);
     return(new JsonResult("success"));
 }
예제 #11
0
        public async Task <IActionResult> Delete(int id)
        {
            var rs = await _categoryServices.Delete(id);

            return(CustJSonResult(rs));
        }
예제 #12
0
 public IActionResult Delete(int id)
 {
     ICategoryServices.Delete(id);
     return(RedirectToAction("Index"));
 }
예제 #13
0
        public HttpResponseMessage Delete(int id)
        {
            var cate = _categoryServices.GetById(id);

            return(ToJson(_categoryServices.Delete(cate)));
        }
예제 #14
0
 public async Task <bool> DeleteCategoryAsync(Guid categoryId)
 {
     CheckIfIdIsCorrectFormat(categoryId);
     return(await _categoryServices.Delete(categoryId));
 }
예제 #15
0
        public async Task <bool> DeleteCategoryAsync(string id)
        {
            var result = ValidateId(id);

            return(await _categoryServices.Delete(result));
        }