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 etwuser_Noticedetail : System.Web.UI.Page
{
    public string username = string.Empty;
    public string company = string.Empty;
    public string nid = string.Empty;
    public string subject = string.Empty;
    public string edittime = string.Empty;
    public string content = string.Empty;
    protected void Page_Load(object sender, EventArgs e)
    {
        HttpCookie ChatCookie = Request.Cookies["cookChatuser"];
        HttpCookie GetCookie = Request.Cookies["cookEtwuser"];
        if (Request.Cookies["cookChatuser"] == null)
        {
            if (Request.Cookies["cookEtwuser"] == null)
            {
                Response.Redirect("../index.aspx");
            }
            else
            {
                username = GetCookie["username"];
                DataSet ds = DbHelperSQL.Query("select userid,company from etw_user where username='" + username + "'");
                if (ds.Tables[0].Rows.Count > 0)
                {
                    company = ds.Tables[0].Rows[0]["company"].ToString();
                }
            }
        }
        else
        {
            username = ChatCookie["username"];
            DataSet ds1 = DbHelperSQL.Query("select id,userid,companyname from chat_user where username='" + username + "'");
            if (ds1.Tables[0].Rows.Count > 0)
            {
                company = ds1.Tables[0].Rows[0]["companyname"].ToString();
            }
        }
        if (Request.QueryString["nid"] != null)
        {
            nid = Request.QueryString["nid"].ToString();
            if (!IsPostBack)
            {
                etw.etw_gonggao lead = new etw.etw_gonggao();
                lead.id = Convert.ToInt32(nid);
                lead.GetModel();
                subject = lead.subject;
                edittime = lead.edittime;
                content = Fun.Decode(lead.content);
            }
        }
    }
}
