示例#1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string Id = Request.QueryString["Id"];

        if (Session["MaNguoiDung"] == null)
        {
            Response.Redirect("Default.aspx");
        }
        else
        {
            if (Session["Quyen"].ToString() != "1")
            {
                if (Id != null)
                {
                    ThanhVien_ChuDe tv = new ThanhVien_ChuDe();
                    tv.MaChuDe = Convert.ToInt32(Id);
                    if (tv.LayMaNguoiDung() != Convert.ToInt32(Session["MaNguoiDung"]))
                    {
                        Response.Redirect("Default.aspx");
                    }
                }
                else
                {
                    Response.Redirect("Default.aspx");
                }
            }
        }

        if (!Page.IsPostBack)
        {
            ChuDe c = new ChuDe();
            c.MaChuDe   = Convert.ToInt32(Id);
            txtTen.Text = c.ChiTietChuDe()["tenchude"].ToString();
        }
    }
示例#2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string machude = Request.QueryString["Id"];

        if (!Page.IsPostBack)
        {
            try
            {
                ChuDe c = new ChuDe();
                c.MaChuDe = Convert.ToInt32(machude);
                DataRow dr = c.ChiTietChuDe();
                litChuDe.Text = dr["tenchude"].ToString();
                txtmacd.Text  = machude;

                if (Session["MaNguoiDung"] == null)
                {
                    txtChat.Enabled = false;
                }
                else
                {
                    ThanhVien_ChuDe tv = new ThanhVien_ChuDe();
                    tv.MaChuDe = Convert.ToInt32(machude);
                    if (tv.LayMaNguoiDung() == Convert.ToInt32(Session["MaNguoiDung"]) || Session["Quyen"].ToString() == "1")
                    {
                        litEdit.Text = "(<a href='Default.aspx?Function=SuaChuDe&Id=" + machude + "'>Sửa chủ đề</a>)";
                    }
                    txtmand.Text = Session["MaNguoiDung"].ToString();


                    if (txtChat.Text == null)
                    {
                        enter.Text = "hay nhap noi dung chat";
                    }
                }
            }
            catch { }
        }
    }