Пример #1
0
        //Lấy All dữ liệu
        public List <Object> getphieuMuon_PMChiTietlq()
        {
            List <Object>     list = new List <object>();
            dbQLTVDataContext data = new dbQLTVDataContext();
            var sp = from p in data.PhieuMuon10s
                     join k in data.PhieuMuonChiTiet10s
                     on p.maPM equals k.maPM
                     select new { p.maPM, k.maTL, p.maDG, p.maNV, k.soLuongMuon, p.ngayMuon, k.ngayTra };

            foreach (var i in sp)
            {
                list.Add(i);
            }
            return(list);
        }
Пример #2
0
        //Lấy phiếu mượn chi tiết theo mã
        public List <Object> getphieuMuonChiTietlq(String x)
        {
            List <Object>     list = new List <object>();
            dbQLTVDataContext data = new dbQLTVDataContext();
            var sp = from p in data.PhieuMuonChiTiet10s
                     join k in data.TaiLieu10s
                     on p.maTL equals k.maTL
                     where p.maPM == x
                     select new { p.maTL, k.tenTL, p.soLuongMuon };

            foreach (var i in sp)
            {
                list.Add(i);
            }
            return(list);
        }
Пример #3
0
        //Kết nối CSDL là LINQ
        //Lấy dữ liệu
        public List <Object> getphieuMuonlq()
        {
            List <Object>     list = new List <object>();
            dbQLTVDataContext data = new dbQLTVDataContext();
            var sp = from p in data.PhieuMuon10s
                     join k in data.NhanVien10s
                     on p.maNV equals k.maNV
                     join h in data.DocGia10s
                     on p.maDG equals h.maDG
                     select new { p.maPM, h.maDG, h.hoTenDG, k.maNV, k.hoTenNV, p.ngayMuon };

            foreach (var i in sp)
            {
                list.Add(i);
            }
            return(list);
        }