Exemplo n.º 1
0
        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="id">文章ID</param>
        /// <returns></returns>
        public JsonResult Delete(int id)
        {
            // 删除附件
            var _commonModel = commentModelService.Find(id);

            if (_commonModel == null)
            {
                return(Json(false));
            }
            //删除附件
            foreach (var _attachment in _commonModel.Attachment)
            {
                System.IO.File.Delete(Server.MapPath(_attachment.FileParth));
            }
            if (commentModelService.Delete(_commonModel))
            {
                return(Json(true));
            }
            else
            {
                return(Json(false));
            }
        }
Exemplo n.º 2
0
 public ActionResult Index(int id)
 {
     return(PartialView(commentModelService.Find(id).Consultation));
 }