public IEnumerable <CPhieuDKKhamModel> getDSPhieuDKKhamByDS(string maNV) { NhanVien nv = (NhanVien)tc.getDSNhanVien().Where(x => x.MaNhanVien == maNV); LichKham lk_nv_p = (LichKham)tc.getDSLichKham().Where(x => x.NhanVienID == nv.IDNhanVien); List <PhieuDKKham> ds_pdkk_nv_phong = new List <PhieuDKKham>(); foreach (PhieuDKKham a in tc.getDSPhieuDKKham()) { List <CTDKPhongKham> dsDKPK = a.CTDKPhongKham.ToList(); foreach (CTDKPhongKham b in dsDKPK) { if (b.PhongKhamID == lk_nv_p.PhongKhamID) { ds_pdkk_nv_phong.Add(a); } } } return(ds_pdkk_nv_phong.Select(x => new CPhieuDKKhamModel { IDPhieuDKKham = x.IDPhieuDKK, MaPhieuDKKham = x.MaPhieuDKK, NgayLap = x.NgayLap.Value.ToShortDateString(), MaBenhNhan = x.BenhNhan.MaBenhNhan.ToString(), TenBenhNhan = x.BenhNhan.HoTen.ToString(), NgaySinh = x.BenhNhan.NgaySinh.Value.ToShortDateString(), CMND = x.BenhNhan.CMND == null ? string.Empty : x.BenhNhan.CMND.ToString(), MaNhanVien = x.NhanVien.MaNhanVien.ToString(), })); }
public List <LichKham> getDSLichKham() { return(tc.getDSLichKham().ToList()); }