Exemplo n.º 1
0
        public ActionResult Reply(int id)
        {
            List <ViewYogaDicItem> DicItemlist = method.listDicItem(2563);
            SelectList             Diclist     = new SelectList(DicItemlist, "ID", "ItemName");

            ViewBag.Diclist = Diclist;
            tQuestionServiceClient client = new tQuestionServiceClient();
            ViewtQuestion          model  = client.GetById(id);

            ViewBag.Model = model;
            ViewBag.SelectedDicItemName = DicItemlist.First(p => p.ID == model.TitleID).ItemName;
            return(View(model));
        }
Exemplo n.º 2
0
 public JsonResult Delete(int id)
 {
     try
     {
         tQuestionServiceClient client = new tQuestionServiceClient();
         ViewtQuestion          model  = client.GetById(id);
         model.IsDelete = true;
         client.Edit(model);
         return(Json(new { code = 0 }));
     }
     catch
     {
         return(Json(new { code = 1 }));
     }
 }
Exemplo n.º 3
0
        public ActionResult FAQDetail(int id)
        {
            List <ViewYogaDicItem> DicItemlist = method.listDicItem(2563);

            ViewBag.Diclist = DicItemlist;
            tQuestionServiceClient client = new tQuestionServiceClient();
            var    model    = client.GetById(id);
            string whereStr = "";
            int    count    = 0;

            whereStr += "IsFAQ!" + true + ",";
            whereStr += "IsDelete!" + false + ",";
            whereStr += "Hot!" + true + ",";
            List <ViewtQuestion> hotList = client.GetList(whereStr, 1, 6, out count);

            ViewBag.HotList = hotList;
            return(View(model));
        }
Exemplo n.º 4
0
 public JsonResult Reply(ViewtQuestion model)
 {
     try
     {
         tQuestionServiceClient client = new tQuestionServiceClient();
         ViewtQuestion          entity = client.GetById(model.ID);
         entity.ReplyContent = model.ReplyContent;
         entity.ReplyUid     = model.ReplyUid;
         entity.ReplyTime    = DateTime.Now;
         entity.State        = 2;
         client.Edit(entity);
         return(Json(new { code = 0 }));
     }
     catch
     {
         return(Json(new { code = 1 }));
     }
 }
Exemplo n.º 5
0
 public JsonResult Update(ViewtQuestion model)
 {
     try
     {
         tQuestionServiceClient client = new tQuestionServiceClient();
         ViewtQuestion          entity = client.GetById(model.ID);
         entity.TitleID         = model.TitleID;
         entity.Hot             = model.Hot;
         entity.QuestionContent = model.QuestionContent;
         entity.ReplyContent    = model.ReplyContent;
         entity.ReplyUid        = model.ReplyUid;
         //回答时间在这里作为修改时间
         entity.ReplyTime = DateTime.Now;
         client.Edit(entity);
         return(Json(new { code = 0 }));
     }
     catch
     {
         return(Json(new { code = 1 }));
     }
 }