public List <CTPhieuNhap_DTO> Search(CTPhieuNhap_DTO a, int kieusp, int loaisp) { var pmh = DB.CTPhieuNhapSearch(a.SoPhieuNhap, a.SLNhap, a.DonGia, a.ThanhTien, kieusp, loaisp); var MyQuery = (from pm in pmh select new CTPhieuNhap_DTO { SoPhieuNhap = pm.SoPhieuNhap, MaSP = pm.MaSP, SLNhap = pm.SLNhap ?? default(int), DonGia = pm.DonGia ?? default(decimal), ThanhTien = pm.ThanhTien ?? default(decimal), TenKieuSP = pm.TenKieuSP, TenLoaiSP = pm.TenLoaiSP, MaKieuSP = pm.MaKieuSP ?? default(int), MaLoaiSP = pm.MaLoaiSP ?? default(int) }); return(MyQuery.ToList()); }