// tìm kiếm tài liệu và công văn
        public List <TaiLieu1> TimKiem(string keyword)
        {
            string sql = "select * from TAILIEU where TENFILE like N'%" + keyword + "%' order by IDFILE desc";

            dah.KetNoi();
            DataTable dt = dah.LoadDuLieu(sql);

            dah.NgatKetNoi();
            List <TaiLieu1> ds = new List <TaiLieu1>();

            foreach (DataRow dr in dt.Rows)
            {
                TaiLieu1 tl = new TaiLieu1();
                tl.IDFile   = int.Parse(dr[0].ToString());
                tl.TenFile  = dr[1].ToString();
                tl.Ngaydang = DateTime.Parse(dr[2].ToString());
                tl.Link     = dr[3].ToString();
                ds.Add(tl);
            }
            this.DanhSachTaiLieu = ds;
            return(ds);
        }
        public void ThemFile(TaiLieu1 tl)
        {
            string sql = "insert into TAILIEU values(N'" + tl.TenFile + "','" + tl.Ngaydang + "','" + tl.Link + "')";

            dah.ThucThi(sql);
        }
Beispiel #3
0
 public void ThemFile(TaiLieu1 tl)
 {
     tldal.ThemFile(tl);
 }