private Employee GetEmployeeForLoggedUser() { var hasher = new Sha256StringHasher(); var existingUser = _employeeRepository.Find(hasher.Hash(UserName)); return existingUser; }
private void GetEmployeeAndLoadNextView() { var employee = GetEmployeeForLoggedUser(); if (employee == null) { var hasher = new Sha256StringHasher(); var employeeForNewUser = new Employee {Login = hasher.Hash(UserName)}; ChangeUtility(new CreateEmployeeViewModel(employeeForNewUser, _employeeRepository, MainViewModel)); } else { LoadViewModel(new HolidayCalendarViewModel(employee, _employeeRepository)); Close(); } }