Ejemplo n.º 1
0
        public ActionResult DetailEval(int id)
        {
            ViewEvaluatesGroup group = new ViewEvaluatesGroup();
            ViewEvaluates      eval  = new ViewEvaluates();

            using (EvaluatesServiceClient c = new EvaluatesServiceClient())
            {
                eval         = c.GetEvaluatesById(id);
                group.entity = eval;
            }
            if (eval != null)
            {
                ViewYogaUser user = clientUser.GetById(eval.Evaluateid);
                if (user != null)
                {
                    group.FromUser = user.NickName;
                }
                ViewCenters center = client.GetById(eval.ToUid.Value);
                if (center != null)
                {
                    group.CetnerName = center.CenterName;
                }
            }
            return(View(group));
        }
Ejemplo n.º 2
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 }));
            }
        }
Ejemplo n.º 3
0
 public int Update(ViewEvaluates model)
 {
     try
     {
         return(EvaluatesServiceImpl.Update(model));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Ejemplo n.º 4
0
        public List <ViewEvaluates> GettEvalUid(int id)
        {
            List <Evaluates> list = Repository.GettEvalUid(id);

            List <ViewEvaluates> model = new List <ViewEvaluates>();

            foreach (var item in list)
            {
                model.Add(ViewEvaluates.ToViewModel(item));
            }
            return(model);
        }
Ejemplo n.º 5
0
        public List <ViewEvaluates> GetEvaluatesPageList(string where, int Gender, int YogisLevel, string YogaTypeid, int page, int pagesize, out int count)
        {
            List <Evaluates> list = Repository.GetEvaluatesPageList(where, Gender, YogisLevel, YogaTypeid, page, pagesize, out count);

            List <ViewEvaluates> model = new List <ViewEvaluates>();

            foreach (var item in list)
            {
                model.Add(ViewEvaluates.ToViewModel(item));
            }
            return(model);
        }
Ejemplo n.º 6
0
        public List <ViewEvaluates> GetEvaluatesPageList(int page, int pagesize, out int count)
        {
            List <Evaluates> list = Repository.GetEvaluatesPageList(page, pagesize, out count);

            List <ViewEvaluates> model = new List <ViewEvaluates>();

            foreach (var item in list)
            {
                model.Add(ViewEvaluates.ToViewModel(item));
            }
            return(model);
        }
Ejemplo n.º 7
0
        public List <ViewEvaluates> GetEvalParentID(int ParentID)
        {
            List <Evaluates> list = Repository.GetEvalParentID(ParentID);

            List <ViewEvaluates> model = new List <ViewEvaluates>();

            foreach (var item in list)
            {
                model.Add(ViewEvaluates.ToViewModel(item));
            }
            return(model);
        }
Ejemplo n.º 8
0
        /// <summary>
        /// 回复发表
        /// </summary>
        /// <returns></returns>
        public JsonResult AddFaBiaoInfo()
        {
            try
            {
                // TODO: Add delete logic here
                int ToUid = 0;
                if (!string.IsNullOrEmpty(Request.Form["Uid"]))
                {
                    ToUid = Convert.ToInt32(Request.Form["Uid"]);
                }
                string sContent = "";
                if (!string.IsNullOrEmpty(Request.Form["sContent"]))
                {
                    sContent = Request.Form["sContent"].ToString();
                }
                int ParentID = 0;
                if (!string.IsNullOrEmpty(Request.Form["parentID"]))
                {
                    ParentID = Convert.ToInt32(Request.Form["parentID"]);
                }
                using (EvaluatesServiceClient client = new EvaluatesServiceClient())
                {
                    ViewEvaluates model2 = client.GettEval(ToUid, sContent, user.Uid, ParentID);

                    if (model2 != null)
                    {
                        return(Json(new { code = 2 }));
                    }
                    else
                    {
                        ViewEvaluates model = new ViewEvaluates();
                        model.ToUid      = ToUid;
                        model.EContent   = sContent;
                        model.iShow      = 0;
                        model.iZan       = 0;
                        model.ParentID   = ParentID;
                        model.FromUid    = user.Uid;
                        model.CreateDate = DateTime.Now;
                        client.Add(model);

                        return(Json(new { code = 0 }));
                    }
                }
            }
            catch (Exception ex)
            {
                return(Json(new { code = ex.Message }));
            }
        }
Ejemplo n.º 9
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 }));
        }
Ejemplo n.º 10
0
        /// <summary>
        /// 添加评论
        /// </summary>
        /// <returns></returns>
        public JsonResult AddEvalInfo()
        {
            try
            {
                // TODO: Add delete logic here

                ViewEvaluates model      = new ViewEvaluates();
                string        strContent = Request.Form["sContent"].ToString();
                int           ToUid      = Convert.ToInt32(Request.Form["hidid"]);
                int           recomm     = Convert.ToInt32(Request.Form["recomm"]);
                int           FromUid    = user.Uid;

                using (EvaluatesServiceClient client = new EvaluatesServiceClient())
                {
                    model = client.GettEval(ToUid, strContent, FromUid);
                    if (model == null)
                    {
                        model            = new ViewEvaluates();
                        model.EContent   = FilterSpecial(strContent);
                        model.ToUid      = ToUid;
                        model.FromUid    = FromUid;
                        model.CreateDate = DateTime.Now;
                        model.ParentID   = 0;
                        model.iZan       = 0;
                        model.iShow      = 0;
                        model.Recommend  = recomm;
                        //相册
                        model.Pic = Request.Form["Diploma"];

                        int a = client.Add(model);
                        return(Json(new { code = 0 }));
                    }
                    else
                    {
                        return(Json(new { code = 2 }));//重复
                    }
                }
            }
            catch
            {
                return(Json(new { code = 1 }));
            }
        }
Ejemplo n.º 11
0
 public ViewEvaluates GettEval(int Eid, string EContent, int FromUid, int ParentID)
 {
     return(ViewEvaluates.ToViewModel(Repository.GetEval(Eid, EContent, FromUid, ParentID)));
 }
Ejemplo n.º 12
0
 public ViewEvaluates GetEvaluatesById(int id)
 {
     return(ViewEvaluates.ToViewModel(Repository.GetEvaluatesById(id)));
 }
Ejemplo n.º 13
0
 public int Update(ViewEvaluates model)
 {
     Repository.updateEntity(ViewEvaluates.ToEntity(model));
     return(Repository.Save());
 }
Ejemplo n.º 14
0
 public int Add(ViewEvaluates model)
 {
     Repository.Add(ViewEvaluates.ToEntity(model));
     return(Repository.Save());
 }