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 = ""; } }
public JsonResult UserFeedback(string UserFeedback) { //调用新增反馈方法 if (FeedbackBll.AddFeedback(UserFeedback, Session["userid"].ToString())) { //新增成功 return(Json(1, JsonRequestBehavior.AllowGet)); } return(Json(0, JsonRequestBehavior.AllowGet)); }