Ejemplo n.º 1
0
        /// <summary>
        /// 回复留言
        /// </summary>
        /// <returns></returns>
        public ActionResult Reply(int id)
        {
            var question = new Question();
            //以id字段获取对应的咨询问题
            var m = question.GetShopQuestion(id);
            if (m != null)
            {
                return View(new ReplyShopQuestionModel { Liuyan = m.Content, Id = id });
            }

            TempData["error"] = "该留言不存在";
            return RedirectToAction("Questions");
        }
Ejemplo n.º 2
0
        public ActionResult Reply(ReplyShopQuestionModel model, int id)
        {
            if (ModelState.IsValid)
            {
                var m = new Question();
                var r = m.ReplyShopQuestion(model.Id, model.Content);
                if (r)
                {
                    TempData["success"] = "已成功回复留言";
                    return RedirectToAction("Index");
                }
            }

            TempData["error"] = "回复留言失败,请刷新后重试";
            return View(model);
        }
Ejemplo n.º 3
0
 /// <summary>
 /// 店铺答疑列表
 /// </summary>
 /// <returns></returns>
 public ActionResult Questions(string type, string title, int p = 1)
 {
     var m = new Question();
     return View(m.GetShopQuestions(type.IsEmpty() ? -1 : type.TryTo(0), title));
 }