private void editServiceButton_Click(object sender, RoutedEventArgs e)
        {
            Service         service    = new Service();
            PersonalService pr_service = new PersonalService();
            GroupService    gr_service = new GroupService();

            int row = serviceDataGrid.SelectedIndex;
            int id  = Convert.ToInt32((serviceDataGrid.Columns[0].GetCellContent(serviceDataGrid.Items[row]) as TextBlock).Text);

            int group_id    = 0;
            int personal_id = 0;

            addServiceWindow addServiceWindow;

            try
            {
                using (var Db = new DatabaseContext())
                {
                    service = Db.Service.FirstOrDefault(c => c.id == id);
                    try { group_id = Db.GroupService.Find(service.id).service_id; } catch { group_id = 0; }

                    try { personal_id = Db.PersonalService.Find(service.id).service_id; } catch { personal_id = 0; }

                    if (group_id == 0)
                    {
                        pr_service = Db.PersonalService.FirstOrDefault(s => s.service_id == id);

                        addServiceWindow = new addServiceWindow(service, pr_service);
                        addServiceWindow.Show();
                    }
                    if (personal_id == 0)
                    {
                        gr_service = Db.GroupService.FirstOrDefault(s => s.service_id == id);

                        addServiceWindow = new addServiceWindow(service, gr_service);
                        addServiceWindow.Show();
                    }
                }
            }
            catch (Exception)
            {
                MessageBox.Show("Возможно, были введены некорректные данные! Пожалуйста, попробуйте ещё раз.", "Ошибка ввода данных", MessageBoxButton.OK, MessageBoxImage.Error);
            }
        }
        private void addServiceButton_Click(object sender, RoutedEventArgs e)
        {
            addServiceWindow addServiceWindow = new addServiceWindow();

            addServiceWindow.Show();
        }
 private void menuAddService_Click(object sender, RoutedEventArgs e)
 {
     addServiceWindow addServiceWindow = new addServiceWindow();
     addServiceWindow.Show();
 }