private void mau()
        {
            BanBS        bs = new BanBS();
            List <BanDB> ds = bs.tang();

            for (int i = 0; i < ds.Count; i++)
            {
                if (ds[i].trang_thai.ToString() == "True")
                {
                    listView1.Items[i].BackColor = Color.Red;
                }
            }
        }
        private void trung_dl()
        {
            BanBS bs = new BanBS();

            List <BanDB> ds = bs.tang();

            for (int i = 0; i < ds.Count; i++)
            {
                if (txtMa.Text == ds[i].ma_ban.ToString())
                {
                    of = true;
                    break;
                }
            }
        }
        private void loadban()
        {
            listView1.Items.Clear();
            BanBS        bs = new BanBS();
            List <BanDB> ds = bs.tang();

            for (int i = 0; i < ds.Count; i++)
            {
                listView1.Items.Add(ds[i].ma_ban.ToString());
                listView1.Items[i].SubItems.Add(ds[i].ten_ban.ToString());
                listView1.Items[i].SubItems.Add(ds[i].trang_thai.ToString());
                listView1.Items[i].SubItems.Add(ds[i].matang.ToString());
            }
            mau();
        }
예제 #4
0
        private string convertToMaBan(string ban)
        {
            string text = "";
            BanBS  bs   = new BanBS();

            List <BanDB> ds = bs.tang();

            for (int i = 0; i < ds.Count; i++)
            {
                if (cmbBan.Text == ds[i].ten_ban.ToString())
                {
                    text = ds[i].ma_ban.ToString();
                    break;
                }
            }
            return(text);
        }