Пример #1
0
        private void updateList()
        {
            listView.Items.Clear();

            //get all the Movies from the database
            List <List <string> > list = dbc.getList("Movie");

            foreach (List <string> l in list)
            {
                //fill in one row in the listView
                Movie        m    = new Movie(Int32.Parse(l[0]), l[1], decimal.Parse(l[2]), l[3], DateTime.Parse(l[4]), l[5], l[6], Int32.Parse(l[7]), Int32.Parse(l[8]));
                ListViewItem item = new ListViewItem(new[] { m.id.ToString(), m.name });
                listView.Items.Add(item);
            }
        }
Пример #2
0
        //get all the transaction records and pu them to the ListView
        private void updateList()
        {
            listView.Items.Clear();

            //get all the transactions from the database
            List <List <string> > l = dbc.getList("Transaction");

            foreach (List <string> record in l)
            {
                //fill in one row in the listView
                Transaction  t    = new Transaction(Int32.Parse(record[0]), Int32.Parse(record[1]), Int32.Parse(record[2]), Int32.Parse(record[3]));
                ListViewItem item = new ListViewItem(new[] { t.id.ToString(), t.cust.name, t.mov.name, t.qty.ToString(), t.total.ToString() });
                listView.Items.Add(item);
            }
        }
Пример #3
0
        private void updateList()
        {
            listView.Items.Clear();

            //get all the customers from the database
            List <List <string> > list = dbc.getList("Customer");

            foreach (List <string> l in list)
            {
                //fill in one row in the listView
                Customer     c    = new Customer(Int32.Parse(l[0]), l[1], l[2], l[3], l[4]);
                ListViewItem item = new ListViewItem(new[] { c.id.ToString(), c.name });
                listView.Items.Add(item);
            }
        }