private void HienThiPhieuUSer() { NguoiMuonSach nms = new NguoiMuonSach(); nms.Id = int.Parse(this.iddg); NguoiMuonSachBLL nmsbll = new NguoiMuonSachBLL(); List <NguoiMuonSach> dsngmsach = nmsbll.TimNguoiMuonTheoMa(nms); foreach (NguoiMuonSach tennms in dsngmsach) { this.ten = tennms.HoTen; } PhieuMuonSachDAO pms = new PhieuMuonSachDAO(); pms.TenNguoiMuonSach = ten; PhieuMuonSachBLL pmsdgbll = new PhieuMuonSachBLL(); List <PhieuMuonSachDAO> dsphieu = pmsdgbll.PhieuCuaDG(pms); lvPhieuMuonUser.Items.Clear(); foreach (PhieuMuonSachDAO ctpms in dsphieu) { ListViewItem lvi = new ListViewItem(ctpms.MaPhieuMuon + ""); lvi.SubItems.Add(ctpms.TenSach); lvi.SubItems.Add(ctpms.TrangThai); lvi.SubItems.Add(ctpms.NgayMuon.ToString()); lvi.SubItems.Add(ctpms.NgayDuKienTra.ToString()); lvi.SubItems.Add(ctpms.NgayTraSach.ToString()); lvPhieuMuonUser.Items.Add(lvi); } }
private void btnTimMa_Click(object sender, EventArgs e) { errorTimMa.SetError(txtTimMa, ""); if (txtTimMa.Text == "") { errorTimMa.SetError(txtTimMa, "Vui lòng nhập mã càn tìm"); return; } errorIntTimMa.SetError(txtTimMa, ""); if (!txtTimMa.Text.All(char.IsDigit)) { errorTimMa.SetError(txtTimMa, "Mã là số"); return; } NguoiMuonSach nms = new NguoiMuonSach(); nms.Id = int.Parse(txtTimMa.Text); NguoiMuonSachBLL ngmsachbll = new NguoiMuonSachBLL(); List <NguoiMuonSach> dsngmsach = ngmsachbll.TimNguoiMuonTheoMa(nms); lvNguoiMuonSachDS.Items.Clear(); foreach (NguoiMuonSach nmsbll in dsngmsach) { ListViewItem lvi = new ListViewItem(nmsbll.Id + ""); lvi.SubItems.Add(nmsbll.HoTen); lvi.SubItems.Add(nmsbll.SoDienThoai); //lvi.SubItems.Add(nms.BieuHien); lvi.SubItems.Add(nmsbll.DiaChi); lvi.SubItems.Add(nmsbll.Email); lvi.SubItems.Add(nmsbll.NamSinh + ""); lvNguoiMuonSachDS.Items.Add(lvi); } }