Exemple #1
0
        public virtual ActionResult CrossPageSort(ContentSorter sourceContent, string folderName, int?page, int?pageSize, bool up = true)
        {
            var data = new JsonResultData(ModelState);

            data.RunWithTry((resultData) =>
            {
                var textFolder = new TextFolder(Repository, folderName);
                var content    = new TextFolder(Repository, folderName).CreateQuery().WhereEquals("UUID", sourceContent.UUID).FirstOrDefault();

                TextContent destContent;
                if (up)
                {
                    destContent = content.Previous();
                }
                else
                {
                    destContent = content.Next();
                }
                if (destContent != null)
                {
                    TextContentManager.Update(textFolder, sourceContent.UUID, "Sequence", destContent["Sequence"], User.Identity.Name);
                    TextContentManager.Update(textFolder, destContent.UUID, "Sequence", content["Sequence"], User.Identity.Name);
                }
            });
            return(Json(data));
        }
Exemple #2
0
        public virtual ActionResult CrossPageSort(ContentSorter sourceContent, string folderName, int?page, int?pageSize, bool up = true)
        {
            var entry = new JsonResultEntry();

            try
            {
                //page = page ?? 1;
                //pageSize = pageSize ?? 50;
                var textFolder = new TextFolder(Repository, folderName);
                var content    = new TextFolder(Repository, folderName).CreateQuery().WhereEquals("UUID", sourceContent.UUID).FirstOrDefault();

                TextContent destContent;
                if (up)
                {
                    destContent = content.Previous();
                }
                else
                {
                    destContent = content.Next();
                }
                if (destContent != null)
                {
                    ServiceFactory.TextContentManager.Update(textFolder, sourceContent.UUID, "Sequence", destContent["Sequence"], User.Identity.Name);
                    ServiceFactory.TextContentManager.Update(textFolder, destContent.UUID, "Sequence", content["Sequence"], User.Identity.Name);
                }
            }
            catch (Exception e)
            {
                entry.AddException(e);
            }
            return(Json(entry));
        }
Exemple #3
0
        public virtual ActionResult CrossPageSort(ContentSorter sourceContent, string folderName, int? page, int? pageSize, bool up = true)
        {
            var entry = new JsonResultEntry();
            try
            {
                //page = page ?? 1;
                //pageSize = pageSize ?? 50;
                var textFolder = new TextFolder(Repository, folderName);
                var content = new TextFolder(Repository, folderName).CreateQuery().WhereEquals("UUID", sourceContent.UUID).FirstOrDefault();

                TextContent destContent;
                if (up)
                {
                    destContent = content.Previous();
                }
                else
                {
                    destContent = content.Next();
                }
                if (destContent != null)
                {
                    ServiceFactory.TextContentManager.Update(textFolder, sourceContent.UUID, "Sequence", destContent["Sequence"], User.Identity.Name);
                    ServiceFactory.TextContentManager.Update(textFolder, destContent.UUID, "Sequence", content["Sequence"], User.Identity.Name);
                }
            }
            catch (Exception e)
            {
                entry.AddException(e);
            }
            return Json(entry);
        }
Exemple #4
0
        public virtual ActionResult Sort(ContentSorter[] list, string folderName)
        {
            var data = new JsonResultData(ModelState);

            data.RunWithTry((resultData) =>
            {
                TextFolder textFolder = new TextFolder(Repository, folderName).AsActual();
                var schema = textFolder.GetSchema().AsActual();
                foreach (var c in list)
                {
                    TextContentManager.Update(Repository, schema, c.UUID, new string[] { "Sequence" }, new object[] { c.Sequence }, User.Identity.Name);
                }
                resultData.ReloadPage = true;
            });

            return Json(data);
        }
Exemple #5
0
        public virtual ActionResult CrossPageSort(ContentSorter sourceContent, string folderName, int? page, int? pageSize, bool up = true)
        {
            var data = new JsonResultData(ModelState);
            data.RunWithTry((resultData) =>
            {
                var textFolder = new TextFolder(Repository, folderName);
                var content = new TextFolder(Repository, folderName).CreateQuery().WhereEquals("UUID", sourceContent.UUID).FirstOrDefault();

                TextContent destContent;
                if (up)
                {
                    destContent = content.Previous();
                }
                else
                {
                    destContent = content.Next();
                }
                if (destContent != null)
                {
                    TextContentManager.Update(textFolder, sourceContent.UUID, "Sequence", destContent["Sequence"], User.Identity.Name);
                    TextContentManager.Update(textFolder, destContent.UUID, "Sequence", content["Sequence"], User.Identity.Name);
                }
            });
            return Json(data);
        }