예제 #1
0
        public ActionResult New(Guid placeId)
        {
            bp_Comment comment = new bp_Comment();

            comment.PlaceId = placeId;
            comment.UserId  = (Guid)Membership.GetUser().ProviderUserKey;

            return(View(comment));
        }
예제 #2
0
        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));
            }
        }