private void searchtxt_KeyUp(object sender, KeyEventArgs e) { QuanLiThuVienHVKTQSDataContext db = new QuanLiThuVienHVKTQSDataContext(); int i = 1; var lst = (from s in db.docgias where (s.sothe.ToString().Contains(searchtxt.Text) || s.hoten.ToString().Contains(searchtxt.Text)) select s).ToList(); listView_DG.Items.Clear(); foreach (docgia d in lst) { ListViewItem item = new ListViewItem(); item.Text = "" + i++; item.SubItems.Add(d.sothe.ToString()); item.SubItems.Add(d.hoten.ToString()); item.SubItems.Add(d.ngaysinh.ToString()); item.SubItems.Add(d.ngaylamthe.ToString()); listView_DG.Items.Add(item); } }
private void search_usertxt_TextChanged(object sender, EventArgs e) { QuanLiThuVienHVKTQSDataContext db = new QuanLiThuVienHVKTQSDataContext(); var list = (from u in db.Users where (u.ID.ToString().Contains(search_usertxt.Text) || u.UserName.ToString().Contains(search_usertxt.Text)) select u).ToList(); listView_User.Items.Clear(); int i = 1; foreach (User u in list) { ListViewItem item = new ListViewItem(); item.Text = "" + i++; item.SubItems.Add(u.ID.ToString()); item.SubItems.Add(u.UserName); item.SubItems.Add(u.Password); item.SubItems.Add(u.IsAdmin.ToString()); listView_User.Items.Add(item); } }
private void textBox1_TextChanged(object sender, EventArgs e) { int i = 1; QuanLiThuVienHVKTQSDataContext db = new QuanLiThuVienHVKTQSDataContext(); var lst = (from s in db.saches where (s.masach.ToString().Contains(search_sachtxt.Text) || s.tensach.ToString().Contains(search_sachtxt.Text)) select s).ToList(); lvSach.Items.Clear(); foreach (sach s in lst) { ListViewItem item = new ListViewItem(); item.Text = "" + i++; item.SubItems.Add(s.masach.ToString()); item.SubItems.Add(s.tensach.ToString()); item.SubItems.Add(s.theloai.ToString()); item.SubItems.Add(s.ngonngu.ToString()); item.SubItems.Add(s.soluong.ToString()); lvSach.Items.Add(item); } }
private void search_MStxt_TextChanged(object sender, EventArgs e) { int i = 1; QuanLiThuVienHVKTQSDataContext db = new QuanLiThuVienHVKTQSDataContext(); var lst = (from s in db.MuonSaches where (s.Mamuon.ToString().Contains(search_MStxt.Text) || s.sothe.ToString().Contains(search_MStxt.Text) || s.masach.ToString().Contains(search_MStxt.Text)) select s).ToList(); listView_MS.Items.Clear(); foreach (MuonSach m in lst) { ListViewItem item = new ListViewItem(); item.Text = "" + i++; item.SubItems.Add(m.Mamuon.ToString()); item.SubItems.Add(m.sothe.ToString()); item.SubItems.Add(m.masach.ToString()); item.SubItems.Add(m.soluong.ToString()); item.SubItems.Add(m.ngaymuon.ToString()); item.SubItems.Add(m.hantra.ToString()); item.SubItems.Add(m.manv.ToString()); listView_MS.Items.Add(item); } }
public UserController() { db = new QuanLiThuVienHVKTQSDataContext(); }
public MuonSachController() { db = new QuanLiThuVienHVKTQSDataContext(); }
public NhanVienController() { db = new QuanLiThuVienHVKTQSDataContext(); }
public DocGiaController() { db = new QuanLiThuVienHVKTQSDataContext(); db1 = new QuanLiThuVienHVKTQSDataContext(); }