public IActionResult Index(FeedbackAddModel model) { if (ModelState.IsValid) { _feedbackService.Add(new FeedBack() { Date = DateTime.Now, Email = model.Email, Name = model.Name, Msg = model.Msg, Status = _statusService.GetByName("Pending") }); ViewBag.success = "success"; ViewBag.msg = "Thank You for Your Valuable Feedback."; ModelState.Clear(); return(View()); } return(View(model)); }
/// <summary> /// 添加一条数据 /// </summary> /// <param name="model">数据实体</param> /// <returns></returns> public int Add(Models.APP.Feedback model) { return(dal.Add(model)); }