Exemple #1
0
    public DeviceView GetDeviceById(string id)
    {
        DeviceView deviceView = new DeviceView();
        Device     device     = serviceDao.GetDeviceById(Int32.Parse(id));

        deviceView.name           = device.name;
        deviceView.disabled       = device.disabled.Value;
        deviceView.nameDeviceType = device.TypeDevice.name;
        deviceView.id             = device.id;
        deviceView.addressMac     = device.adressMac;
        deviceView.EmployeeToEmployeeView(device.DeviceEmployees);
        return(deviceView);
    }
Exemple #2
0
    //********************************//
    //*********CALUL INTERFACE********//
    //********************************//

    public ICollection <DeviceView> GetListDevicesByEmployee()
    {
        ICollection <DeviceView> devices     = new Collection <DeviceView>();
        ICollection <Device>     listDevices = serviceDao.GetAllDevicesDao();

        foreach (Device device in listDevices)
        {
            DeviceView deviceView = new DeviceView();
            deviceView.id             = device.id;
            deviceView.name           = device.name;
            deviceView.addressMac     = device.adressMac;
            deviceView.disabled       = device.disabled.Value;
            deviceView.nameDeviceType = device.TypeDevice.name;
            deviceView.EmployeeToEmployeeView(device.DeviceEmployees);
            devices.Add(deviceView);
        }

        return(devices);
    }