Exemplo n.º 1
0
        public Suon(ref List <SanPham> sanphams)
        {
            InitializeComponent();

            BindingSource source = new BindingSource();

            source.DataSource = SPController.getListSP();

            DisPlayInformation();
        }
Exemplo n.º 2
0
        void DisPlayInformation()
        {
            listInformation.Items.Clear();

            List <SanPham> sanPhams = SPController.getListSP();

            foreach (SanPham sanPham in sanPhams)
            {
                ListViewItem item = new ListViewItem(sanPham.ID.ToString());
                item.SubItems.Add(sanPham.MaSanPham);
                item.SubItems.Add(sanPham.TenSanPham);
                item.SubItems.Add(sanPham.GiaSanPham);
                item.SubItems.Add(sanPham.NgayIn.ToString());

                listInformation.Items.Add(item);
            }
        }