/// <summary>
        /// Create a new comment object.
        /// </summary>
        /// <param name="commentID">Initial value of the CommentID property.</param>
        public static comment Createcomment(global::System.Int32 commentID)
        {
            comment comment = new comment();

            comment.CommentID = commentID;
            return(comment);
        }
示例#2
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            projectCUPU1Entities1 entity = new projectCUPU1Entities1();
            comment com      = new comment();
            var     textbox1 = LoginView1.FindControl("DropDownList1") as DropDownList;
            var     textbox2 = LoginView1.FindControl("TextBox2") as TextBox;

            com.PlaneID     = Int32.Parse(textbox1.SelectedValue.ToString());
            com.CommentBody = textbox2.Text;
            com.Username    = Membership.GetUser().ToString();

            entity.AddTocomments(com);
            entity.SaveChanges();
            Response.Redirect("Comment.aspx");
        }
 /// <summary>
 /// Deprecated Method for adding a new object to the comments EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddTocomments(comment comment)
 {
     base.AddObject("comments", comment);
 }