void LoadThongTin() { ThongTinSach temp = SBLL.LayThongTinSach(MaSach); lbMaDauSach.Text = temp.MaDauSach; MaDauSach = temp.MaDauSach; lbTenDauSach.Text = temp.TenDauSach; lbTacGia.Text = temp.TenTacGia; lbTheLoai.Text = temp.TheLoai; lbNgonNgu.Text = temp.NgonNgu; lbNhaXuatBan.Text = temp.NhaXuatBan; lbMaSach.Text = temp.MaSach; lbMaDauSach.Text = temp.MaDauSach; lbNgayThem.Text = temp.NgayThem; nbTap.Value = temp.Tap; nbLanTB.Value = temp.LanTaiBan; nbTang.Value = temp.Tang; nbNgan.Value = temp.Ngan; txbSoTrang.Text = temp.SoTrang.ToString(); txbNamXB.Text = temp.NamXuatBan.ToString("dd/MM/yyyy"); txbTinhTrang.Text = temp.TinhTrang; cbGia.Text = temp.MaGiaSach.ToString() + " - " + temp.TenGiaSach; // Gợi ý dữ liệu cho giá sách List <GiaSach> LGS = SBLL.LayGiaSach(); foreach (GiaSach a in LGS) { cbGia.Items.Add(a.MaGiaSach.ToString() + " - " + a.TenGiaSach); } // }
void LoadThongTin() { ThongTinSach temp = SBLL.LayThongTinSach(MaSach); lbMaDauSach.Text = temp.MaDauSach; MaDauSach = temp.MaDauSach; lbTenDauSach.Text = temp.TenDauSach; lbTacGia.Text = temp.TenTacGia; lbTheLoai.Text = temp.TheLoai; lbNgonNgu.Text = temp.NgonNgu; lbNhaXuatBan.Text = temp.NhaXuatBan; lbMaSach.Text = temp.MaSach; lbMaDauSach.Text = temp.MaDauSach; lbNgayThem.Text = temp.NgayThem; nbTap.Value = temp.Tap; nbLanTB.Value = temp.LanTaiBan; nbTang.Value = temp.Tang; nbNgan.Value = temp.Ngan; txbSoTrang.Text = temp.SoTrang.ToString(); txbNamXB.Text = temp.NamXuatBan.ToString("dd/MM/yyyy"); txbTinhTrang.Text = temp.TinhTrang; cbGia.Text = temp.MaGiaSach.ToString() + " - " + temp.TenGiaSach; if (temp.HinhAnh != "") { pictureBox1.Image = new Bitmap(Application.StartupPath + "\\HinhAnh\\" + temp.HinhAnh); } // Gợi ý dữ liệu cho giá sách List <GiaSach> LGS = SBLL.LayGiaSach(); foreach (GiaSach a in LGS) { cbGia.Items.Add(a.MaGiaSach.ToString() + " - " + a.TenGiaSach); } // }
private void ThemSach_Load(object sender, EventArgs e) { // Gợi ý dữ liệu cho Đầu sách AutoCompleteStringCollection autotext = new AutoCompleteStringCollection(); List <DauSach> LDS = SBLL.LayDauSach(); foreach (DauSach a in LDS) { string temp = a.TenDauSach + " - " + a.MaDauSach; temp = temp.Trim(); autotext.Add(temp); } cbDauSach.AutoCompleteMode = AutoCompleteMode.Suggest; cbDauSach.AutoCompleteSource = AutoCompleteSource.CustomSource; cbDauSach.AutoCompleteCustomSource = autotext; // Gợi ý dữ liệu cho giá sách List <GiaSach> LGS = SBLL.LayGiaSach(); cbGia.Text = LGS[0].MaGiaSach.ToString() + " - " + LGS[0].TenGiaSach; foreach (GiaSach a in LGS) { cbGia.Items.Add(a.MaGiaSach.ToString() + " - " + a.TenGiaSach); } }