Ejemplo n.º 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);
        }
Ejemplo n.º 2
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);
        }
Ejemplo n.º 3
0
        public void SerializeTest()
        {
            DatabaseConnection.Initialize(@"SERVER\SQLEXPRESS", "Domotica", "kaku", "kaku");
              DeviceCollection devices = new DeviceCollection();
              devices.GetAll();

              JsonSerializerSettings settings = new JsonSerializerSettings
              {
            TypeNameHandling = TypeNameHandling.All
              };

              List<Record> tests = new List<Record>();
              tests.Add(devices[0]);
              tests.Add(devices[1]);
              tests.Add(devices[2]);
              string jsonResultTest = JsonConvert.SerializeObject((Device)devices[0], settings);
              string jsonResultTests = JsonConvert.SerializeObject(tests);
              string jsonResult = JsonConvert.SerializeObject(devices);
        }
Ejemplo n.º 4
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();
              //}
        }
Ejemplo n.º 5
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();
        }