Ejemplo n.º 1
0
        public IActionResult CategoryDelete(int CategoryId)
        {
            var entity = _categoryServices.GetById(CategoryId);

            _categoryServices.Delete(entity);
            return(RedirectToAction("CategoryList"));
        }
Ejemplo n.º 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 }));
            }
        }
Ejemplo n.º 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));
            }
        }
Ejemplo n.º 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());
 }
Ejemplo n.º 10
0
 public IActionResult DeleteCategoryFromDb(int id)
 {
     _categoryServices.Delete(id);
     return(new JsonResult("success"));
 }
Ejemplo n.º 11
0
        public async Task <IActionResult> Delete(int id)
        {
            var rs = await _categoryServices.Delete(id);

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

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

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