コード例 #1
0
ファイル: ShowTable.cs プロジェクト: calimeradriver/Domotica
        public ShowTable(Vendjuuren.Domotica.Library.Table table)
            : this()
        {
            switch (table)
              {
            case Vendjuuren.Domotica.Library.Table.Logs:
              LogCollection logCollection = new LogCollection();
              logCollection.GetAll();
              List<Log> logs = new List<Log>();

              foreach (Log log in logCollection)
              {
            logs.Add(log);
              }
              dataGridView.DataSource = logs;
              break;
            case Vendjuuren.Domotica.Library.Table.Programs:
              ProgramCollection programCollection = new ProgramCollection();
              programCollection.GetAll();
              List<Vendjuuren.Domotica.Library.Program> programs = new List<Vendjuuren.Domotica.Library.Program>();

              foreach (Vendjuuren.Domotica.Library.Program program in programCollection)
              {
            programs.Add(program);
              }
              dataGridView.DataSource = programs;
              break;
              }
              dataGridView.Update();
        }
コード例 #2
0
        public void RemoveDemoData()
        {
            ProgramCollection programCollection = new ProgramCollection();
              programCollection.GetAll();
              programCollection.DeleteAll();

              DeviceCollection deviceCollection = new DeviceCollection();
              deviceCollection.GetAll();
              deviceCollection.DeleteAll();

              ModelCollection modelCollection = new ModelCollection();
              modelCollection.GetAll();
              modelCollection.DeleteAll();

              BrandCollection brandCollection = new BrandCollection();
              brandCollection.GetAll();
              brandCollection.DeleteAll();

              LogCollection logCollection = new LogCollection();
              logCollection.GetAll();
              logCollection.DeleteAll();
        }