コード例 #1
0
        public ActionResult Detail(long id)
        {
            var dao   = new ContentDao();
            var model = dao.FindByID(id);

            return(View(model));
        }
コード例 #2
0
        public ActionResult Edit(long ID)
        {
            var dao     = new ContentDao();
            var content = dao.FindByID(ID);

            SetViewBag(content.ID);
            return(View(content));
        }
コード例 #3
0
        // GET: Mesage/Details/5
        public ActionResult DetailMesage(long id)
        {
            ContentDao bdDao = new ContentDao();
            Content    ms    = bdDao.FindByID(id);
            var        list  = new ContentDao().ListHot();

            list.Remove(ms);
            ViewBag.listHot = list;
            return(View(ms));
        }
コード例 #4
0
        public JsonResult UpdateUserRead(long msID)
        {
            UserLogin us = (UserLogin)Session[CommonConstant.USER_SESSION];

            var     dao     = new ContentDao();
            long    data    = 0;
            Content objMS   = dao.FindByID(msID);
            string  usID    = us.UserID.ToString();
            string  sUserID = objMS.UsersRead;

            string[] listUerID;
            bool     kt = false;

            if (sUserID == null)
            {
                sUserID = usID;
                kt      = true;
            }
            else
            {
                listUerID = objMS.UsersRead.Split('.');
                if (!listUerID.Contains(usID))
                {
                    sUserID += "." + usID;
                    kt       = true;
                }
            }
            if (kt == true)
            {
                objMS.UsersRead = sUserID;
                data            = dao.Update(objMS);
            }

            JsonResult result = new JsonResult();

            result.Data = data;
            result.JsonRequestBehavior = JsonRequestBehavior.AllowGet;
            return(result);
        }
コード例 #5
0
        // GET: Mesage/Details/5
        public ActionResult Details(long id)
        {
            ContentDao bdDao = new ContentDao();

            return(View(bdDao.FindByID(id)));
        }