Esempio n. 1
0
        public async Task <IActionResult> Resume(int id)
        {
            var employee = await _employeeService.GetEmployee(id);

            var qualifs = await _sysAdminService.GetReferences(ReferenceTypeEnum.Qualification);

            var model = new ResumeViewModel
            {
                ActiviteStatus     = employee.ActiveStatus,
                CurrentDutyName    = employee.DutyName,
                CurrentProjectName = employee.ProjectName,
                EmployeeID         = employee.ID,
                EmployeeName       = employee.Name,
                OrganizationName   = (await _sysAdminService.GetOrganiztion(employee.OrganizationID)).Name,
                SpecialtyName      = (await _sysAdminService.GetReference(employee.SpecialtyID)).ReferenceValue,
                Title          = employee.Title,
                Certifications = (await _employeeService.GetCertifications(id))
                                 .Select(c => CertViewModel.Create(c, employee, qualifs)).ToArray(),
                Logs = (from il in await _analysisService.GetStaffInLogs(id)
                        select new TransferLog
                {
                    Date = il.InDate,
                    FromDuty = "",
                    FromProject = "",
                    LogType = TransferLogType.In,
                    TimeStamp = il.CreatedOn,
                    ToProject = il.ProjectName,
                    ToDuty = il.DutyName,
                }).Union(
                    from ol in await _analysisService.GetStaffOutLogs(id)
                    select new TransferLog
                {
                    Date        = ol.OutDate,
                    FromDuty    = ol.DutyName,
                    FromProject = ol.ProjectName,
                    LogType     = TransferLogType.Out,
                    TimeStamp   = ol.CreatedOn,
                    ToProject   = "",
                    ToDuty      = "",
                }
                    ).OrderBy(l => l.Date).ThenBy(l => l.TimeStamp).ToArray(),
            };

            return(View(model));
        }
Esempio n. 2
0
        public async Task <IActionResult> EditOrganization(int id)
        {
            OrgViewModel model = await _sysAdminSvc.GetOrganiztion(id);

            return(View(model));
        }