private void Form_Order_Load(object sender, EventArgs e) { btnThem.Enabled = false; btnGiam.Enabled = false; btnInPhieu.Enabled = false; btnThanhToan.Enabled = false; daTableMenu = spBus.GetThongTinMenu(); foreach (DataRow row in daTableMenu.Rows) { ListViewItem item = new ListViewItem(row["Ten"].ToString()); item.SubItems.Add(row["DonVi"].ToString()); item.SubItems.Add(row["GiaBan"].ToString()); item.SubItems.Add(row["MaSP"].ToString()); lstMenu.Items.Add(item); } foreach (Button bt in tabPage2.Controls) { int id = int.Parse(bt.Name.Substring(6)); tinhTrangBan = Convert.ToBoolean(banBus.GetTinhTrangBanByIDBan(id)["TinhTrang"]); if (tinhTrangBan == false) { bt.BackColor = Color.Green; } else { bt.BackColor = Color.Red; } } }
private void Form_QuanLyHangHoa_Load(object sender, EventArgs e) { dt = product.GetThongTinMenu(); dgvSanPham.DataSource = dt; }