Ejemplo n.º 1
0
        void loadDonHang()
        {
            listViewHoaDonGanDay.Items.Clear();
            List <DonHangNew> lst = funHome.getDonHangMoi();

            if (lst != null)
            {
                listViewHoaDonGanDay.FullRowSelect = true;
                listViewHoaDonGanDay.View          = View.Details;
                foreach (DonHangNew item in lst)
                {
                    ListViewItem lstViewItem = new ListViewItem();
                    lstViewItem.Text = item.maDonHang.ToString();
                    lstViewItem.SubItems.Add(new ListViewItem.ListViewSubItem()
                    {
                        Text = item.thanhTien.ToString()
                    });
                    lstViewItem.SubItems.Add(new ListViewItem.ListViewSubItem()
                    {
                        Text = item.tenKhachHang
                    });
                    lstViewItem.SubItems.Add(new ListViewItem.ListViewSubItem()
                    {
                        Text = item.tenNhanVien
                    });
                    lstViewItem.SubItems.Add(new ListViewItem.ListViewSubItem()
                    {
                        Text = item.tinhTrang
                    });
                    listViewHoaDonGanDay.Items.Add(lstViewItem);
                }
            }
        }
Ejemplo n.º 2
0
        private void frm_Home_Load(object sender, EventArgs e)
        {
            List <DonHangNew> lst = funHome.getDonHangMoi();

            if (lst != null)
            {
                listViewHoaDonGanDay.FullRowSelect = true;
                listViewHoaDonGanDay.View          = View.Details;

                foreach (DonHangNew item in lst)
                {
                    ListViewItem lstViewItem = new ListViewItem();
                    lstViewItem.Text = item.maDonHang.ToString();
                    lstViewItem.SubItems.Add(new ListViewItem.ListViewSubItem()
                    {
                        Text = item.tenKhachHang
                    });
                    lstViewItem.SubItems.Add(new ListViewItem.ListViewSubItem()
                    {
                        Text = item.ngayMua.ToString()
                    });
                    lstViewItem.SubItems.Add(new ListViewItem.ListViewSubItem()
                    {
                        Text = item.thanhTien.ToString()
                    });
                    listViewHoaDonGanDay.Items.Add(lstViewItem);
                }
            }
            this.WindowState = FormWindowState.Maximized;
        }