Esempio n. 1
0
        public async Task <ActionResult> FindCurrentEmployee()
        {
            var email = User.Identity.Name;

            if (email == null)
            {
                return(PartialView("NullView"));
            }


            var employee = await ApplicationService.EmployeeService.EmployeeFindCurrentEmployee(email);

            var employeeToReturn = new ReturnEmployeeViewModel()
            {
                EmployeeUID         = employee.EmployeeUID,
                EmployeeName        = employee.EmployeeName,
                EmployeeSurname     = employee.EmployeeSurname,
                EmployeeBacklogDays = employee.EmployeeBacklogDays
            };

            return(PartialView(employeeToReturn));
        }
Esempio n. 2
0
        public async Task <ActionResult> GetEmployee(Guid employeeUID)
        {
            if (!ModelState.IsValid)
            {
                return(View(employeeUID));
            }

            var employee = await ApplicationService.EmployeeService.EmployeeGetEmployee(employeeUID);

            var employeeToReturn = new ReturnEmployeeViewModel()
            {
                EmployeeUID            = employee.EmployeeUID,
                EmployeeName           = employee.EmployeeName,
                EmployeeSurname        = employee.EmployeeSurname,
                EmployeeBacklogDays    = employee.EmployeeBacklogDays,
                EmployeeCardIDNumber   = employee.EmployeeCardIDNumber,
                EmployeeEmploymentDate = (DateTime)employee.EmployeeEmploymentDate,
                EmployeeRole           = employee.EmployeeRole.AccountTypesToEnum()
            };

            return(View(employeeToReturn));
        }