private void AddFeedback() { /************Code for find IP address of user's machine**********/ string ipaddress; ipaddress = Request.ServerVariables["HTTP_X_FORWARDED_FOR"]; if (ipaddress == "" || ipaddress == null) { ipaddress = Request.ServerVariables["REMOTE_ADDR"]; } /***************************************************************/ FeedbackBll obj = new FeedbackBll(); obj.Name = name.Value.Trim().ToString(); obj.EmailId = email.Value.Trim().ToString(); obj.ClubName = clubName.Value.Trim().ToString(); obj.Mobile = mobile.Value.Trim().ToString(); obj.Comments = txtComments.Text.ToString(); obj.Ipaddress = ipaddress; int exe = obj.AddFeedback(); if (exe > 0) { SendMailtoClient(); txtComments.Text = ""; name.Value = ""; email.Value = ""; clubName.Value = ""; mobile.Value = ""; } }
protected void Page_Load(object sender, EventArgs e) { var feedBackBll = new FeedbackBll(); var list = feedBackBll.QueryAll(); var a = 0; }
/// <summary> /// 处理反馈 /// </summary> /// <param name="FeedbackID">反馈id</param> /// <returns></returns> public JsonResult FeedbackUpdate(string FeedbackID) { if (FeedbackBll.UpdateFeedback(Convert.ToInt32(FeedbackID))) { return(Json(1, JsonRequestBehavior.AllowGet)); } return(Json(0, JsonRequestBehavior.AllowGet)); }
/// <summary> /// 用户删除反馈 /// </summary> /// <param name="FeedbackID">反馈id</param> /// <returns></returns> public ActionResult FeedbackDel(int FeedbackID) { //删除反馈记录 if (FeedbackBll.UserFeedbackDal(FeedbackID)) { return(Json(1, JsonRequestBehavior.AllowGet)); } return(Json(0, JsonRequestBehavior.AllowGet)); //return RedirectToAction("MyFeedback","User"); }
public JsonResult UserFeedback(string UserFeedback) { //调用新增反馈方法 if (FeedbackBll.AddFeedback(UserFeedback, Session["userid"].ToString())) { //新增成功 return(Json(1, JsonRequestBehavior.AllowGet)); } return(Json(0, JsonRequestBehavior.AllowGet)); }
/// <summary> /// 后台反馈分布视图 /// </summary> /// <returns></returns> public ActionResult BackFeedbackPartial(int?pageindex, int?IsDealwith) { List <FeedbackTable> list = list = FeedbackBll.SelectAllFeedback().Where(p => IsDealwith == null || p.IsDealwith == (IsDealwith ?? 0)).OrderBy(p => p.IsDealwith).ToList(); if (list != null && list.Count() > 0) { Session["fkcount"] = list.Count(); } else { Session["fkcount"] = 0; } ViewBag.pageindex = pageindex ?? 1; ViewBag.IsDealwith = IsDealwith ?? 2; Session["fkpagecount"] = Math.Ceiling(list.Count() / 10.0); Session["allfk"] = list.Skip(((pageindex ?? 1) - 1) * 10).Take(10).ToList(); return(PartialView("BackFeedbackPartial")); }
/// <summary> /// 后台反馈界面 /// </summary> /// <returns></returns> public ActionResult BackFeedbackIndex() { Session["li_1"] = 3; Session["li_2"] = 0; //查询所有反馈 List <FeedbackTable> list = FeedbackBll.SelectAllFeedback().OrderBy(p => p.IsDealwith).ToList(); if (list != null && list.Count() > 0) { Session["fkcount"] = list.Count(); } else { Session["fkcount"] = 0; } ViewBag.IsDealwith = 2; Session["fkpagecount"] = Math.Ceiling(list.Count() / 10.0); Session["allfk"] = list.Take(10).ToList(); return(View()); }
/// <summary> /// 我的反馈分布视图 /// </summary> /// <returns></returns> public ActionResult MyFeedback() { List <FeedbackTable> list = FeedbackBll.SeleteUserFeedback(Convert.ToInt32(Session["userid"])); return(PartialView("MyFeedback", list)); }