protected void submit_Click(object sender, EventArgs e) { User aUser = (User)Session["aUser"]; if (aUser != null) { Comment anComment=new Comment(); anComment.PostId = Convert.ToInt32(Request.QueryString["id"]); anComment.UserId = aUser.UserId; anComment.CommentDescreption = commentText.InnerText; CommentManager anCommentManager=new CommentManager(); anCommentManager.InsertComment(anComment); commentText.InnerText = ""; } else { Response.Redirect("LoginPage.aspx"); } }
public int InsertComment(Comment anComment) { return andCommentGateway.InsertComment(anComment); }