public void Add(NewsEvaluationModel model)
 {
     dal.Add(model);
 }
 public void Update(NewsEvaluationModel model)
 {
     dal.Update(model);
 }
        private void AddEvaluation(HttpContext CurrentContext)
        {
            if (CurrentUser == null)
            {
                CurrentContext.Response.Write(GetJsonResult(false, "请先登录!"));
                return;
            }

            NewsEvaluationModelBll bll = new NewsEvaluationModelBll();
            int NewsID = Convert.ToInt32(CurrentContext.Request["nid"]);
            int Value = Convert.ToInt32(CurrentContext.Request["val"]);

            if (NewsID == 0 || Value == 0)
            {
                CurrentContext.Response.Write(GetJsonResult(false, "参数错误!"));
                return;
            }
            if(bll.Exists(NewsID,GetUserID()))
            {
                CurrentContext.Response.Write(GetJsonResult(false, "您已经评价过了,谢谢!"));
                return;
            }

            try
            {
                NewsEvaluationModel model = new NewsEvaluationModel()
                {
                    NewsID = NewsID,
                    UserID = GetUserID(),
                    Evaluation = Value,
                    InsertTime = DateTime.Now
                };
                bll.Add(model);
                CurrentContext.Response.Write(GetJsonResult(true, String.Empty));
            }
            catch (Exception ex)
            {
                CurrentContext.Response.Write(GetJsonResult(false, ex.Message));
            }
        }