public bool ChangeDeviceStatus(int deviceId, bool isActive) { string statusName = isActive ? Status.VALUE.DEVICE_ACTIVE.ToString() : Status.VALUE.DEVICE_BROKEN.ToString(); int statusId = statusDao.GetStatus(statusName).Id; return(deviceDao.UpdateDeviceStatusId(deviceId, statusId)); }