public List <CTPhieuMua_DTO> Search(CTPhieuMua_DTO a, int kieusp, int loaisp) { var pmh = DB.CTPhieuMuaSearch(a.SoPhieuMua, a.STT, a.SoLuong, a.DonGia, a.ThanhTien, kieusp, loaisp); var MyQuery = (from mh in pmh select new CTPhieuMua_DTO { SoPhieuMua = mh.SoPhieuMua, STT = mh.STT, SoLuong = mh.SoLuong ?? default(int), DonGia = mh.DonGia ?? default(int), ThanhTien = mh.ThanhTien ?? default(decimal), MaSP = mh.MaSP ?? default(int), TenKieuSP = mh.TenKieuSP, TenLoaiSP = mh.TenLoaiSP, MaKieuSP = mh.MaKieuSP ?? default(int), MaLoaiSP = mh.MaLoaiSP ?? default(int) }); return(MyQuery.ToList()); }