示例#1
0
 public void Load_cboxNXB()
 {
     string dt = "select * from NXB";
     cboxNXB.DisplayMember = "TenNXB";
     cboxNXB.DataSource = DatabaseService.getDataTable(dt);
 }
示例#2
0
 private void btnThem_Click(object sender, EventArgs e)
 {
     string them = @"insert into SACH values (N'" + cboxTheLoai.Text + "',N'" + txtTenSach.Text + "',N'" + cboxTacGia.Text + "',N'" + cboxNXB.Text + "','" + dateNgayNhap.Text + "','" + txtSLTon.Text + "','" + txtSLMuon.Text + "')";
     DatabaseService.executeQuery(them);
     Load_Data();
 }
示例#3
0
 // Load Tác Giả
 public void Load_cboxTacGia()
 {
     string dt = "select * from TACGIA";
     cboxTacGia.DisplayMember = "TenTG";
     cboxTacGia.DataSource = DatabaseService.getDataTable(dt);
 }
示例#4
0
 public void Load_cboxTheLoai()
 {
     string dt = "select * from THELOAI";
     cboxTheLoai.DisplayMember = "TenTL";
     cboxTheLoai.DataSource = DatabaseService.getDataTable(dt);
 }
示例#5
0
 public void Load_Data()
 {
     string str = @"select * from SACH";
     DataTable dt = DatabaseService.getDataTable(str);
     dataSach.DataSource = dt;
 }
示例#6
0
 private void btnCapNhat_Click(object sender, EventArgs e)
 {
     string CapNhatTS = @"update SACH set TheLoai=N'" + cboxTheLoai.Text + "',TenSach=N'" + txtTenSach.Text + "',TacGia=N'" + cboxTacGia.Text + "',NXB=N'" + cboxNXB.Text + "',NgayNhap=N'" + dateNgayNhap.Text + "',SLTon='" + txtSLTon.Text + "',SLMuon='" + txtSLMuon.Text + "' where MaSach='" + txtMaSach.Text + "'";
     DatabaseService.executeQuery(CapNhatTS);
     Load_Data();
 }
示例#7
0
 private void txtTim_TextChanged(object sender, EventArgs e)
 {
     string TimKiemTS = @"select * from SACH where TenSach LIKE N'%" + txtTim.Text + "%' or TacGia LIKE N'%" + txtTim.Text + "%' or TheLoai LIKE N'%" + txtTim.Text + "%'";
     DataTable dt = DatabaseService.getDataTable(TimKiemTS);
     dataSach.DataSource = dt;
 }