Exemple #1
0
        public void UpdateComboBox()
        {
            var q = from Model.Item i in controller.GetAllItems()
                    orderby i.ItemId
                    select i;

            comboBox1.DataSource = q.ToList();
        }
Exemple #2
0
        private void loadItems(string arg)
        {
            List <Model.Item> items = new List <Model.Item>();

            if (arg == "all")
            {
                items = controller.GetAllItems();
            }
            else if (arg == "late")
            {
                items = controller.GetLateItems();
            }
            else if (arg == "borrowed")
            {
                items = (from Model.Item i in controller.GetAllItems()
                         where i.State == Model.State.Unavailable
                         select i).ToList();
            }
            dataGridView1.DataSource = items;
        }