Beispiel #1
0
        private async void _mediator_MessageReceived(AppPageEnum recipient, object message)
        {
            if (AppPageEnumName == recipient)
            {
                long Id = (long)message;
                if (Id == default(long))
                {
                    return;
                }

                var employeeFromDb = await _employeesRepository.GetEmployeeAsync(Id).ConfigureAwait(false);

                EmployeeId         = employeeFromDb.Id;
                EmployeeName       = employeeFromDb.Name;
                EmployeeSurname    = employeeFromDb.Surname;
                EmployeeFatherName = employeeFromDb.FatherName;
                EmployeeBirthday   = employeeFromDb.Birthday.ToShortDateString();
                EmployeeSex        = employeeFromDb.Sex.ToString();

                if (employeeFromDb.Subdivision != null)
                {
                    EmployeeSubdivision = new Subdivision
                    {
                        Id      = employeeFromDb.Subdivision.Id,
                        Name    = employeeFromDb.Subdivision.Name,
                        Manager = employeeFromDb.Subdivision.Manager,
                    };
                }
                else
                {
                }
            }
        }
        private async void _mediator_MessageReceived(AppPageEnum recipient, object message)
        {
            if (AppPageEnumName == recipient)
            {
                long Id = (long)message;
                if (Id == default(long))
                {
                    return;
                }

                var subdivisionFromDb = await _subdivisionsRepository.GetSubdivisionAsync(Id);

                SubdivisionName = subdivisionFromDb.Name;

                if (subdivisionFromDb.Manager != null)
                {
                    Manager = new Employee
                    {
                        Id         = subdivisionFromDb.Manager.Id,
                        Name       = subdivisionFromDb.Manager.Name,
                        Surname    = subdivisionFromDb.Manager.Surname,
                        FatherName = subdivisionFromDb.Manager.FatherName,
                    };
                }
                else
                {
                }
            }
        }
 public void NavigateTo(AppPageEnum appPageEnum, object payload)
 {
     _applicationWindowViewModel.CurrentPage = appPageEnum;
     _historic.Push(new object[2] {
         appPageEnum, payload
     });
     _mediator.Send(appPageEnum, payload);
 }
Beispiel #4
0
 public void Send(AppPageEnum recipient, object message)
 {
     MessageReceived?.Invoke(recipient, message);
 }