To Be Continued
parent
cca23316cc
commit
114de77f0d
|
|
@ -113,5 +113,9 @@ public partial class EmployeeEditingWindowViewModel : ViewModelBase
|
|||
{
|
||||
_currentWindow = window;
|
||||
_currentWindow.ConfirmButton.Content = _isEditing ? "Изменить" : "Добавить";
|
||||
if (_isEditing)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -72,10 +72,6 @@ public partial class EquipmentEditingWindowViewModel : ViewModelBase
|
|||
_equipment = _equipmentVisualFactory.CreateFromEquipment(equipment);
|
||||
_equipment.CurrentEmployee = repo.GetById(equipment.CurrentEmployeeId);
|
||||
}
|
||||
using (var repo = _serviceProvider.GetService<EmployeeRepository>())
|
||||
{
|
||||
Employees = new ObservableCollection<Employee>(repo.GetAll());
|
||||
}
|
||||
|
||||
if (_isEditing)
|
||||
{
|
||||
|
|
@ -84,10 +80,17 @@ public partial class EquipmentEditingWindowViewModel : ViewModelBase
|
|||
Date = _equipment.Date;
|
||||
Cost = _equipment.Cost;
|
||||
IsWrittenOff = _equipment.IsWrittenOff;
|
||||
CurrentEmployee = Employees.FirstOrDefault(o => o.Id == equipment.CurrentEmployeeId);
|
||||
CurrentEmployee = _equipment.CurrentEmployee;
|
||||
Employees = new ObservableCollection<Employee>();
|
||||
Employees.Add(CurrentEmployee);
|
||||
}
|
||||
else
|
||||
{
|
||||
using (var repo = _serviceProvider.GetService<EmployeeRepository>())
|
||||
{
|
||||
Employees = new ObservableCollection<Employee>(repo.GetAll());
|
||||
}
|
||||
|
||||
CurrentEmployee = Employees[0];
|
||||
Date = DateTimeOffset.Now;
|
||||
}
|
||||
|
|
@ -96,5 +99,13 @@ public partial class EquipmentEditingWindowViewModel : ViewModelBase
|
|||
{
|
||||
_currentWindow = window;
|
||||
_currentWindow.OkButton.Content = _isEditing ? "Изменить" : "Добавить";
|
||||
if (_isEditing)
|
||||
{
|
||||
_currentWindow.CurrentEmployeeBox.IsVisible = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
_currentWindow.CurrentEmployeeLabel.IsVisible = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -38,13 +38,14 @@
|
|||
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Label Content="Текущий ответственный: "></Label>
|
||||
<ComboBox ItemsSource="{Binding Employees}" SelectedItem="{Binding CurrentEmployee}">
|
||||
<ComboBox x:Name="CurrentEmployeeBox" ItemsSource="{Binding Employees}" SelectedItem="{Binding CurrentEmployee}">
|
||||
<ComboBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Label Content="{Binding FullName}"></Label>
|
||||
</DataTemplate>
|
||||
</ComboBox.ItemTemplate>
|
||||
</ComboBox>
|
||||
<Label x:Name="CurrentEmployeeLabel" Content="{Binding CurrentEmployee.FullName}"></Label>
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -13,7 +13,7 @@ using System.Reflection;
|
|||
[assembly: System.Reflection.AssemblyCompanyAttribute("AvaloniaApplication14_Inventory_300326")]
|
||||
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
|
||||
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
|
||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+70111810c1836182b0f37d93a7e8b2e96bbb6f90")]
|
||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+cca23316ccaf6ff854c560608fe74ea070bdd85a")]
|
||||
[assembly: System.Reflection.AssemblyProductAttribute("AvaloniaApplication14_Inventory_300326")]
|
||||
[assembly: System.Reflection.AssemblyTitleAttribute("AvaloniaApplication14_Inventory_300326")]
|
||||
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
9dbe6ffb36df0983dc0fb68e296275034be5aec8e886a3b04e3c9808d6290db8
|
||||
63e3e38dd183c9ac63856099ca701d49eeb37cffc3fb48b85df28a550d81ee4f
|
||||
|
|
|
|||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -1 +1 @@
|
|||
17763141913838317
|
||||
17763836796197075
|
||||
Loading…
Reference in New Issue