Esempio n. 1
0
        public List <Device> GetDeviceList(int roomId, string searchValue, int pageIndex, int pageSize)
        {
            int           statusId         = statusDao.GetStatus(Status.VALUE.DEVICE_INACTIVE.ToString()).Id;
            List <Device> devices          = deviceDao.GetDevices(roomId, searchValue, statusId, (pageIndex - 1) * pageSize, pageSize);
            int           categoryStatusId = statusDao.GetStatus(Status.VALUE.CATEGORY_ACTIVE.ToString()).Id;

            foreach (var device in devices)
            {
                device.StatusName = statusDao.GetStatus(device.StatusId).Name;
                if (device.CategoryId != 0)
                {
                    device.CategoryName = categoryDao.GetCategory(device.CategoryId, categoryStatusId).Name;
                }
            }
            return(devices);
        }
Esempio n. 2
0
 public List <Device> GetDevices(bool checkPublished = false, bool published = true)
 {
     return(_dao.GetDevices(checkPublished, published));
 }