Example #1
0
        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();
        }
        public DataTable GetDataTable()
        {
            Table = new DataTable();

            var column1 = new DataColumn("TYPENUMBER", typeof(int));
            var column2 = new DataColumn("TYPENAME", typeof(string));

            Table.Columns.Add(column1);
            Table.Columns.Add(column2);

            DaoItem dao = new DaoItemNoDb();

            try
            {
                dao.OpenConnection();
                TypeList = dao.GetTypeList();
            }
            finally
            {
                dao.CloseConnection();
            }

            if (TypeList != null && TypeList.Count != 0)
            {
                foreach (var type in TypeList)
                {
                    Table.Rows.Add(
                        new object[]
                    {
                        type.TypeNumber, type.TypeName
                    });
                }
            }

            return(Table);
        }