public ActionResult RemoveFriend(int id, int personID) { int pID = personID; Authentication authentication = (Authentication)Session["authentication"]; if (authentication == null) { TempData["msg"] = "<script>alert('Please Log in First');</script>"; return(RedirectToAction("SignUpView", "SignUp")); } ViewBag.Name = authentication.Name; ViewBag.SignupID = authentication.Id; ViewBag.Password = authentication.Password; Friend friend = new Friend(); friend.ID = id; friend.RId = pID; if (friendManager.DeleteFriendByBothID(friend)) { ViewBag.Message = "Sucessfully Unfriend"; } else { ViewBag.Message = "Failed to Unfriend"; } ViewBag.PersonID = pID; ViewBag.PersonList = homeManager.AllFriendInformation(pID); ProfilePost profilePost = new ProfilePost() { SignupId = authentication.Id, Password = authentication.Password, Name = authentication.Name, PersonID = pID }; return(View("FriendListView", profilePost)); }
public ActionResult FriendListView(int personID) { Authentication authentication = (Authentication)Session["authentication"]; Person person = homeManager.GetPersonInformation(personID); if (authentication == null) { TempData["msg"] = "<script>alert('Please Log in First');</script>"; return(RedirectToAction("SignUpView", "SignUp")); } else if (!person.Password.Equals(authentication.Password)) { return(RedirectToAction("SignUpView", "SignUp")); } else { ViewBag.Name = person.Name; ViewBag.SignupID = authentication.Id; ViewBag.Password = authentication.Password; ViewBag.PersonID = personID; ViewBag.NotificationList = homeManager.GetAllNotification(authentication.Id); ViewBag.PersonList = homeManager.AllFriendInformation(personID); ProfilePost profilePost = new ProfilePost() { SignupId = authentication.Id, Password = authentication.Password, Name = authentication.Name, PersonID = personID }; return(View(profilePost)); } }
public ProfilePost Update(ProfilePost profilePost) { using (var _ctx = new DatingContext()) { _ctx.Entry <ProfilePost>(profilePost).State = System.Data.Entity.EntityState.Modified; _ctx.SaveChanges(); return(profilePost); } }
public ProfilePost Add(ProfilePost profilePost) { using (var _ctx = new ApplicationDbContext()) { _ctx.Entry(profilePost).State = EntityState.Added; _ctx.SaveChanges(); return(profilePost); } }
public ProfilePost Add(ProfilePost profilePost) { try { return(_friendRepository.Add(profilePost)); } catch (Exception e) { throw new Exception("Error - Add a post."); } }
public IActionResult Delete(int id, int returnProfileId) { ProfilePost selectedPost = db.ProfilePosts.FirstOrDefault(post => post.ProfilePostId == id); if (selectedPost != null) { db.ProfilePosts.Remove(selectedPost); db.SaveChanges(); } return(RedirectToAction("Profile", new { id = returnProfileId })); }
//update post public ProfilePost Update(ProfilePost profilePost) { try { return(_friendRepository.Update(profilePost)); } catch (Exception e) { //Log Error throw new Exception("An error occurred while trying to update a post."); } }
public bool SetPostInOtherWall(ProfilePost postInfo) { GenarateConnection(); using (Connection) { string query = null; Connection.Open(); if (postInfo.PostPhotoInBytes != null) { query = "insert into Post(Detail,SignUpID,NoOfLike,DateTime,Photo,OfWall) values (@Detail,@SignUpID,@NoOfLike,@DateTime,@Photo,@OfWall);"; } else { query = "insert into Post(Detail,SignUpID,NoOfLike,DateTime,OfWall) values (@Detail,@SignUpID,@NoOfLike,@DateTime,@OfWall);"; } Command = new SqlCommand(query, Connection); Command.Parameters.Clear(); Command.Parameters.Add("@Detail", SqlDbType.VarChar); Command.Parameters["@Detail"].Value = postInfo.PostDetail; Command.Parameters.Add("@NoOfLike", SqlDbType.Int); Command.Parameters["@NoOfLike"].Value = 0; Command.Parameters.Add("@DateTime", SqlDbType.DateTime); Command.Parameters["@DateTime"].Value = DateTime.Now; Command.Parameters.Add("@SignUpID", SqlDbType.VarChar); Command.Parameters["@SignUpID"].Value = postInfo.SignupId; Command.Parameters.Add("@OfWall", SqlDbType.VarChar); Command.Parameters["@OfWall"].Value = postInfo.PersonID; if (postInfo.PostPhotoInBytes != null) { Command.Parameters.Add("@Photo", SqlDbType.VarBinary); Command.Parameters["@Photo"].Value = postInfo.PostPhotoInBytes; } try { Command.ExecuteNonQuery(); Connection.Close(); return(true); } catch (Exception) { throw new Exception("Error While Entering data into database"); } } }
public IActionResult Edit(int id) { if (!isLoggedIn) { RedirectToAction("Index", "Home"); } ProfilePost selectedPost = db.ProfilePosts.FirstOrDefault(post => post.ProfilePostId == id); // in case manually typing url into address bar, bypassing hidden edit button if (selectedPost == null || selectedPost.ProfilePostAuthor != uid) { return(RedirectToAction("Profile")); } return(View("EditProfilePost", selectedPost)); }
public IActionResult Create(ProfilePost newProfilePost, int userProfileId) { if (ModelState.IsValid == false) { User selectedProfileId = db.Users .Include(user => user.ProfilePosts) .ThenInclude(profpost => profpost.Author) .FirstOrDefault(user => user.UserId == userProfileId); // send back to the page with the form so error messages are displayed return(View("Profile", selectedProfileId)); } db.ProfilePosts.Add(newProfilePost); db.SaveChanges(); return(RedirectToAction("Profile", new { id = newProfilePost.UserProfileId })); }
public IActionResult UpdateProfilePost(ProfilePost editedPost, int id) { if (ModelState.IsValid == false) { editedPost.ProfilePostId = id; return(View("EditProfilePost", editedPost)); } ProfilePost selectedPost = db.ProfilePosts.FirstOrDefault(post => post.ProfilePostId == id); if (selectedPost == null) { return(RedirectToAction("FamForum")); } selectedPost.ForumMsg = editedPost.ForumMsg; selectedPost.UpdatedAt = DateTime.Now; db.ProfilePosts.Update(selectedPost); db.SaveChanges(); return(RedirectToAction("Profile", new { id = selectedPost.UserProfileId })); }
public ActionResult ProfileView(int personID) { Authentication authentication = (Authentication)Session["authentication"]; if (authentication == null) { TempData["msg"] = "<script>alert('Please Log in First');</script>"; return(RedirectToAction("SignUpView", "SignUp")); } ViewBag.SignupID = authentication.Id; ViewBag.Password = authentication.Password; ViewBag.Name = authentication.Name; ViewBag.PersonID = personID; ViewBag.NotificationList = homeManager.GetAllNotification(authentication.Id); ViewBag.PersonInfo = homeManager.GetPersonInformation(personID); int coverPhotoId = editManager.GetCoverPhotoID(personID); ViewBag.CoverImage = editManager.GetCoverPhotoByID(coverPhotoId).PhotoInString; int profilePhotoId = editManager.GetProfilePhotoID(personID); ViewBag.ProfileImage = editManager.GetProfilePhotoByID(profilePhotoId).PhotoInString; List <AllAboutPost> postInfos = homeManager.GetAllPostInformationByID(personID); ViewBag.PostInfos = postInfos; ViewBag.PersonInfo = homeManager.GetPersonInformation(personID); Session["PersonID"] = personID; ProfilePost profilePost = new ProfilePost() { SignupId = authentication.Id, Password = authentication.Password, Name = authentication.Name, PersonID = personID }; return(View(profilePost)); }
public bool SetPostInOtherWall(ProfilePost postInfo) { return(homeGateway.SetPostInOtherWall(postInfo)); }
public List <ProfilePostComment> GetCommentsOnProfilePost(ProfilePost pp) { var s = ProfilePostComments.Where(pc => pc.parent == pp).ToList(); return(s); }
#pragma warning disable 1998 public async override global::System.Threading.Tasks.Task ExecuteAsync() { #line 2 "/Users/davidcarrillojr/Desktop/projects/C#/ForTheFamApp/Views/ProfilePosts/Profile.cshtml" int?uid = Context.Session.GetInt32("UserId"); #line default #line hidden BeginContext(66, 2, true); WriteLiteral("\n\n"); EndContext(); BeginContext(68, 93, false); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("head", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "aee9cda9246586511dd8e80f9ae35ca2bf239beb8029", async() => { BeginContext(74, 5, true); WriteLiteral("\n "); EndContext(); BeginContext(79, 74, false); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("link", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagOnly, "aee9cda9246586511dd8e80f9ae35ca2bf239beb8405", async() => { } ); __Microsoft_AspNetCore_Mvc_Razor_TagHelpers_UrlResolutionTagHelper = CreateTagHelper <global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.UrlResolutionTagHelper>(); __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_Razor_TagHelpers_UrlResolutionTagHelper); __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_0); __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_1); __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_2); await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { await __tagHelperExecutionContext.SetOutputContentAsync(); } Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); EndContext(); BeginContext(153, 1, true); WriteLiteral("\n"); EndContext(); } ); __Microsoft_AspNetCore_Mvc_Razor_TagHelpers_HeadTagHelper = CreateTagHelper <global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.HeadTagHelper>(); __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_Razor_TagHelpers_HeadTagHelper); await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { await __tagHelperExecutionContext.SetOutputContentAsync(); } Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); EndContext(); BeginContext(161, 40, true); WriteLiteral("\n\n\n<div class=\"text-center\">\n <h2>\n "); EndContext(); BeginContext(202, 16, false); #line 14 "/Users/davidcarrillojr/Desktop/projects/C#/ForTheFamApp/Views/ProfilePosts/Profile.cshtml" Write(Model.FullName()); #line default #line hidden EndContext(); BeginContext(218, 19, true); WriteLiteral("\'s Profile\n </h2>\n"); EndContext(); BeginContext(283, 13, true); WriteLiteral("</div>\n\n<hr>\n"); EndContext(); BeginContext(296, 3985, false); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("body", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "aee9cda9246586511dd8e80f9ae35ca2bf239beb11083", async() => { BeginContext(302, 4, true); WriteLiteral("\n \n"); EndContext(); #line 22 "/Users/davidcarrillojr/Desktop/projects/C#/ForTheFamApp/Views/ProfilePosts/Profile.cshtml" foreach (Post post in Model.Posts) { #line default #line hidden BeginContext(353, 166, true); WriteLiteral(" <div class=\"card mx-auto mb-3 w-78\">\n \n <div class=\"card-header\">\n <h5 class=\"card-title\">\n "); EndContext(); BeginContext(520, 16, false); #line 29 "/Users/davidcarrillojr/Desktop/projects/C#/ForTheFamApp/Views/ProfilePosts/Profile.cshtml" Write(post.ProductName); #line default #line hidden EndContext(); BeginContext(536, 193, true); WriteLiteral("\n </h5>\n </div>\n \n <div id=\"postdiv\" class=\"card-body\">\n <div class=\"row\">\n <p>"); EndContext(); BeginContext(730, 22, false); #line 35 "/Users/davidcarrillojr/Desktop/projects/C#/ForTheFamApp/Views/ProfilePosts/Profile.cshtml" Write(post.Author.FullName()); #line default #line hidden EndContext(); BeginContext(752, 7, true); WriteLiteral(" says \""); EndContext(); BeginContext(760, 9, false); #line 35 "/Users/davidcarrillojr/Desktop/projects/C#/ForTheFamApp/Views/ProfilePosts/Profile.cshtml" Write(post.Body); #line default #line hidden EndContext(); BeginContext(769, 185, true); WriteLiteral("\" \n </p>\n <div id=\"content\" class=\"col-md-2\">\n \n <img id=\"imgdiv\""); EndContext(); BeginWriteAttribute("src", " src=\"", 954, "\"", 972, 1); #line 39 "/Users/davidcarrillojr/Desktop/projects/C#/ForTheFamApp/Views/ProfilePosts/Profile.cshtml" WriteAttributeValue("", 960, post.ImgUrl, 960, 12, false); #line default #line hidden EndWriteAttribute(); BeginContext(973, 197, true); WriteLiteral(" class=\"card-img\" alt=\"...\">\n </div>\n </div>\n </div>\n \n <div class=\"card-footer\">\n "); EndContext(); BeginContext(1170, 257, false); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("a", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "aee9cda9246586511dd8e80f9ae35ca2bf239beb14066", async() => { BeginContext(1363, 60, true); WriteLiteral("\n View Details\n "); EndContext(); } ); __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper = CreateTagHelper <global::Microsoft.AspNetCore.Mvc.TagHelpers.AnchorTagHelper>(); __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper); __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.Controller = (string)__tagHelperAttribute_3.Value; __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_3); __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.Action = (string)__tagHelperAttribute_4.Value; __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_4); if (__Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.RouteValues == null) { throw new InvalidOperationException(InvalidTagHelperIndexerAssignment("asp-route-id", "Microsoft.AspNetCore.Mvc.TagHelpers.AnchorTagHelper", "RouteValues")); } BeginWriteTagHelperAttribute(); #line 48 "/Users/davidcarrillojr/Desktop/projects/C#/ForTheFamApp/Views/ProfilePosts/Profile.cshtml" WriteLiteral(post.PostId); #line default #line hidden __tagHelperStringValueBuffer = EndWriteTagHelperAttribute(); __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.RouteValues["id"] = __tagHelperStringValueBuffer; __tagHelperExecutionContext.AddTagHelperAttribute("asp-route-id", __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.RouteValues["id"], global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes); __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_5); await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { await __tagHelperExecutionContext.SetOutputContentAsync(); } Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); EndContext(); BeginContext(1427, 23, true); WriteLiteral("\n "); EndContext(); BeginContext(1450, 177, false); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("a", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "aee9cda9246586511dd8e80f9ae35ca2bf239beb16858", async() => { BeginContext(1571, 52, true); WriteLiteral("\n Edit\n "); EndContext(); } ); __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper = CreateTagHelper <global::Microsoft.AspNetCore.Mvc.TagHelpers.AnchorTagHelper>(); __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper); __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.Controller = (string)__tagHelperAttribute_3.Value; __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_3); __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.Action = (string)__tagHelperAttribute_6.Value; __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_6); if (__Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.RouteValues == null) { throw new InvalidOperationException(InvalidTagHelperIndexerAssignment("asp-route-id", "Microsoft.AspNetCore.Mvc.TagHelpers.AnchorTagHelper", "RouteValues")); } BeginWriteTagHelperAttribute(); #line 53 "/Users/davidcarrillojr/Desktop/projects/C#/ForTheFamApp/Views/ProfilePosts/Profile.cshtml" WriteLiteral(post.PostId); #line default #line hidden __tagHelperStringValueBuffer = EndWriteTagHelperAttribute(); __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.RouteValues["id"] = __tagHelperStringValueBuffer; __tagHelperExecutionContext.AddTagHelperAttribute("asp-route-id", __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.RouteValues["id"], global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes); __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_7); await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { await __tagHelperExecutionContext.SetOutputContentAsync(); } Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); EndContext(); BeginContext(1627, 23, true); WriteLiteral("\n "); EndContext(); BeginContext(1650, 252, false); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("a", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "aee9cda9246586511dd8e80f9ae35ca2bf239beb19683", async() => { BeginContext(1844, 54, true); WriteLiteral("\n Delete\n "); EndContext(); } ); __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper = CreateTagHelper <global::Microsoft.AspNetCore.Mvc.TagHelpers.AnchorTagHelper>(); __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper); __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.Controller = (string)__tagHelperAttribute_3.Value; __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_3); __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.Action = (string)__tagHelperAttribute_8.Value; __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_8); if (__Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.RouteValues == null) { throw new InvalidOperationException(InvalidTagHelperIndexerAssignment("asp-route-id", "Microsoft.AspNetCore.Mvc.TagHelpers.AnchorTagHelper", "RouteValues")); } BeginWriteTagHelperAttribute(); #line 59 "/Users/davidcarrillojr/Desktop/projects/C#/ForTheFamApp/Views/ProfilePosts/Profile.cshtml" WriteLiteral(post.PostId); #line default #line hidden __tagHelperStringValueBuffer = EndWriteTagHelperAttribute(); __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.RouteValues["id"] = __tagHelperStringValueBuffer; __tagHelperExecutionContext.AddTagHelperAttribute("asp-route-id", __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.RouteValues["id"], global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes); __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_9); await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { await __tagHelperExecutionContext.SetOutputContentAsync(); } Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); EndContext(); BeginContext(1902, 43, true); WriteLiteral("\n </div>\n </div>\n"); EndContext(); #line 65 "/Users/davidcarrillojr/Desktop/projects/C#/ForTheFamApp/Views/ProfilePosts/Profile.cshtml" } #line default #line hidden BeginContext(1952, 38, true); WriteLiteral(" <br>\n <hr>\n <h2>Post A Message on "); EndContext(); BeginContext(1991, 16, false); #line 69 "/Users/davidcarrillojr/Desktop/projects/C#/ForTheFamApp/Views/ProfilePosts/Profile.cshtml" Write(Model.FullName()); #line default #line hidden EndContext(); BeginContext(2007, 18, true); WriteLiteral("\'s\' Wall </h2>\n \n"); EndContext(); #line 71 "/Users/davidcarrillojr/Desktop/projects/C#/ForTheFamApp/Views/ProfilePosts/Profile.cshtml" foreach (ProfilePost profilepost in ViewBag.ThisUsersProfilePosts) { #line default #line hidden #line 72 "/Users/davidcarrillojr/Desktop/projects/C#/ForTheFamApp/Views/ProfilePosts/Profile.cshtml" if (profilepost.UserProfileId == profilepost.UserProfileId) { #line default #line hidden BeginContext(2162, 480, true); WriteLiteral(@" <div class=""container""> <div class=""row""> <div class=""col""> <div class=""card mb-3"" style=""max-width: 1080;""> <div class=""row no-gutters""> <div class=""col-md-4""> </div> <div class=""col-md-8""> <div class=""card-body""> <p class=""card-text"">"); EndContext(); BeginContext(2643, 20, false); #line 82 "/Users/davidcarrillojr/Desktop/projects/C#/ForTheFamApp/Views/ProfilePosts/Profile.cshtml" Write(profilepost.ForumMsg); #line default #line hidden EndContext(); BeginContext(2663, 99, true); WriteLiteral("</p>\n <p class=\"card-text\"><small class=\"text-muted\">Last updated "); EndContext(); BeginContext(2763, 21, false); #line 83 "/Users/davidcarrillojr/Desktop/projects/C#/ForTheFamApp/Views/ProfilePosts/Profile.cshtml" Write(profilepost.UpdatedAt); #line default #line hidden EndContext(); BeginContext(2784, 183, true); WriteLiteral("</small>\n <p>\n Posted By: [still needed?]\n </p>\n "); EndContext(); BeginContext(2967, 400, false); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("a", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "aee9cda9246586511dd8e80f9ae35ca2bf239beb25293", async() => { BeginContext(3269, 94, true); WriteLiteral("\n Edit\n "); EndContext(); } ); __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper = CreateTagHelper <global::Microsoft.AspNetCore.Mvc.TagHelpers.AnchorTagHelper>(); __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper); __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.Controller = (string)__tagHelperAttribute_10.Value; __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_10); __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.Action = (string)__tagHelperAttribute_6.Value; __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_6); if (__Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.RouteValues == null) { throw new InvalidOperationException(InvalidTagHelperIndexerAssignment("asp-route-id", "Microsoft.AspNetCore.Mvc.TagHelpers.AnchorTagHelper", "RouteValues")); } BeginWriteTagHelperAttribute(); #line 90 "/Users/davidcarrillojr/Desktop/projects/C#/ForTheFamApp/Views/ProfilePosts/Profile.cshtml" WriteLiteral(profilepost.ProfilePostId); #line default #line hidden __tagHelperStringValueBuffer = EndWriteTagHelperAttribute(); __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.RouteValues["id"] = __tagHelperStringValueBuffer; __tagHelperExecutionContext.AddTagHelperAttribute("asp-route-id", __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.RouteValues["id"], global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes); __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_7); await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { await __tagHelperExecutionContext.SetOutputContentAsync(); } Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); EndContext(); BeginContext(3367, 43, true); WriteLiteral("\n "); EndContext(); BeginContext(3410, 491, false); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("a", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "aee9cda9246586511dd8e80f9ae35ca2bf239beb28177", async() => { BeginContext(3801, 96, true); WriteLiteral("\n Delete\n "); EndContext(); } ); __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper = CreateTagHelper <global::Microsoft.AspNetCore.Mvc.TagHelpers.AnchorTagHelper>(); __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper); __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.Controller = (string)__tagHelperAttribute_10.Value; __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_10); __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.Action = (string)__tagHelperAttribute_8.Value; __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_8); if (__Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.RouteValues == null) { throw new InvalidOperationException(InvalidTagHelperIndexerAssignment("asp-route-id", "Microsoft.AspNetCore.Mvc.TagHelpers.AnchorTagHelper", "RouteValues")); } BeginWriteTagHelperAttribute(); #line 97 "/Users/davidcarrillojr/Desktop/projects/C#/ForTheFamApp/Views/ProfilePosts/Profile.cshtml" WriteLiteral(profilepost.ProfilePostId); #line default #line hidden __tagHelperStringValueBuffer = EndWriteTagHelperAttribute(); __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.RouteValues["id"] = __tagHelperStringValueBuffer; __tagHelperExecutionContext.AddTagHelperAttribute("asp-route-id", __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.RouteValues["id"], global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes); BeginWriteTagHelperAttribute(); #line 98 "/Users/davidcarrillojr/Desktop/projects/C#/ForTheFamApp/Views/ProfilePosts/Profile.cshtml" WriteLiteral(Model.UserId); #line default #line hidden __tagHelperStringValueBuffer = EndWriteTagHelperAttribute(); __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.RouteValues["returnProfileId"] = __tagHelperStringValueBuffer; __tagHelperExecutionContext.AddTagHelperAttribute("asp-route-returnProfileId", __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.RouteValues["returnProfileId"], global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes); __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_9); await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { await __tagHelperExecutionContext.SetOutputContentAsync(); } Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); EndContext(); BeginContext(3901, 204, true); WriteLiteral("</p>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n"); EndContext(); #line 109 "/Users/davidcarrillojr/Desktop/projects/C#/ForTheFamApp/Views/ProfilePosts/Profile.cshtml" } #line default #line hidden #line 109 "/Users/davidcarrillojr/Desktop/projects/C#/ForTheFamApp/Views/ProfilePosts/Profile.cshtml" } #line default #line hidden BeginContext(4114, 2, true); WriteLiteral(" "); EndContext(); #line 111 "/Users/davidcarrillojr/Desktop/projects/C#/ForTheFamApp/Views/ProfilePosts/Profile.cshtml" ProfilePost profilePostObj = new ProfilePost(); #line default #line hidden BeginContext(4175, 3, true); WriteLiteral("\n "); EndContext(); BeginContext(4178, 84, false); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("partial", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagOnly, "aee9cda9246586511dd8e80f9ae35ca2bf239beb32660", async() => { } ); __Microsoft_AspNetCore_Mvc_TagHelpers_PartialTagHelper = CreateTagHelper <global::Microsoft.AspNetCore.Mvc.TagHelpers.PartialTagHelper>(); __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_PartialTagHelper); __Microsoft_AspNetCore_Mvc_TagHelpers_PartialTagHelper.Name = (string)__tagHelperAttribute_11.Value; __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_11); #line 115 "/Users/davidcarrillojr/Desktop/projects/C#/ForTheFamApp/Views/ProfilePosts/Profile.cshtml" __Microsoft_AspNetCore_Mvc_TagHelpers_PartialTagHelper.Model = profilePostObj; #line default #line hidden __tagHelperExecutionContext.AddTagHelperAttribute("model", __Microsoft_AspNetCore_Mvc_TagHelpers_PartialTagHelper.Model, global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes); #line 115 "/Users/davidcarrillojr/Desktop/projects/C#/ForTheFamApp/Views/ProfilePosts/Profile.cshtml" __Microsoft_AspNetCore_Mvc_TagHelpers_PartialTagHelper.ViewData = ViewData; #line default #line hidden __tagHelperExecutionContext.AddTagHelperAttribute("view-data", __Microsoft_AspNetCore_Mvc_TagHelpers_PartialTagHelper.ViewData, global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes); await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { await __tagHelperExecutionContext.SetOutputContentAsync(); } Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); EndContext(); BeginContext(4262, 12, true); WriteLiteral("</partial>\n\n"); EndContext(); } ); __Microsoft_AspNetCore_Mvc_Razor_TagHelpers_BodyTagHelper = CreateTagHelper <global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.BodyTagHelper>(); __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_Razor_TagHelpers_BodyTagHelper); await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { await __tagHelperExecutionContext.SetOutputContentAsync(); } Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); EndContext(); BeginContext(4281, 3, true); WriteLiteral("\n\n\n"); EndContext(); }
public ActionResult ProfileView(ProfilePost profilePost) { Authentication authentication = (Authentication)Session["authentication"]; if (authentication == null) { TempData["msg"] = "<script>alert('Please Log in First');</script>"; return(RedirectToAction("SignUpView", "SignUp")); } HttpPostedFileBase file = profilePost.PostPhoto; if (file != null) { string fileName = Path.GetFileName(file.FileName); string fileExtension = Path.GetExtension(fileName); int fileSize = file.ContentLength; if (fileExtension.ToLower() == ".jpg" || fileExtension.ToLower() == ".bmp" || fileExtension.ToLower() == ".gif" || fileExtension.ToLower() == ".png") { Stream stream = file.InputStream; BinaryReader binaryReader = new BinaryReader(stream); byte[] bytes = binaryReader.ReadBytes((int)stream.Length); profilePost.PostPhotoInBytes = bytes; } else { int personIDs = profilePost.PersonID; return(RedirectToAction("ProfileView", "Profile", new { personID = personIDs })); } } else { profilePost.PostPhotoInBytes = null; } if (homeManager.SetPostInOtherWall(profilePost)) { ViewBag.Message = "Successfully posted"; } else { ViewBag.Message = "Post Failed"; } int personID = profilePost.PersonID; ViewBag.SignupID = authentication.Id; ViewBag.Password = authentication.Password; ViewBag.Name = authentication.Name; ViewBag.PersonID = personID; ViewBag.NotificationList = homeManager.GetAllNotification(authentication.Id); int coverPhotoId = editManager.GetCoverPhotoID(personID); ViewBag.CoverImage = editManager.GetCoverPhotoByID(coverPhotoId).PhotoInString; int profilePhotoId = editManager.GetProfilePhotoID(personID); ViewBag.ProfileImage = editManager.GetProfilePhotoByID(profilePhotoId).PhotoInString; List <AllAboutPost> postInfos = homeManager.GetAllPostInformationByID(personID); ViewBag.PostInfos = postInfos; ViewBag.PersonInfo = homeManager.GetPersonInformation(personID); Session["PersonID"] = personID; ProfilePost profilePosts = new ProfilePost() { SignupId = authentication.Id, Password = authentication.Password, Name = authentication.Name, PersonID = personID }; return(View(profilePosts)); }