Удаление возможности редактирование привязки сотрудника
This commit is contained in:
parent
22b0af7ad5
commit
b83fcba0aa
@ -70,11 +70,6 @@
|
|||||||
<Label Content="Сохранить" Foreground="White" HorizontalAlignment="Center"/>
|
<Label Content="Сохранить" Foreground="White" HorizontalAlignment="Center"/>
|
||||||
<CheckBox x:Name="PassedCheckBox" Content="Завершено" Foreground="White" />
|
<CheckBox x:Name="PassedCheckBox" Content="Завершено" Foreground="White" />
|
||||||
</StackPanel>
|
</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>
|
</Grid>
|
||||||
|
|
||||||
<!-- Кнопка сохранения -->
|
<!-- Кнопка сохранения -->
|
||||||
|
@ -32,7 +32,6 @@ namespace EmployeeManagmentView.Employee.Salary
|
|||||||
_employeeLogic = employeeLogic;
|
_employeeLogic = employeeLogic;
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
LoadSalaries();
|
LoadSalaries();
|
||||||
LoadEmployees();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void LoadSalaries()
|
private void LoadSalaries()
|
||||||
@ -43,14 +42,6 @@ namespace EmployeeManagmentView.Employee.Salary
|
|||||||
SalaryComboBox.SelectedValuePath = "Id";
|
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)
|
private void SalaryComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||||
{
|
{
|
||||||
if (SalaryComboBox.SelectedValue is int selectedSalaryId)
|
if (SalaryComboBox.SelectedValue is int selectedSalaryId)
|
||||||
@ -69,9 +60,6 @@ namespace EmployeeManagmentView.Employee.Salary
|
|||||||
PremiumTextBox.Text = salary.Premium?.ToString() ?? string.Empty;
|
PremiumTextBox.Text = salary.Premium?.ToString() ?? string.Empty;
|
||||||
DatePicker.SelectedDate = salary.Date;
|
DatePicker.SelectedDate = salary.Date;
|
||||||
PassedCheckBox.IsChecked = salary.Passed;
|
PassedCheckBox.IsChecked = salary.Passed;
|
||||||
|
|
||||||
// Устанавливаем выбранного сотрудника
|
|
||||||
EmployeeComboBox.SelectedValue = salary.EmployeeId;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -103,7 +91,6 @@ namespace EmployeeManagmentView.Employee.Salary
|
|||||||
Premium = float.TryParse(PremiumTextBox.Text, out var premium) ? premium : (float?)null,
|
Premium = float.TryParse(PremiumTextBox.Text, out var premium) ? premium : (float?)null,
|
||||||
Date = DatePicker.SelectedDate.Value.ToUniversalTime(),
|
Date = DatePicker.SelectedDate.Value.ToUniversalTime(),
|
||||||
Passed = PassedCheckBox.IsChecked ?? false,
|
Passed = PassedCheckBox.IsChecked ?? false,
|
||||||
EmployeeId = (int?)EmployeeComboBox.SelectedValue // Устанавливаем выбранного сотрудника
|
|
||||||
};
|
};
|
||||||
|
|
||||||
_salaryLogic.Update(updatedSalary);
|
_salaryLogic.Update(updatedSalary);
|
||||||
|
@ -62,10 +62,6 @@
|
|||||||
<CheckBox x:Name="PassedCheckBox" Content="Завершено" Foreground="White" />
|
<CheckBox x:Name="PassedCheckBox" Content="Завершено" Foreground="White" />
|
||||||
</StackPanel>
|
</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>
|
</Grid>
|
||||||
|
|
||||||
<!-- Кнопка сохранения -->
|
<!-- Кнопка сохранения -->
|
||||||
|
@ -32,7 +32,6 @@ namespace EmployeeManagmentView.Employee.Vacation
|
|||||||
_employeeLogic = employeeLogic;
|
_employeeLogic = employeeLogic;
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
LoadVacations();
|
LoadVacations();
|
||||||
LoadEmployees();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void LoadVacations()
|
private void LoadVacations()
|
||||||
@ -43,14 +42,6 @@ namespace EmployeeManagmentView.Employee.Vacation
|
|||||||
VacationComboBox.SelectedValuePath = "Id";
|
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)
|
private void VacationComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||||
{
|
{
|
||||||
if (VacationComboBox.SelectedValue is int selectedVacationId)
|
if (VacationComboBox.SelectedValue is int selectedVacationId)
|
||||||
@ -68,8 +59,6 @@ namespace EmployeeManagmentView.Employee.Vacation
|
|||||||
EndDatePicker.SelectedDate = vacation.EndData;
|
EndDatePicker.SelectedDate = vacation.EndData;
|
||||||
PassedCheckBox.IsChecked = vacation.Passed;
|
PassedCheckBox.IsChecked = vacation.Passed;
|
||||||
|
|
||||||
// Устанавливаем выбранного сотрудника
|
|
||||||
EmployeeComboBox.SelectedValue = vacation.EmployeeId;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -99,7 +88,6 @@ namespace EmployeeManagmentView.Employee.Vacation
|
|||||||
StartData = StartDatePicker.SelectedDate.Value.ToUniversalTime(),
|
StartData = StartDatePicker.SelectedDate.Value.ToUniversalTime(),
|
||||||
EndData = EndDatePicker.SelectedDate.Value.ToUniversalTime(),
|
EndData = EndDatePicker.SelectedDate.Value.ToUniversalTime(),
|
||||||
Passed = PassedCheckBox.IsChecked ?? false,
|
Passed = PassedCheckBox.IsChecked ?? false,
|
||||||
EmployeeId = (int?)EmployeeComboBox.SelectedValue // Устанавливаем выбранного сотрудника
|
|
||||||
};
|
};
|
||||||
|
|
||||||
_vacationLogic.Update(updatedVacation);
|
_vacationLogic.Update(updatedVacation);
|
||||||
|
Loading…
Reference in New Issue
Block a user