public ActionResult Show(int? id) { Feedback feedback = new Feedback(); tId = id ?? 0; using (club = new ClubEntities()) { feedback = club.Feedbacks.Where(f => f.Id == tId).FirstOrDefault(); } return View("~/areas/bwum/views/feedback/show.cshtml", feedback); }
public ActionResult Sub(string name,string context) { if (string.IsNullOrEmpty(name) || string.IsNullOrEmpty(context)) { ViewBag.HitStr = "<span style=\"color:red\">姓名、内容均不能为空!</span>"; }else{ using (ClubEntities club = new ClubEntities()) { Feedback feedback = new Feedback {Name=Common.HtmlCommon.ClearHtml(name),Context=Common.HtmlCommon.ClearHtml(context) }; club.Feedbacks.Add(feedback); if (club.SaveChanges() >= 0) { ViewBag.ResponseStr = "<span>你提交的意见反馈,我们已经收到。我们会尽快的处理!感谢您的支持!!</span>"; } } } return View("~/views/feedback/index.cshtml"); }