コード例 #1
0
        public void UpdateTest()
        {
            DatabaseConnection.Initialize(@"SERVER\SQLEXPRESS", "Domotica", "kaku", "kaku");

              Device device = new Device();
              device.GetByID(new Guid("9AC77C6F-838F-49AB-95D1-B7E25CAE2F4B"));
              device.Power = Power.On;
              device.Save();
        }
コード例 #2
0
        /// <summary>
        /// Get Device from collection; queried with Linq
        /// </summary>
        /// <param name="groupLetter"></param>
        /// <param name="number"></param>
        /// <returns></returns>
        public Device GetDevice(Letter groupLetter, int number)
        {
            Device[] deviceArray = new Device[this.Count];
              this.CopyTo(deviceArray);

              var device =
            from d in deviceArray
            where d.Group.Letter == groupLetter && d.Number == number
            select d;

              return (device.SingleOrDefault() as Device);
        }
コード例 #3
0
ファイル: Program.cs プロジェクト: calimeradriver/Domotica
        /// <summary>
        /// 
        /// </summary>
        /// <param name="device"></param>
        public void RemoveDevice(Device device)
        {
            // Verwijder koppel records
              DevProgCollection devProgCollection = new DevProgCollection();
              devProgCollection.GetAllByDeviceID(device.ID);
              devProgCollection.DeleteAll();

              if (_deviceCollection != null)
            _deviceCollection.Remove(device);
        }
コード例 #4
0
ファイル: Program.cs プロジェクト: calimeradriver/Domotica
        /// <summary>
        /// 
        /// </summary>
        /// <param name="device"></param>
        public void AddDevice(Device device)
        {
            DevProg devProg = new DevProg(device, this);
              devProg.Save();

              if (_deviceCollection != null)
            _deviceCollection.Add(device);
        }
コード例 #5
0
ファイル: DevProg.cs プロジェクト: calimeradriver/Domotica
 /// <summary>
 /// Nieuw DevProg
 /// </summary>
 /// <param name="databaseConnection"></param>
 /// <param name="device"></param>
 /// <param name="program"></param>
 public DevProg(Device device, Program program)
     : base(new Vendjuuren.SQL.Table(TableName))
 {
     DevID = device.ID;
       ProgID = program.ID;
 }
コード例 #6
0
 public void RemoveDevice(Device device)
 {
     //StateManager.ApplicationInfo.DatabaseConnection.Remove(device);
       //StateManager.ApplicationInfo.DeviceList.Remove(device.ID.ToString());
 }
コード例 #7
0
 public Device[] GetAllDevices()
 {
     StateManager.ApplicationInfo.DeviceCollection.GetAll();
       Device[] devices = new Device[StateManager.ApplicationInfo.DeviceCollection.Count];
       StateManager.ApplicationInfo.DeviceCollection.CopyTo(devices, 0);
       return (devices);
 }
コード例 #8
0
 public void AddDevice2Program(Guid programId, Device device)
 {
 }
コード例 #9
0
        public Device AddDevice(Model model, Group group, int number, string name, string description)
        {
            Device device = new Device();
              device.GetByLetterNumber(group, number);

              if (device.ID == Guid.Empty)
              {
            device = new Device(model, group, number, name, description);
            device.Save();
              }

              return (device);
        }