public ActionResult On(DeviceOld device) { SlapsteonFacade facade = new SlapsteonFacade(); facade.On(device.Name); return RedirectToAction("Index", "Home"); }
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); }