Example #1
0
        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();
        }
Example #2
0
        protected void Application_BeginRequest(object sender, EventArgs e)
        {
            DeviceCollection deviceCollection = new DeviceCollection();
              deviceCollection.GetAll();

              ProgramCollection programCollection = new ProgramCollection();
              programCollection.GetAll();

              //Scheduler scheduler = new Scheduler(StateManager.ApplicationInfo.DatabaseConnection, programCollection);
              //scheduler.Start();

              //DeviceList devices = new DeviceList(StateManager.ApplicationInfo.DatabaseConnection);
              //devices.GetAll();

              //Device device = new Device(StateManager.ApplicationInfo.DatabaseConnection);
              //device.GetByID(new Guid("06B61A32-554C-4992-B4A6-F718BA988F38"));
              //Group group = device.Group;
              //device.Power = Power.Off;
              //device.Save();

              //TestRecord newTestRecord = new TestRecord(StateManager.ApplicationInfo.DatabaseConnection, group, 1, "", "");
              //newTestRecord.Save();

              //Group group = new Group(StateManager.ApplicationInfo.DatabaseConnection);
              //group.GetByLetter(Letter.C);

              //Device device = new Device(StateManager.ApplicationInfo.DatabaseConnection);
              //device.GetByLetterNumber(group, 120);
              //Kaku.PowerDeviceOn(StateManager.ApplicationInfo.DatabaseConnection, device);
        }
Example #3
0
        public void DatabaseConnectionTest()
        {
            DatabaseConnection.Initialize(@"SERVER\SQLEXPRESS", "Domotica", "kaku", "kaku");

              Assert.IsTrue(DatabaseConnection.IsInitialized, "DatabaseConnection is niet geïnitialiseerd.");
              DeviceViewCollection devCol = new DeviceViewCollection();
              devCol.GetAll();
              Assert.IsTrue(devCol.Count > 0, "Er zijn geen devices gevonden.");

              ProgramCollection progCol = new ProgramCollection();
              progCol.GetAll();
              Assert.IsTrue(progCol.Count > 0, "Er zijn geen programs gevonden.");
        }
Example #4
0
        public Overview()
        {
            InitializeComponent();

              ProgramCollection programCollection = new ProgramCollection();
              programCollection.GetAll();

              foreach (Vendjuuren.Domotica.Library.Program program in programCollection)
              {
            TreeNode programNode = new TreeNode(program.Name);

            foreach (Device device in program.DeviceCollection)
            {
              programNode.Nodes.Add(device.Name);
            }
            treeView1.Nodes.Add(programNode);
              }
        }
        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();
        }
 public ProgramCollection GetAllPrograms()
 {
     ProgramCollection programs = new ProgramCollection();
       programs.GetAll();
       return (programs);
 }