private void LoadBanAn() { lstBanAn = BanAn_BUS.LoadBanAn(); dtgrvDanhSachBan.DataSource = lstBanAn; if (lstBanAn == null) { return; } dtgrvDanhSachBan.Columns["ID"].HeaderText = "ID"; dtgrvDanhSachBan.Columns["TenBan"].HeaderText = "Tên Bàn"; dtgrvDanhSachBan.Columns["TrangThai"].HeaderText = "Trạng Thái"; dtgrvDanhSachBan.Columns["Ngay"].HeaderText = "Ngày"; dtgrvDanhSachBan.Columns["IDBan"].Width = 50; dtgrvDanhSachBan.Columns["TenBan"].Width = 100; dtgrvDanhSachBan.Columns["TrangThai"].Width = 100; dtgrvDanhSachBan.Columns["ID"].Visible = false; if (lstBanAn != null) { lbSoBanHienCo.Text = (lstBanAn.Count).ToString(); } else { lbSoBanHienCo.Text = "0"; } }
void LoadBanAn() { lstBanAn = BanAn_BUS.LoadBanAn(); cbChuyenBan.DataSource = lstBanAn; cbChuyenBan.SelectedIndex = 0; cbChuyenBan.DisplayMember = "TenBan"; cbChuyenBan.ValueMember = "ID"; }
private void LoadBanAn() { danhSachBanAn = BanAn_BUS.LoadBanAn(); if (danhSachBanAn == null) { return; } for (int i = 0; i < danhSachBanAn.Count; i++) { banAn = new ListViewItem(); if (danhSachBanAn[i].TrangThai == "Có Người") { banAn.ImageIndex = 0; } else { banAn.ImageIndex = 1; } banAn.Text = danhSachBanAn[i].TenBan; listBanAn.Items.Add(banAn); } }