private async void btnDeleteEmployee_Click(object sender, RoutedEventArgs e)
        {
            int indexRow = dgEmployee.SelectedIndex;

            Logic.HttpClientHR httpClient = new Logic.HttpClientHR();
            int employee_id;

            if (indexRow >= 0 && indexRow < dgEmployee.Items.Count - 1)
            {
                var empl = (Employee)dgEmployee.SelectedItem;
                employee_id = empl.employee_id;
                Result result = await httpClient.deleteEmployeeAsync(employee_id);

                if (result.code == 0)
                {
                    MessageBox.Show("Удалено");
                }
                else
                {
                    MessageBox.Show("ОШибка удаления. \n" + result.info);
                }
            }
            else
            {
                MessageBox.Show("Не выбрана строка сотрудника для удаления.");
            }
        }
        private async void btnModifyEmployee_Click(object sender, RoutedEventArgs e)
        {
            Logic.HttpClientHR httpClientHR          = new Logic.HttpClientHR();
            ResultApi          resultCreatedEmployee = new ResultApi();
            string             txtEmplyeeId          = string.Empty;

            Employee newEmpl = new Employee();

            txtEmplyeeId = txtemployee_id.Text;
            if (txtEmplyeeId == "")
            {
                txtEmplyeeId = "0";
            }
            newEmpl.employee_id = Convert.ToInt32(txtEmplyeeId);
            newEmpl.name        = txtName.Text;
            newEmpl.surname     = txtSurname.Text;
            newEmpl.middle_name = txtMiddleName.Text;
            newEmpl.birthday    = Convert.ToDateTime(txtDateBidthDay.SelectedDate);

            if (newEmpl.employee_id > 0)
            {
                resultCreatedEmployee = await httpClientHR.changedEmployeeAsync(newEmpl);

                if (resultCreatedEmployee == null && resultCreatedEmployee.code == null)
                {
                    MessageBox.Show("Ошибка при сохранении изменений. ");
                }
                else if (resultCreatedEmployee.code == 0)
                {
                    MessageBox.Show("Сохранено");
                    tabListEmployee.IsSelected = true;
                    tabEmployee.Visibility     = Visibility.Hidden;
                }
                else
                {
                    MessageBox.Show("Ошибка при сохранении изменений. \n" + resultCreatedEmployee.info);
                }
            }
            else
            {
                resultCreatedEmployee = await httpClientHR.createNewEmployeeAsunc(newEmpl);

                if (resultCreatedEmployee.code == 0 && resultCreatedEmployee.employee.employee_id > 0)
                {
                    txtemployee_id.Text = resultCreatedEmployee.employee.employee_id.ToString();
                    MessageBox.Show("Сохранено. ");
                    tabListEmployee.IsSelected = true;
                    tabEmployee.Visibility     = Visibility.Hidden;
                }
                else
                {
                    MessageBox.Show("Ошибка создания сотрудника. \n" + resultCreatedEmployee.info);
                }
            }
        }
        private async void showDetailEmployee(int employee_id)
        {
            Logic.HttpClientHR httpClient = new Logic.HttpClientHR();
            tabEmployee.IsSelected = true;
            var empl = await httpClient.getEmployeeAsync(employee_id);

            txtemployee_id.Text          = empl.employee_id.ToString();
            txtSurname.Text              = empl.surname;
            txtName.Text                 = empl.name;
            txtMiddleName.Text           = empl.middle_name;
            txtDateBidthDay.SelectedDate = empl.birthday;
        }
        private async void showListAsync()
        {
            FiltrEmployee filterEmpl = new FiltrEmployee();

            filterEmpl.Surname     = txtFilterSurname.Text;
            filterEmpl.Name        = txtFilterName.Text;
            filterEmpl.Middle_name = txtFilterMiddleName.Text;

            filterEmpl.countInPage = this.countInPage;
            filterEmpl.numberPage  = this.numberPageOfDataGrid;

            Logic.HttpClientHR httpClientHR = new Logic.HttpClientHR();
            List <Employee>    result       = await httpClientHR.getListEmployeeAsync(filterEmpl);

            dgEmployee.ItemsSource = result;
        }