public ActionResult New(Guid placeId) { bp_Comment comment = new bp_Comment(); comment.PlaceId = placeId; comment.UserId = (Guid)Membership.GetUser().ProviderUserKey; return(View(comment)); }
public ActionResult New(bp_Comment comment) { if (ModelState.IsValid) { System.Data.Objects.ObjectParameter commentId = new System.Data.Objects.ObjectParameter("commentId", Guid.Empty); db.bp_Comment_Create( commentId, (Guid)Membership.GetUser().ProviderUserKey, comment.PlaceId, comment.Content); return(RedirectToAction("Details", "Place", new { placeId = comment.PlaceId })); } else { return(View(comment)); } }