private void GetItemList() { ItemList = new List <List <DtoItem> >(); DaoItem dao = new DaoItemNoDb(); dao.OpenConnection(); for (int i = 0; i < comboBox1.Items.Count; i++) { ItemList.Add(dao.GetItemList(new DtoItem() { TypeNumber = i })); } dao.CloseConnection(); }
public void CreateDataTable(int type) { Table = new DataTable(); var column1 = new DataColumn("未識別名", typeof(string)); var column2 = new DataColumn("アイテム名", typeof(string)); var column3 = new DataColumn("買値", typeof(int)); var column4 = new DataColumn("売値", typeof(int)); var column5 = new DataColumn("説明", typeof(string)); Table.Columns.Add(column1); Table.Columns.Add(column2); Table.Columns.Add(column3); Table.Columns.Add(column4); Table.Columns.Add(column5); DaoItem dao = new DaoItemNoDb(); try { dao.OpenConnection(); UnidentifiedList = dao.GetUnidentifiedItemList(new DtoItem() { TypeNumber = type }); ItemList = dao.GetItemList(new DtoItem() { TypeNumber = type }); } finally { dao.CloseConnection(); } SetDataTable(); }