public ActionResult Create(tbl_Comment tbl_comment)
        {
            if (ModelState.IsValid)
            {
                db.tbl_Comment.AddObject(tbl_comment);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            ViewBag.tid = new SelectList(db.Testimonial_Article, "id", "name", tbl_comment.tid);
            return View(tbl_comment);
        }
예제 #2
0
 /// <summary>
 /// Deprecated Method for adding a new object to the tbl_Comment EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddTotbl_Comment(tbl_Comment tbl_Comment)
 {
     base.AddObject("tbl_Comment", tbl_Comment);
 }
예제 #3
0
 /// <summary>
 /// Create a new tbl_Comment object.
 /// </summary>
 /// <param name="id">Initial value of the id property.</param>
 public static tbl_Comment Createtbl_Comment(global::System.Int32 id)
 {
     tbl_Comment tbl_Comment = new tbl_Comment();
     tbl_Comment.id = id;
     return tbl_Comment;
 }
 public ActionResult Edit(tbl_Comment tbl_comment)
 {
     if (ModelState.IsValid)
     {
         db.tbl_Comment.Attach(tbl_comment);
         db.ObjectStateManager.ChangeObjectState(tbl_comment, EntityState.Modified);
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     ViewBag.tid = new SelectList(db.Testimonial_Article, "id", "name", tbl_comment.tid);
     return View(tbl_comment);
 }