Esempio n. 1
0
        //
        // GET: /File/Delete/5

        public ActionResult DeleteImage(int id, bool ajax = false)
        {
            if (files.ValidateImageID(id))
            {
                files.DeleteFile(id);
                if (ajax)
                {
                    return(Json(new { success = true }, JsonRequestBehavior.AllowGet));
                }
                return(RedirectToAction("Details", "Product", new { id = id }));
            }
            if (ajax)
            {
                return(Json(new { success = false }));
            }
            return(RedirectToAction("Index", "Category"));
        }