Exemple #1
0
        public ActionResult Delete(int[] ids)
        {
            try
            {
                if (ids.Length != 0)
                {
                    var numArray = ids;
                    for (var i = 0; i < numArray.Length; i++)
                    {
                        var num       = numArray[i];
                        var slideShow = _slideShowService.Get(x => x.Id == num);

                        _slideShowService.Delete(slideShow);

                        //Delete localize
                        var ieLocalizedProperty = _localizedPropertyService.GetByEntityId(num);

                        _localizedPropertyService.BatchDelete(ieLocalizedProperty);
                    }
                }
            }
            catch (Exception ex)
            {
                ExtentionUtils.Log(string.Concat("SlideShow.Delete: ", ex.Message));
            }

            return(RedirectToAction("Index"));
        }
        public async Task <ActionResult> Delete(int slideShowItemId)
        {
            _slideShowService.Delete(slideShowItemId);

            await _dbContext.SaveChangesAsync();

            return(new HttpStatusCodeResult(HttpStatusCode.OK));
        }
        public virtual async Task <ActionResult> DeleteSlide(long?id)
        {
            if (id == null)
            {
                return(Content(null));
            }
            _slideShowService.Delete(id.Value);
            await _unitOfWork.SaveChangesAsync();

            CacheManager.InvalidateChildActionsCache();
            return(Content("ok"));
        }
Exemple #4
0
 public virtual ActionResult DeleteSlide(int id)
 {
     _slideShowService.Delete(id);
     return(RedirectToAction("ListSlide"));
 }