Beispiel #1
0
        public ActionResult AddFileToPost(PostAddress postAddress, FileInput fileInput, string returnUri)
        {
            Post post = postService.GetPost(postAddress);

            if (post == null)
            {
                return(null);
            }

            post.AddFile(fileInput);
            postService.EditPost(post);

            if (!string.IsNullOrEmpty(returnUri))
            {
                return(new RedirectResult(returnUri));
            }

            File newFile = post.GetFile(new FileAddress(fileInput.Url));

            if (newFile != null)
            {
                return(PartialView("ManageFile", new OxiteModelItem <File> {
                    Item = newFile, Container = post
                }));
            }

            return(new JsonResult {
                Data = false
            });;
        }
Beispiel #2
0
        public ActionResult AddFileToPost(PostAddress postAddress, FileInput fileInput, string returnUri)
        {
            Post post = postService.GetPost(postAddress);

            if (post == null)
            {
                return(null);
            }

            post.AddFile(fileInput);
            postService.EditPost(post);

            if (!string.IsNullOrEmpty(returnUri))
            {
                return(new RedirectResult(returnUri));
            }
            else
            {
                return(PartialView("VIEWNAME"));
            }
        }