Ejemplo n.º 1
0
        public ActionResult Re_DeleteConfirmed(int id)
        {
            M_ReMessageBoard m_ReMessageBoard = db.M_ReMessageBoard.Find(id);

            db.M_ReMessageBoard.Remove(m_ReMessageBoard);
            db.SaveChanges();
            return(RedirectToAction("Detial", "Class", new { id = Convert.ToInt32(Request.Cookies["classid"].Value) }));
        }
Ejemplo n.º 2
0
        public ActionResult Re_Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            M_ReMessageBoard m_ReMessageBoard = db.M_ReMessageBoard.Find(id);

            if (m_ReMessageBoard == null)
            {
                return(HttpNotFound());
            }
            return(PartialView(m_ReMessageBoard));
        }
Ejemplo n.º 3
0
        public ActionResult Re_Edit(int?reboardid, int?id)
        {
            if (reboardid == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            M_ReMessageBoard m_ReMessageBoard = db.M_ReMessageBoard.Find(reboardid);

            if (m_ReMessageBoard == null)
            {
                return(HttpNotFound());
            }
            Response.Cookies["boardid"].Value = m_ReMessageBoard.MessageBoardID.ToString();
            ViewBag.UserID = Convert.ToInt32(Request.Cookies["UserID"].Value);
            return(PartialView(m_ReMessageBoard));
        }
Ejemplo n.º 4
0
        public ActionResult Re_Edit([Bind(Include = "ReMessageBoardID,ReMessageBoardContent,RePostTime,Status,UserID")] M_ReMessageBoard m_ReMessageBoard /*,int? id*/)
        {
            if (ModelState.IsValid)
            {
                //m_ReMessageBoard = db.M_ReMessageBoard.Find(id);

                db.Entry(m_ReMessageBoard).State = EntityState.Modified;
                db.Entry(m_ReMessageBoard).Entity.MessageBoardID = Convert.ToInt32(Request.Cookies["boardid"].Value);
                db.Entry(m_ReMessageBoard).Entity.RePostTime     = DateTime.Now.Date;
                db.Entry(m_ReMessageBoard).Entity.Status         = true;
                db.Entry(m_ReMessageBoard).Entity.UserID         = Convert.ToInt32(Request.Cookies["UserID"].Value);
                db.SaveChanges();
                return(RedirectToAction("Detial", "Class", new { id = Convert.ToInt32(Request.Cookies["classid"].Value) }));
            }
            ViewBag.UserID = Convert.ToInt32(Request.Cookies["UserID"].Value);
            return(PartialView(m_ReMessageBoard));
        }
Ejemplo n.º 5
0
        public ActionResult Reply([Bind(Include = "ReMessageBoardID,ReMessageBoardContent,RePostTime,Status,UserID,MessageBoardID")] M_ReMessageBoard m_ReMessageBoard, int id)
        {
            if (ModelState.IsValid)
            {
                //M_MessageBoard m_MessageBoard = db.M_MessageBoard.Find(id);
                db.M_ReMessageBoard.Add(m_ReMessageBoard);
                db.Entry(m_ReMessageBoard).Entity.RePostTime     = DateTime.Now.Date;
                db.Entry(m_ReMessageBoard).Entity.Status         = true;
                db.Entry(m_ReMessageBoard).Entity.UserID         = Convert.ToInt32(Request.Cookies["UserID"].Value);
                db.Entry(m_ReMessageBoard).Entity.MessageBoardID = Convert.ToInt32(id);

                db.SaveChanges();
                return(RedirectToAction("Detial", "Class", new { id = Convert.ToInt32(Request.Cookies["classid"].Value) }));
            }

            //ViewBag.ClassID = new SelectList(db.M_MessageBoard, "ClassID", "ClassName", m_ReMessageBoard.ClassID);
            //ViewBag.LessonID = new SelectList(db.C_Lesson, "LessonID", "LessonName", m_ReMessageBoard.LessonID);
            ViewBag.UserID = Convert.ToInt32(Request.Cookies["UserID"].Value);
            return(PartialView(m_ReMessageBoard));
        }