示例#1
0
        /// <summary>
        /// 赞
        /// </summary>
        /// <returns></returns>
        public JsonResult iZan()
        {
            try
            {
                // TODO: Add update logic here
                int Eid = Convert.ToInt32(Request.Form["id"]);
                using (EvaluatesServiceClient client = new EvaluatesServiceClient())
                {
                    ViewEvaluates model = client.GetById(Eid);
                    if (model.iZan == null)
                    {
                        model.iZan = 1;
                    }
                    else
                    {
                        model.iZan = model.iZan + 1;
                    }
                    client.Update(model);
                }

                return(Json(new { code = 0 }));
            }
            catch
            {
                return(Json(new { code = 1 }));
            }
        }
示例#2
0
        public ActionResult UpdateEvalComm2(int id)
        {
            ViewEvaluates eval   = new ViewEvaluates();
            int           isshow = 0;

            using (EvaluatesServiceClient c = new EvaluatesServiceClient())
            {
                eval = c.GetEvaluatesById(id);
                if (isshow == eval.iShow)
                {
                    isshow = 1;
                }
                eval.iShow = isshow;
                c.Update(eval);
            }
            return(RedirectToAction("DetailEval", new { id = id }));
        }