Пример #1
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);
        }
Пример #2
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();
        }
Пример #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.");
        }
Пример #4
0
        public ApplicationInfo()
        {
            DatabaseConnection.Initialize(@"SERVER\SQLEXPRESS", "Domotica", "kaku", "kaku");

              this._deviceCollection = new DeviceCollection();
              this._deviceCollection.GetAll();
              this._programCollection = new ProgramCollection();
              this._programCollection.GetAll();

              TcpClientHelperClass.Connect(IPAddress.Parse("192.168.1.1"), 8221);

              DeviceHelper.InitializeAsClient(Statics.DeviceViewCollection);
              DeviceHelper.OnDevicePowerOn += new DeviceHelper.DevicePowerEventDelegate(DeviceHelper_OnDevicePowerOn);
              DeviceHelper.OnDevicePowerOff += new DeviceHelper.DevicePowerEventDelegate(DeviceHelper_OnDevicePowerOff);
        }
Пример #5
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);
              }
        }
Пример #6
0
        public void Dispose()
        {
            //if (DatabaseConnection.IsInitialized)
            //DatabaseConnection.Close();

              if (_deviceCollection != null)
              {
            _deviceCollection.Clear();
            _deviceCollection = null;
              }

              if (_programCollection != null)
              {
            _programCollection.Clear();
            _programCollection = null;
              }

              //if (cm11 != null)
              //{
              //  cm11.Dispose();
              //  cm11.Close();
              //}
        }
Пример #7
0
 public Scheduler(ProgramCollection programCollection)
 {
     _programCollection = programCollection;
 }
Пример #8
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();
        }
Пример #9
0
 public ProgramCollection GetAllPrograms()
 {
     ProgramCollection programs = new ProgramCollection();
       programs.GetAll();
       return (programs);
 }