Удаление возможности редактирование привязки сотрудника

This commit is contained in:
maksim 2024-12-02 23:23:57 +04:00
parent 22b0af7ad5
commit b83fcba0aa
4 changed files with 0 additions and 34 deletions

View File

@ -70,11 +70,6 @@
<Label Content="Сохранить" Foreground="White" HorizontalAlignment="Center"/>
<CheckBox x:Name="PassedCheckBox" Content="Завершено" Foreground="White" />
</StackPanel>
<StackPanel Grid.Row="3" Grid.Column="0" Grid.ColumnSpan="2" Margin="10">
<Label Content="Сотрудник" Foreground="White" HorizontalAlignment="Center"/>
<ComboBox x:Name="EmployeeComboBox" Width="250" Height="40" />
</StackPanel>
</Grid>
<!-- Кнопка сохранения -->

View File

@ -32,7 +32,6 @@ namespace EmployeeManagmentView.Employee.Salary
_employeeLogic = employeeLogic;
InitializeComponent();
LoadSalaries();
LoadEmployees();
}
private void LoadSalaries()
@ -43,14 +42,6 @@ namespace EmployeeManagmentView.Employee.Salary
SalaryComboBox.SelectedValuePath = "Id";
}
private void LoadEmployees()
{
_employees = _employeeLogic.GetFullList(); // Получение списка всех сотрудников
EmployeeComboBox.ItemsSource = _employees;
EmployeeComboBox.DisplayMemberPath = "FullName"; // Предполагается, что у сотрудника есть свойство FullName
EmployeeComboBox.SelectedValuePath = "Id";
}
private void SalaryComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
if (SalaryComboBox.SelectedValue is int selectedSalaryId)
@ -69,9 +60,6 @@ namespace EmployeeManagmentView.Employee.Salary
PremiumTextBox.Text = salary.Premium?.ToString() ?? string.Empty;
DatePicker.SelectedDate = salary.Date;
PassedCheckBox.IsChecked = salary.Passed;
// Устанавливаем выбранного сотрудника
EmployeeComboBox.SelectedValue = salary.EmployeeId;
}
else
{
@ -103,7 +91,6 @@ namespace EmployeeManagmentView.Employee.Salary
Premium = float.TryParse(PremiumTextBox.Text, out var premium) ? premium : (float?)null,
Date = DatePicker.SelectedDate.Value.ToUniversalTime(),
Passed = PassedCheckBox.IsChecked ?? false,
EmployeeId = (int?)EmployeeComboBox.SelectedValue // Устанавливаем выбранного сотрудника
};
_salaryLogic.Update(updatedSalary);

View File

@ -62,10 +62,6 @@
<CheckBox x:Name="PassedCheckBox" Content="Завершено" Foreground="White" />
</StackPanel>
<StackPanel Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2" Margin="10">
<Label Content="Сотрудник" Foreground="White" HorizontalAlignment="Center"/>
<ComboBox x:Name="EmployeeComboBox" Width="250" Height="40" />
</StackPanel>
</Grid>
<!-- Кнопка сохранения -->

View File

@ -32,7 +32,6 @@ namespace EmployeeManagmentView.Employee.Vacation
_employeeLogic = employeeLogic;
InitializeComponent();
LoadVacations();
LoadEmployees();
}
private void LoadVacations()
@ -43,14 +42,6 @@ namespace EmployeeManagmentView.Employee.Vacation
VacationComboBox.SelectedValuePath = "Id";
}
private void LoadEmployees()
{
_employees = _employeeLogic.GetFullList(); // Получение списка всех сотрудников
EmployeeComboBox.ItemsSource = _employees;
EmployeeComboBox.DisplayMemberPath = "FullName"; // Предполагается, что у сотрудника есть свойство FullName
EmployeeComboBox.SelectedValuePath = "Id";
}
private void VacationComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
if (VacationComboBox.SelectedValue is int selectedVacationId)
@ -68,8 +59,6 @@ namespace EmployeeManagmentView.Employee.Vacation
EndDatePicker.SelectedDate = vacation.EndData;
PassedCheckBox.IsChecked = vacation.Passed;
// Устанавливаем выбранного сотрудника
EmployeeComboBox.SelectedValue = vacation.EmployeeId;
}
else
{
@ -99,7 +88,6 @@ namespace EmployeeManagmentView.Employee.Vacation
StartData = StartDatePicker.SelectedDate.Value.ToUniversalTime(),
EndData = EndDatePicker.SelectedDate.Value.ToUniversalTime(),
Passed = PassedCheckBox.IsChecked ?? false,
EmployeeId = (int?)EmployeeComboBox.SelectedValue // Устанавливаем выбранного сотрудника
};
_vacationLogic.Update(updatedVacation);