예제 #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");
        }
예제 #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);
        }
예제 #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));
 }