示例#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)
    {
        if (Request.QueryString["p1"] == null)
        {
            string          id = Request.QueryString["Id"];
            ThanhVien_ChuDe tv = new ThanhVien_ChuDe();
            tv.MaChuDe = Convert.ToInt32(id);

            rptList.DataSource = tv.DanhSach();
            rptList.DataBind();
        }
        else
        {
            try
            {
                int        maNguoiDung1 = Convert.ToInt32(Request.QueryString["p1"]);
                int        maNguoiDung2 = Convert.ToInt32(Request.QueryString["p2"]);
                ChatCaNhan chatCaNhan   = new ChatCaNhan(maNguoiDung1, maNguoiDung2);
                DataTable  listChat     = chatCaNhan.GetData();
                rptList.DataSource = listChat;
                rptList.DataBind();
            }
            catch (Exception)
            {
            }
        }
    }
示例#3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string          id = Request.QueryString["Id"];
        ThanhVien_ChuDe tv = new ThanhVien_ChuDe();

        tv.MaChuDe = Convert.ToInt32(id);

        rptList.DataSource = tv.DanhSachTV();
        rptList.DataBind();
    }
示例#4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string chude   = Request.QueryString["chude"];
        string noidung = Request.QueryString["noidung"];
        string mand    = Request.QueryString["mand"];

        if (noidung.Trim() != "")
        {
            ThanhVien_ChuDe tv = new ThanhVien_ChuDe();
            tv.MaChuDe     = Convert.ToInt32(chude);
            tv.MaNguoiDung = Convert.ToInt32(mand);
            tv.NoiDungChat = noidung;
            tv.TaoChuDe    = 0;
            tv.Them();
        }
    }
示例#5
0
    protected void btnConfirm_Click(object sender, EventArgs e)
    {
        try
        {
            ChuDe c = new ChuDe();
            c.TenChuDe = txtTen.Text;

            ThanhVien_ChuDe tvcd = new ThanhVien_ChuDe();
            tvcd.MaChuDe     = c.ThemChuDe();
            tvcd.TaoChuDe    = 1;
            tvcd.MaNguoiDung = Convert.ToInt32(Session["MaNguoiDung"]);
            tvcd.NoiDungChat = txtNoiDung.Text;
            tvcd.Them();

            Response.Redirect("Default.aspx?Function=Chat&Id=" + tvcd.MaChuDe);
        }
        catch
        {
            litErr.Text = "Không tạo được chủ đề!";
        }
    }
示例#6
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 { }
        }
    }