예제 #1
0
        public ActionResult Delete(string id)
        {
            EditModel pm = EditModel.GetById(new Guid(id), true);

            try {
                if (pm.DeleteAll())
                {
                    SuccessMessage(Piranha.Resources.Page.MessageDeleted, true);
                }
                else
                {
                    ErrorMessage(Piranha.Resources.Page.MessageNotDeleted, true);
                }
            } catch (Exception e) {
                ErrorMessage(e.ToString(), true);
            }
            // Get the site page for the deleted page so we position ourselves correctly
            var p = Page.GetSingle("page_parent_id=@0", pm.Page.SiteTreeId);

            if (p != null)
            {
                return(RedirectToAction("index", new { id = p.Id }));
            }
            return(RedirectToAction("index"));
        }
예제 #2
0
        public ActionResult Delete(string id)
        {
            EditModel m = EditModel.GetById(new Guid(id));

            if (m.DeleteAll())
            {
                SuccessMessage(Piranha.Resources.Category.MessageDeleted);
            }
            else
            {
                ErrorMessage(Piranha.Resources.Category.MessageNotDeleted);
            }
            return(RedirectToAction("index"));
        }
예제 #3
0
        public ActionResult Delete(string id)
        {
            EditModel pm = EditModel.GetById(new Guid(id));

            if (pm.DeleteAll())
            {
                SuccessMessage(Piranha.Resources.Post.MessageDeleted);
            }
            else
            {
                ErrorMessage(Piranha.Resources.Post.MessageNotDeleted);
            }

            return(Index());
        }
예제 #4
0
        public ActionResult Delete(string id)
        {
            EditModel m = EditModel.GetById(new Guid(id));

            if (m.DeleteAll())
            {
                if (m.Content.IsImage)
                {
                    SuccessMessage(Piranha.Resources.Content.MessageImageDeleted, true);
                }
                else if (m.Content.IsFolder)
                {
                    SuccessMessage(Piranha.Resources.Content.MessageFolderDeleted, true);
                }
                else
                {
                    SuccessMessage(Piranha.Resources.Content.MessageDocumentDeleted, true);
                }
            }
            else
            {
                if (m.Content.IsImage)
                {
                    ErrorMessage(Piranha.Resources.Content.MessageImageNotDeleted, true);
                }
                else if (m.Content.IsFolder)
                {
                    ErrorMessage(Piranha.Resources.Content.MessageFolderNotDeleted, true);
                }
                else
                {
                    ErrorMessage(Piranha.Resources.Content.MessageDocumentNotDeleted, true);
                }
            }
            if (!String.IsNullOrEmpty(ViewBag.ReturnUrl))
            {
                return(Redirect(ViewBag.ReturnUrl));
            }
            if (m.Content.ParentId != Guid.Empty)
            {
                return(RedirectToAction("index", new { id = m.Content.ParentId }));
            }
            return(RedirectToAction("index"));
        }
예제 #5
0
        public ActionResult Delete(string id)
        {
            EditModel pm = EditModel.GetById(new Guid(id));

            if (pm.DeleteAll())
            {
                SuccessMessage(Piranha.Resources.Post.MessageDeleted, true);
            }
            else
            {
                ErrorMessage(Piranha.Resources.Post.MessageNotDeleted, true);
            }

            if (!String.IsNullOrEmpty(ViewBag.ReturnUrl))
            {
                return(Redirect(ViewBag.ReturnUrl));
            }
            return(RedirectToAction("index"));
        }
예제 #6
0
        public ActionResult Delete(string id)
        {
            EditModel pm = EditModel.GetById(new Guid(id), true);

            try {
                if (pm.DeleteAll())
                {
                    SuccessMessage(Piranha.Resources.Page.MessageDeleted);
                }
                else
                {
                    ErrorMessage(Piranha.Resources.Page.MessageNotDeleted);
                }
            } catch (Exception e) {
                ErrorMessage(e.ToString());
            }

            return(Index());
        }
예제 #7
0
        public ActionResult Delete(string id)
        {
            EditModel m = EditModel.GetById(new Guid(id));

            if (m.DeleteAll())
            {
                if (m.Content.IsImage)
                {
                    SuccessMessage(Piranha.Resources.Content.MessageImageDeleted);
                }
                else if (m.Content.IsFolder)
                {
                    SuccessMessage(Piranha.Resources.Content.MessageFolderDeleted);
                }
                else
                {
                    SuccessMessage(Piranha.Resources.Content.MessageDocumentDeleted);
                }
            }
            else
            {
                if (m.Content.IsImage)
                {
                    ErrorMessage(Piranha.Resources.Content.MessageImageNotDeleted);
                }
                else if (m.Content.IsFolder)
                {
                    ErrorMessage(Piranha.Resources.Content.MessageFolderNotDeleted);
                }
                else
                {
                    ErrorMessage(Piranha.Resources.Content.MessageDocumentNotDeleted);
                }
            }
            return(Index());
        }