Ejemplo n.º 1
0
        public JsonResult DelGuestbook(int id)
        {
            Guestbook entity = Guestbook.Find(Guestbook._.Id == id);

            if (entity == null)
            {
                tip.Message = "系统找不到本留言!";
                return(Json(tip));
            }

            Core.Admin.WriteLogActions("删除留言(id:" + entity.Id + ");");
            entity.Delete();
            tip.Status  = JsonTip.SUCCESS;
            tip.Message = "删除留言成功";
            return(Json(tip));
        }
Ejemplo n.º 2
0
        public IActionResult EditGuestbook(int id)
        {
            IList <GuestbookCategory> list = GuestbookCategory.FindAll(GuestbookCategory._.Id > 0, GuestbookCategory._.Rank.Asc(), null, 0, 0);

            ViewBag.ListKinds = list;
            Guestbook entity = Guestbook.Find(Guestbook._.Id == id);

            if (entity == null)
            {
                return(EchoTipPage("系统找不到本记录!"));
            }
            if (entity.IsRead != 1)
            {
                entity.IsRead = 1;
                entity.Update();
            }

            Core.Admin.WriteLogActions("查看/回复留言(" + id + ");");

            return(View(entity));
        }