Exemplo n.º 1
0
        public JsonResult AddArticle()
        {
            Notify <bool> notify  = new Notify <bool>();
            string        title   = Request["title"];
            string        content = Request["content"];
            YD_Article    entity  = new YD_Article
            {
                Content    = content,
                Title      = title,
                CreateTime = DateTime.Now,
                UserId     = 1
            };

            if (_articleService.AddEntity(entity) != null)
            {
                notify.Data = true;
            }
            else
            {
                notify.Data = false;
            }
            return(Json(notify, JsonRequestBehavior.AllowGet));
        }
Exemplo n.º 2
0
        public ActionResult Details(int id)
        {
            YD_Article entity = _articleService.LoadEntities(c => c.Id == id).SingleOrDefault();

            return(View(entity));
        }