reply.aspx.cs
上传用户:szraylite
上传日期:2018-06-06
资源大小:11546k
文件大小:2k
源码类别:

软件测试

开发平台:

Java

  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 ENTERPRISE.BusinessLogicLayer;
  12. using ENTERPRISE.DataAccessHelper;
  13. public partial class admin_reply : System.Web.UI.Page
  14. {
  15.     protected void Page_Load(object sender, EventArgs e)
  16.     {
  17.         InitData();
  18.     }
  19.     private void InitData()
  20.     {
  21.         int id = Convert.ToInt32(Request.QueryString["id"]);
  22.         Messages message = new Messages();
  23.         message.LoadData(id);
  24.         LabelContent.Text = System.Web.HttpUtility.HtmlEncode(message.content);
  25.         LabelCreateTime.Text = message.booktime.ToString();
  26.         LabelUserLoginName.Text = message.guest_name;
  27.         replytext.Text = message.reply;
  28.     }
  29.     protected void ButtonReply_Click(object sender, EventArgs e)
  30.     {
  31.         Messages message = new Messages();                                                                                                                                                                                                                                                                                   
  32.         int id = Convert.ToInt32(Request.QueryString["id"]);
  33.         Hashtable ht = new Hashtable();
  34.         ht.Add("reply", System.Web.HttpUtility.HtmlEncode(SqlStringFormat.GetQuotedString(reply.Text)));
  35.         ht.Add("retime", SqlStringFormat.GetQuotedString(System.DateTime.Now.ToString()));
  36.         message.Update(ht,id);
  37.         Response.Write("<Script Language=JavaScript>alert('回复成功!');</Script>");
  38.         Page.Response.Redirect("messagelist.aspx");
  39.     }
  40.     protected void ButtonBack_Click(object sender, EventArgs e)
  41.     {
  42.         Response.Redirect("messagelist.aspx");
  43.     }
  44. }