Ejemplo n.º 1
0
        public ActionResult List()
        {
            List<SlapsteonDevice> devices = (new SlapsteonFacade()).GetDevices();

            List<DeviceOld> deviceList = new List<DeviceOld>();

            foreach (SlapsteonDevice dev in devices)
            {
                int level;
                int.TryParse(dev.Status, out level);
                DeviceOld device = new DeviceOld();
                device.Address = dev.Address;
                device.Status = level;
                device.Name = dev.Name;
                device.LastOff = dev.LastOff;
                device.LastOn = dev.LastOn;
                device.IsFan = dev.IsFan;
                device.IsPLM = dev.IsPLM;
                device.IsDimmable = dev.IsDimmable;
                deviceList.Add(device);
            }

            DeviceList deviceListModel = new DeviceList(deviceList);

            return DeviceListView(deviceListModel);
        }
Ejemplo n.º 2
0
 private ActionResult DeviceListView(DeviceList deviceListModel)
 {
     return View("List", deviceListModel);
 }