Exemple #1
0
        public List <EmployeeDto> GetAllEmployee()
        {
            var employees = _employeeRepository.GetAll().Include(x => x.Experience).ToList();
            var list      = new List <Employee>();

            foreach (var emp in employees)
            {
                var employee = new Employee();
                employee.FirstName  = emp.FirstName;
                employee.LastName   = emp.LastName;
                employee.Email      = emp.Email;
                employee.LanguageId = emp.LanguageId;
                foreach (var exp in emp.Experience)
                {
                    var experience = new Experience();
                    experience.Note = exp.Note;
                    employee.Experience.Add(experience);
                }
                foreach (var device in employee.DeviceUsage)
                {
                    var deviceUsage = new DeviceUsage();
                    deviceUsage.StartDate = device.StartDate;
                    deviceUsage.EndDate   = device.EndDate;
                    deviceUsage.Deviceid  = device.Deviceid;
                    employee.DeviceUsage.Add(deviceUsage);
                }
                list.Add(employee);
            }
            return(list.MapTo <List <EmployeeDto> >());
        }
        public MobileDevice(Manufacturers deviceManufacturer, string modelName, Battery deviceBattery, Screen deviceScreen, double basePrice, long phoneNumber = 0)
        {
            DeviceManufacturer = deviceManufacturer;
            ModelName          = modelName;
            DeviceBattery      = deviceBattery;
            DeviceScreen       = deviceScreen;
            BasePrice          = basePrice;
            PhoneNumber        = phoneNumber;

            Usage = new DeviceUsage(this, 100);
        }
Exemple #3
0
        public void CreateDeviceUsage(DeviceUsageDto input)
        {
            var usage    = new DeviceUsage();
            var getUsage = _deviceUsageRepository.GetAll().Where(x => x.Deviceid == input.DeviceId && x.EndDate == null);

            usage.Deviceid   = input.DeviceId;
            usage.StartDate  = DateTime.Now;
            usage.EmployeeId = input.EmployeeId;
            if (getUsage.Any())
            {
                getUsage.First().EndDate = DateTime.Now;
            }
            _deviceUsageRepository.Insert(usage);
        }
Exemple #4
0
 /// <summary>	
 /// <p><strong>Applies to: </strong>desktop apps only</p><p>Creates a Microsoft DirectX Video Acceleration High Definition (DXVA-HD) device.</p>	
 /// </summary>	
 /// <param name="device"><dd> <p>A reference to the <strong><see cref="SharpDX.Direct3D9.DeviceEx"/></strong> interface of a Direct3D 9 device.</p> </dd></param>	
 /// <param name="contentDescription"><dd> <p>A reference to a <strong><see cref="SharpDX.MediaFoundation.DirectX.ContentDescription"/></strong> structure that describes the video content. The driver uses this information as a hint when it creates the device.</p> </dd></param>	
 /// <param name="usage"><dd> <p>A member of the <strong><see cref="SharpDX.MediaFoundation.DirectX.DeviceUsage"/></strong> enumeration, describing how the device will be used. The value indicates the desired trade-off between speed and video quality. The driver uses this flag as a hint when it creates the device.</p> </dd></param>	
 /// <remarks>	
 /// <p> Use the <strong><see cref="SharpDX.MediaFoundation.DirectX.HDDevice"/></strong> interface to get the device capabilities, create the video processor, and allocate video surfaces. </p>	
 /// </remarks>	
 /// <include file='..\Documentation\CodeComments.xml' path="/comments/comment[@id='DXVAHD_CreateDevice']/*"/>	
 /// <msdn-id>dd318412</msdn-id>	
 /// <unmanaged>HRESULT DXVAHD_CreateDevice([In] IDirect3DDevice9Ex* pD3DDevice,[In] const DXVAHD_CONTENT_DESC* pContentDesc,[In] DXVAHD_DEVICE_USAGE Usage,[In, Optional] __function__stdcall* pPlugin,[Out, Fast] IDXVAHD_Device** ppDevice)</unmanaged>	
 /// <unmanaged-short>DXVAHD_CreateDevice</unmanaged-short>	
 public HDDevice(SharpDX.Direct3D9.DeviceEx device, ContentDescription contentDescription, DeviceUsage usage)
 {
     DXVAFactory.CreateDevice(device, ref contentDescription, usage, null, this);
 }
Exemple #5
0
 /// <summary>
 /// <p><strong>Applies to: </strong>desktop apps only</p><p>Creates a Microsoft DirectX Video Acceleration High Definition (DXVA-HD) device.</p>
 /// </summary>
 /// <param name="device"><dd> <p>A reference to the <strong><see cref="SharpDX.Direct3D9.DeviceEx"/></strong> interface of a Direct3D 9 device.</p> </dd></param>
 /// <param name="contentDescription"><dd> <p>A reference to a <strong><see cref="SharpDX.MediaFoundation.DirectX.ContentDescription"/></strong> structure that describes the video content. The driver uses this information as a hint when it creates the device.</p> </dd></param>
 /// <param name="usage"><dd> <p>A member of the <strong><see cref="SharpDX.MediaFoundation.DirectX.DeviceUsage"/></strong> enumeration, describing how the device will be used. The value indicates the desired trade-off between speed and video quality. The driver uses this flag as a hint when it creates the device.</p> </dd></param>
 /// <remarks>
 /// <p> Use the <strong><see cref="SharpDX.MediaFoundation.DirectX.HDDevice"/></strong> interface to get the device capabilities, create the video processor, and allocate video surfaces. </p>
 /// </remarks>
 /// <include file='..\Documentation\CodeComments.xml' path="/comments/comment[@id='DXVAHD_CreateDevice']/*"/>
 /// <msdn-id>dd318412</msdn-id>
 /// <unmanaged>HRESULT DXVAHD_CreateDevice([In] IDirect3DDevice9Ex* pD3DDevice,[In] const DXVAHD_CONTENT_DESC* pContentDesc,[In] DXVAHD_DEVICE_USAGE Usage,[In, Optional] __function__stdcall* pPlugin,[Out, Fast] IDXVAHD_Device** ppDevice)</unmanaged>
 /// <unmanaged-short>DXVAHD_CreateDevice</unmanaged-short>
 public HDDevice(SharpDX.Direct3D9.DeviceEx device, ContentDescription contentDescription, DeviceUsage usage)
 {
     DXVAFactory.CreateDevice(device, ref contentDescription, usage, null, this);
 }