Beispiel #1
0
 static void testTablesName()
 {
     Acc ac = new Acc(DbFileName);
     System.Collections.Generic.List<string> list = ac.Tables();
     list.Sort();
     Trace.Assert(list[0] == TableName);
     Console.WriteLine("[OK]testTablesName");
 }
Beispiel #2
0
    static void testColumnsCount()
    {
        Acc ac = new Acc(DbFileName);
         ac.TableName = TableName;

        Trace.Assert(ac.Columns().Count == ColumnNumber);
        Console.WriteLine("[OK]testColumnsCount");
    }
Beispiel #3
0
    static void testDataTableQuery()
    {
        Acc ac = new Acc();

        DataTable dt = ac.getDataTableQuery(DbFileName, "select * from DrMST");
        Trace.Assert(dt.Rows.Count == 351);
        Console.WriteLine("[OK]testGetDataTableQuery");
    }
Beispiel #4
0
        public static void Main(string[] args)
        {
            string filename = FileName(args);
              Access acc = new Access(filename);

              //
              Lists tables = acc.Tables();
              displayList(tables);
              string itemString = inputListNumbers("選択Table ==> ");
              Console.WriteLine("選択された値 ===>> {0}", itemString);
              Lists ll = selectedList(tables, itemString);
              //

              if(ll.Count == 0) return;

              Dictionary<string, Lists> dicColumns = new Dictionary<string, Lists>();
              Dictionary<string, string> dicSelectedItem = new Dictionary<string, string>();
              //
              foreach(string table in ll){
            acc.TableName = table;
            List<string> items = acc.Columns();
            displayList(items);
            dicColumns[table] = items;
            dicSelectedItem[table] = inputListNumbers("選択するItems ==> ");
            Console.WriteLine(dicSelectedItem[table]);
              }

              foreach(string table in dicColumns.Keys){
            ConvertCSV csv = new ConvertCSV();

            Lists list =
              csv.ConvertTable2CsvString(
            acc.getDataTable(filename, table, selectedList(dicColumns[table], dicSelectedItem[table])));
              selectedList(dicColumns[table], dicSelectedItem[table]).ForEach(
            delegate(string name){
              Console.WriteLine(name);
            }
              );
            ExportFile file = new ExportFile(table+".csv", list);

            Thread th = new Thread(new ThreadStart(file.ExportList));
            th.Start();
              }
        }
Beispiel #5
0
 static void testTablesCount()
 {
     Acc ac = new Acc(DbFileName);
     Trace.Assert(ac.Tables().Count == TableNumber);
     Console.WriteLine("[OK]testTablesCount");
 }