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); }
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); }
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(); }