예제 #1
0
        public ActionResult Delete(string banners, string returnUrl)
        {
            var idArray = banners.Split(',')
                          .Where(a => !string.IsNullOrEmpty(a))
                          .Select(a => a.ToInt32()).Distinct();

            foreach (var id in idArray)
            {
                var article = jlService.GetBanner(id);
                if (article != null)
                {
                    jlService.DeleteBanner(id);
                }
            }

            if (Url.IsLocalUrl(returnUrl))
            {
                return(Redirect(returnUrl));
            }
            return(RedirectToAction("index"));
        }