Ejemplo n.º 1
0
        private void lstDanhSachThread_SelectedIndexChanged_1(object sender, EventArgs e)
        {
            txtbNoiDungThread.Clear();
            ThreadBUS tbus = new ThreadBUS();
            DataTable dt1  = new DataTable();

            dt1 = tbus.ThongTinThread(int.Parse(lstDanhSachThread.SelectedValue.ToString()));

            string sContent = dt1.Rows[0]["Title"].ToString() + "\r\n";

            sContent += dt1.Rows[0]["Name"].ToString() + " - " + dt1.Rows[0]["TimePost"].ToString() + "\r\n";
            sContent += dt1.Rows[0]["Content"].ToString();

            ReplyThreadBUS rtbus = new ReplyThreadBUS();
            DataTable      dt2   = new DataTable();

            dt2 = rtbus.LayDanhSach(int.Parse(lstDanhSachThread.SelectedValue.ToString()));
            for (int i = 0; i < dt2.Rows.Count; i++)
            {
                sContent += "\r\n \r\n";
                sContent += dt2.Rows[i]["Name"].ToString() + " - " + dt2.Rows[0]["TimePost"].ToString() + "\r\n";
                sContent += dt2.Rows[i]["Content"].ToString();
            }

            txtbNoiDungThread.Text = sContent;
        }
Ejemplo n.º 2
0
        private void btnPost_Click(object sender, EventArgs e)
        {
            ReplyThreadDTO rtdto = new ReplyThreadDTO();

            rtdto.StudentID = GlobalVarian.StudentID;
            rtdto.ThreadID  = int.Parse(lstDanhSachThread.SelectedValue.ToString());
            rtdto.Time      = DateTime.Now;
            rtdto.Content   = txtbNoiDungPost.Text;

            ReplyThreadBUS rtbus = new ReplyThreadBUS();

            rtbus.ThemReply(rtdto);

            txtbNoiDungThread.Text += "\r\n \r\n"; //Them Ten Nguoi Goi + Ngay Thang
            txtbNoiDungThread.Text += GlobalVarian.StudentName + " - " + DateTime.Now.ToString();
            txtbNoiDungThread.Text += "\r\n" + txtbNoiDungPost.Text;
            txtbNoiDungPost.Clear();
        }