protected void Button1_Click(object sender, EventArgs e) { report_Entity report = new report_Entity(); report.s_account = sellerNameList.SelectedValue; report.p_name = prodectList.SelectedValue; report.report = reportInfo.Text; if (report.s_account.Length <= 0) { Response.Write(MessagesBox.showMessages("商家姓名不能为空!")); return; } else if (report.p_name.Length <= 0) { Response.Write(MessagesBox.showMessages("商品不能为空!")); return; } else if (report.report.Length <= 0) { Response.Write(MessagesBox.showMessages("内容不能为空!")); return; } bool result = data.sendReport(report); if (result) { reportInfo.Text = ""; Response.Write(MessagesBox.showMessages("您的反馈我们已经收到,我们会尽快处理!")); Response.Write("<script language=javascript>history.go(-1);</script>"); } }
/// <summary> /// 反馈问题 /// </summary> /// <param name="s_account"></param> /// <returns></returns> public bool sendReport(report_Entity repT) { report_T a = new report_T(); a.s_account = repT.s_account; a.p_name = repT.p_name; a.report = repT.report; sellDB.report_T.InsertOnSubmit(a); sellDB.SubmitChanges(); return(true); }