public ActionResult PostingForm(int wallId) { InputPostDto newPost = new InputPostDto(); newPost.WallId = wallId; return(PartialView("PostingForm", newPost)); }
public ActionResult Post(InputPostDto postDto, int wallId) { postDto.AuthorId = ((UserDto)Session["session"]).Id; postDto.WallId = wallId; postService.Post(postDto); return(RedirectToAction("Wall", new { wallId = wallId })); }
public ActionResult PostingForm(int wallId, bool onlyImage) { InputPostDto newPost = new InputPostDto(); newPost.WallId = wallId; newPost.OnlyImage = onlyImage; return(PartialView("PostingForm", newPost)); }
public ActionResult RePost(InputPostDto inputPostDto, int originalId, int currentWallId, int rePostWallId) { UserDto currentUser = (UserDto)Session["session"]; inputPostDto.WallId = rePostWallId; inputPostDto.AuthorId = currentUser.Id; postService.RePost(inputPostDto, originalId); return(RedirectToAction("Wall", new { wallId = currentWallId })); }
public ActionResult CommentForm(int wallId, int hostId) { InputPostDto newPost = new InputPostDto(); newPost.WallId = wallId; newPost.OnlyImage = false; ViewData["hostId"] = hostId; return(PartialView("CommentForm", newPost)); }
public ActionResult PostComment(InputPostDto comment, int hostId, int wallId) { UserDto user = (UserDto)Session["session"]; comment.WallId = wallId; comment.AuthorId = user.Id; postService.Post(comment, hostId); return(RedirectToAction("Wall", new { wallId = wallId })); }
public ActionResult RePostForm(int wallId, int originalId) { UserDto userDto = (UserDto)Session["session"]; InputPostDto newPost = new InputPostDto(); newPost.OnlyImage = false; newPost.WallId = wallId; ViewData["originalId"] = originalId; ViewData["destinationPoints"] = new SelectList(dialogService.GetPoints(userDto.Login), "DestinationWallId", "Title"); return(PartialView("RePostForm", newPost)); }
public void Post(InputPostDto inputPostDto) { SocialNetworkDbContext context = new SocialNetworkDbContext(); Post post = mapper.FromInputPostDtoToPost(inputPostDto); Post addedPost = postManager.AddNewPost(post); List <Content> contents = contentMapper.GetContentList(inputPostDto.Media); List <Content> addedContent = contentManager.AddContent(contents); Post newPost = context.Posts.Where(p => p.Id == addedPost.Id).First(); newPost.Content = addedContent; context.SaveChanges(); }
public ActionResult ShowGroupPostingForm(int wallId, bool onlyImage, int groupId) { InputPostDto newPost = new InputPostDto(); newPost.WallId = wallId; newPost.OnlyImage = onlyImage; UserDto user = (UserDto)Session["session"]; GroupRoles role = groupService.GetUserRoleInGroup(user.Id, groupId); ViewData["role"] = role; return(PartialView("GroupPostingForm", newPost)); }
public Post FromInputPostDtoToPost(InputPostDto inputPostDto) { Post post = new Post() { AuthorId = inputPostDto.AuthorId, Rating = 0, Text = inputPostDto.Text, PostingDate = DateTime.Now, WallId = inputPostDto.WallId }; return(post); }
public ActionResult Post(InputPostDto postDto, int wallId /*, List<HttpPostedFileBase> file*/) { postDto.AuthorId = ((UserDto)Session["session"]).Id; postDto.WallId = wallId; //if (file != null) //{ // postService.Post(postDto, file); //} //else //{ postService.Post(postDto); //} return(RedirectToAction("Wall", new { wallId = wallId })); }
public Post FromInputPostDtoToPost(InputPostDto inputPostDto) { Post post = new Post() { AuthorId = inputPostDto.AuthorId, Rating = 0, PostingDate = DateTime.Now, WallId = inputPostDto.WallId, }; if (inputPostDto.Text == null) { post.Text = ""; } else { post.Text = inputPostDto.Text; } return(post); }
public void Post(InputPostDto InputPostDto) { Post post = mapper.FromInputPostDtoToPost(InputPostDto); postManager.AddNewPost(post); }