lvItems.Clear();
using (var db = new InventContext())
{
var employee = db.Employee.Where(em => em.Name == selectedItem.Text);
var emp = employee.First();
var items = db.Item.Where(i => i.Employee == emp.id);
if (items != null)
{
foreach (var item in items)
{
ListViewItem lvItem = new ListViewItem(
new string[] {
item.id.ToString(),
item.ItemType.Name,
item.Name,
item.Count.ToString(),
item.DateOfIssue.ToString(),
item.DeliveryDate.ToString()
});
lvItems.Items.Add(lvItem);
}
}
}
if (items != null)
private void seedListView()
{
//Define
var data = new[]
{
new []{"Lollipop", "392", "0.2", "0"},
new []{"KitKat", "518", "26.0", "7"},
new []{"Ice cream sandwich", "237", "9.0", "4.3"},
new []{"Jelly Bean", "375", "0.0", "0.0"},
new []{"Honeycomb", "408", "3.2", "6.5"}
};
//Add
foreach (string[] version in data)
{
var item = new ListViewItem(version);
materialListView1.Items.Add(item);
}
}