コード例 #1
0
        public ActionResult Reply(CommentChild c)
        {
            using (BusinessDataBaseEntities db = new BusinessDataBaseEntities())
            {
                //var data = from cc in db.CommentChilds
                //           join cm in db.CommentMains
                //           on cc.CommentMainID equals cm.CommentMainID
                //           select new
                //           {
                //               cm.CommentMainID,
                //               postperson = cm.EmployeeID,
                //               cm.CommentName,
                //               replyperson = cc.EmployeeID,
                //           };

                int empid = EmployeeDetail.EmployeeID;



                db.Entry(c).State = EntityState.Modified;
                db.SaveChanges();

                return(Json(new { success = true, message = "已送出回覆" }, JsonRequestBehavior.AllowGet));
            }
        }
コード例 #2
0
        public ActionResult DeleteConfirmed(int id)
        {
            CommentChild commentChild = db.CommentChilds.Find(id);

            db.CommentChilds.Remove(commentChild);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
コード例 #3
0
 public ActionResult Edit([Bind(Include = "CommentMainID,Num,EmployeeID,CommentQuestionID,Rate,ReplyTime")] CommentChild commentChild)
 {
     if (ModelState.IsValid)
     {
         db.Entry(commentChild).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.CommentMainID     = new SelectList(db.CommentMains, "CommentMainID", "CommentName", commentChild.CommentMainID);
     ViewBag.CommentQuestionID = new SelectList(db.CommentQuestions, "CommentQuestionID", "Question", commentChild.CommentQuestionID);
     ViewBag.EmployeeID        = new SelectList(db.Employees, "employeeID", "EmployeeName", commentChild.EmployeeID);
     return(View(commentChild));
 }
コード例 #4
0
        // GET: CommentChilds/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            CommentChild commentChild = db.CommentChilds.Find(id);

            if (commentChild == null)
            {
                return(HttpNotFound());
            }
            return(View(commentChild));
        }
コード例 #5
0
        // GET: CommentChilds/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            CommentChild commentChild = db.CommentChilds.Find(id);

            if (commentChild == null)
            {
                return(HttpNotFound());
            }
            ViewBag.CommentMainID     = new SelectList(db.CommentMains, "CommentMainID", "CommentName", commentChild.CommentMainID);
            ViewBag.CommentQuestionID = new SelectList(db.CommentQuestions, "CommentQuestionID", "Question", commentChild.CommentQuestionID);
            ViewBag.EmployeeID        = new SelectList(db.Employees, "employeeID", "EmployeeName", commentChild.EmployeeID);
            return(View(commentChild));
        }