Пример #1
0
        //private bool them_themmoi = false;


        private void load_menu()
        {
            listView1.Items.Clear();
            menuBS bs = new menuBS();

            List <menuDB> ds = bs.loadMenu();

            for (int i = 0; i < ds.Count; i++)
            {
                cmbTen.Items.Add(ds[i].ten_sp.ToString());
            }
        }
        private void trung_dl()
        {
            menuBS bs = new menuBS();

            List <menuDB> ds = bs.loadMenu();

            for (int i = 0; i < ds.Count; i++)
            {
                if (txtMaSP.Text == ds[i].ma_sp.ToString())
                {
                    of = true;
                    break;
                }
            }
        }
        private void load_menu()
        {
            listView1.Items.Clear();
            menuBS bs = new menuBS();

            List <menuDB> ds = bs.loadMenu();

            for (int i = 0; i < ds.Count; i++)
            {
                listView1.Items.Add(ds[i].ma_sp.ToString());
                listView1.Items[i].SubItems.Add(ds[i].ten_sp.ToString());
                listView1.Items[i].SubItems.Add(ds[i].gia.ToString());
                listView1.Items[i].SubItems.Add(ds[i].ma_loai.ToString());
                listView1.Items[i].SubItems.Add(ds[i].img.ToString());
            }
        }
Пример #4
0
        private string convertToMaSP(string ten)
        {
            string text = "";
            menuBS bs   = new menuBS();

            List <menuDB> ds = bs.loadMenu();

            for (int i = 0; i < ds.Count; i++)
            {
                if (ten == ds[i].ten_sp.ToString())
                {
                    text = ds[i].ma_sp.ToString();
                    break;
                }
            }
            return(text);
        }