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(); }
/// <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); }
/// <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); }
/// <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); }
/// <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; }
public void RemoveDevice(Device device) { //StateManager.ApplicationInfo.DatabaseConnection.Remove(device); //StateManager.ApplicationInfo.DeviceList.Remove(device.ID.ToString()); }
public Device[] GetAllDevices() { StateManager.ApplicationInfo.DeviceCollection.GetAll(); Device[] devices = new Device[StateManager.ApplicationInfo.DeviceCollection.Count]; StateManager.ApplicationInfo.DeviceCollection.CopyTo(devices, 0); return (devices); }
public void AddDevice2Program(Guid programId, Device device) { }
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); }