LeaveWordBack.aspx.cs
上传用户:shjujing
上传日期:2022-07-28
资源大小:11244k
文件大小:2k
源码类别:

Email客户端

开发平台:

Visual C++

  1. using System;
  2. using System.Data;
  3. using System.Configuration;
  4. using System.Collections;
  5. using System.Web;
  6. using System.Web.Security;
  7. using System.Web.UI;
  8. using System.Web.UI.WebControls;
  9. using System.Web.UI.WebControls.WebParts;
  10. using System.Web.UI.HtmlControls;
  11. using System.Data.SqlClient;
  12. public partial class Module_ProRes_LeaveWordBack : System.Web.UI.Page
  13. {
  14.     protected void Page_Load(object sender, EventArgs e)
  15.     {
  16.         string id=Request["ID"].ToString();
  17.         this.labMan.Text = Session["UserName"].ToString();
  18.         string cmdtxt = "SELECT * FROM tb_LeaveWord WHERE ID='"+id+"'";
  19.         SqlData da = new SqlData();
  20.         SqlCommand Com = new SqlCommand(cmdtxt,da.ExceCon());
  21.         SqlDataReader dr = Com.ExecuteReader();
  22.         dr.Read();
  23.         if (dr.HasRows)
  24.         {
  25.             this.txtSubject.Text = dr["LeaveSubject"].ToString();
  26.         }
  27.         dr.Close();
  28.     }
  29.     protected void btnOK_Click(object sender, EventArgs e)
  30.     {
  31.         SqlData da = new SqlData();
  32.         string cmdtxt = "INSERT INTO tb_FeedBack(FeedBackSubject,UserName,FeedBackTime,Content,LeaveWordID)";
  33.         cmdtxt += "VALUES('"+this.txtSubject.Text+"','"+Session["UserName"].ToString()+"','"+DateTime.Now+"'";
  34.         cmdtxt +=",'"+this.txtContent.Text+"','"+Convert.ToInt32(Request["ID"].ToString())+"')";
  35.         //Response.Write(cmdtxt);
  36.         //Response.End();
  37.         if (da.ExceSQL(cmdtxt))
  38.         {
  39.             Response.Write("<script language=javascript>alert('操作成功!');location='LeaveWord.aspx'</script>");
  40.         }
  41.         else
  42.         {
  43.             Response.Write("<script language=javascript>alert('操作失败!')</script>");
  44.         }
  45.     }
  46. }