public TinNhanCollection SelectTinNhan_ChuaDoc(string nguoinhan)
 {
     hoctuvungLINQDataContext db = new hoctuvungLINQDataContext();
     IEnumerable<TinNhan> tinnhanList = from p in db.TinNhans
                                        where p.Nguoinhan == nguoinhan
                                        && p.XacNhan==false
                                        orderby p.NgayGoi ascending
                                        select p;
     //Addrange
     TinNhanCollection tinhanColl = new TinNhanCollection();
     foreach (TinNhan tin in tinnhanList)
     {
         TinNhanBO tn = new TinNhanBO();
         tn.TinNhanID = tin.TinNhanID.ToString();
         tn.NguoiNhan = tin.Nguoinhan;
         tn.NguoiGoi = tin.Nguoigoi;
         tn.NoiDung = tin.NoiDung;
         tn.NgayGoi = Convert.ToDateTime(tin.NgayGoi);
         tinhanColl.Add(tn);
     }
     return tinhanColl;
 }
    public void LoadChiTietTinNhan(string nguoinhan, string nguoigoi)
    {
        if (nguoinhan != "")
        {
            //Lấy nội dung tin nhắn
            TinNhanCollection tnColl = new TinNhanCollection();
            tnColl = tinnhanBUS.LayTinNhan(nguoinhan, nguoigoi);
            //tạo datasource cho GriView1
            DataTable dt = new DataTable();
            dt.Columns.Add("tinnhan");
            foreach (TinNhanBO tn in tnColl)
            {
                DataRow row= dt.NewRow();
                row["tinnhan"] = "- "+tn.NguoiGoi + " (" + tn.NgayGoi + "): " + tn.NoiDung;
                dt.Rows.Add(row);     
            }
            //Đổ dữ liệu vào GridView1
            GridView1.DataSource = dt;
            GridView1.DataBind();
         
          
        }

    }