using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class etw_c_m_noticeedit : System.Web.UI.Page
{
    public string id = string.Empty;
    protected void Page_Load(object sender, EventArgs e)
    {
        HttpCookie GetCookie = Request.Cookies["cook_admin"];
        if (Request.Cookies["cook_admin"] == null)
        {
            Response.Redirect("index.aspx");
        }
        if (Request.QueryString["id"] != null)
        {
            id = Request.QueryString["id"].ToString();
            if (!IsPostBack)
            {
                etw.etw_gonggao lead = new etw.etw_gonggao();
                lead.id = Convert.ToInt32(id);
                lead.GetModel();
                subject.Text = Fun.Decode(lead.subject);
                contentstr.Value = Fun.Decode(lead.content);
            }
        }
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        etw.etw_gonggao lead = new etw.etw_gonggao();
        lead.id = Convert.ToInt32(id);
        lead.subject = Fun.Encode(subject.Text);
        lead.content = Fun.Encode(Fun.NoHTML(contentstr.Value));
        lead.Update();
        Fun.JsAlerT("修改成功", "noticelist.aspx");
    }
}
