public SachView GetSachViewByMaSach(int masach) { SachView sach = new SachView(); foreach (SachView i in getListSachView_BLL("", "All", "All")) { if (i.MaSach == masach) { sach = i; break; } } return(sach); }
public void SetGUI() { numNamXuatBan.Maximum = DateTime.Now.Year; numGiaMua.Maximum = int.MaxValue; numGiaBan.Maximum = int.MaxValue; if (masach != 0) { SachView sach = BLL_Sach.Instance.GetSachViewByMaSach(masach); txtBookID.Text = sach.MaSach.ToString(); txtTenSach.Text = sach.TenSach.ToString(); cbbLinhVuc.SelectedIndex = cbbLinhVuc.Items.IndexOf(sach.TenLinhVuc); cbbLoaiSach.SelectedIndex = cbbLoaiSach.Items.IndexOf(sach.TenLoaiSach); txtTacGia.Text = sach.TenTacGia; txtNXB.Text = sach.NhaXuatBan; numLanTaiBan.Value = Convert.ToInt32(sach.LanTaiBan); numNamXuatBan.Value = Convert.ToInt32(sach.NamXuatBan); numGiaBan.Value = sach.GiaBia; numGiaMua.Value = sach.GiaMua; } }