Skip to content

Commit

Permalink
v2.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
DIMANRUS committed Aug 21, 2023
1 parent 175d57e commit 73ad794
Show file tree
Hide file tree
Showing 8 changed files with 923 additions and 213 deletions.
186 changes: 86 additions & 100 deletions src/SudInfo.Avalonia/Views/Pages/PeripheryPage.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,105 +12,91 @@
d:DesignWidth="800"
x:DataType="viewModels:PeripheryPageViewModel"
mc:Ignorable="d">
<i:Interaction.Behaviors>
<ia:EventTriggerBehavior EventName="Initialized">
<ia:InvokeCommandAction Command="{Binding LoadPeripheries}" />
</ia:EventTriggerBehavior>
</i:Interaction.Behaviors>
<Grid ColumnDefinitions="140, *,20,150, 40,40" RowDefinitions="40,*">
<TextBlock
Classes="PageHeader"
Text="Периферия" />
<TextBox
Grid.Column="1"
Margin="10,5,10,5"
MaxLength="50"
Text="{Binding SearchText}"
UseFloatingWatermark="False"
Watermark="Поиск по названию, номерам и сотруднику">
<i:Interaction.Behaviors>
<ia:EventTriggerBehavior EventName="KeyUp">
<ia:InvokeCommandAction Command="{Binding SearchBoxKeyUp}" />
<i:Interaction.Behaviors>
<ia:EventTriggerBehavior EventName="Initialized">
<ia:InvokeCommandAction Command="{Binding LoadPeripheries}" />
</ia:EventTriggerBehavior>
</i:Interaction.Behaviors>
</TextBox>
<CheckBox Grid.Column="2" IsChecked="{Binding IsPeripheryTypeFilter}">
<i:Interaction.Behaviors>
<EventTriggerBehavior EventName="Checked">
<InvokeCommandAction Command="{Binding SearchBoxKeyUp}" PassEventArgsToCommand="True" />
</EventTriggerBehavior>
</i:Interaction.Behaviors>
<i:Interaction.Behaviors>
<EventTriggerBehavior EventName="Unchecked">
<InvokeCommandAction Command="{Binding SearchBoxKeyUp}" PassEventArgsToCommand="True" />
</EventTriggerBehavior>
</i:Interaction.Behaviors>
</CheckBox>
<ComboBox
Grid.Column="3"
Width="140"
HorizontalAlignment="Center"
VerticalAlignment="Center"
IsEnabled="{Binding IsPeripheryTypeFilter}"
ItemsSource="{Binding PeripheryTypes}"
SelectedItem="{Binding SelectedPeripheryType}">
<i:Interaction.Behaviors>
<EventTriggerBehavior EventName="SelectionChanged">
<InvokeCommandAction Command="{Binding SelectionPeripheryTypeChanged}" PassEventArgsToCommand="True" />
</EventTriggerBehavior>
</i:Interaction.Behaviors>
</ComboBox>
<Image Grid.Column="4" Source="/Assets/Images/excel.png">
<i:Interaction.Behaviors>
<ia:EventTriggerBehavior EventName="Tapped">
<ia:InvokeCommandAction Command="{Binding CreateExcelTable}" />
</ia:EventTriggerBehavior>
</i:Interaction.Behaviors>
</Image>
<Image Grid.Column="5" Source="/Assets/Images/add.png">
<i:Interaction.Behaviors>
<ia:EventTriggerBehavior EventName="Tapped">
<ia:InvokeCommandAction Command="{Binding OpenAddPeripheryWindow}" />
</ia:EventTriggerBehavior>
</i:Interaction.Behaviors>
</Image>
<DataGrid
Grid.Row="1"
Grid.ColumnSpan="6"
x:DataType="models:Periphery"
ItemsSource="{Binding Peripheries}"
SelectedItem="{Binding SelectedPeriphery}"
>
<DataGrid.ContextMenu>
<ContextMenu>
<MenuItem Header="Редактировать" Command="{Binding OpenEditPeripheryWindow}"/>
<MenuItem Header="Удалить" Command="{Binding RemovePeriphery}"/>
</ContextMenu>
</DataGrid.ContextMenu>
<DataGrid.Columns>
<DataGridTextColumn
Binding="{Binding Name}"
Header="Наименование" />
<DataGridTextColumn
Binding="{Binding Type}"
Header="Тип"/>
<DataGridTextColumn
Binding="{Binding InventarNumber}"
Header="Инвентарный" />
<DataGridTextColumn
Binding="{Binding SerialNumber}"
Header="Серийный"/>
<DataGridTextColumn
Binding="{Binding Computer.Name}"
Header="Компьютер"/>
<DataGridTextColumn
Width="*"
Binding="{Binding Computer.User.FIO}"
Header="ФИО сотрудника"/>
<DataGridTextColumn
Binding="{Binding Computer.Cabinet}"
Header="Кабинет" />
</DataGrid.Columns>
</DataGrid>
</Grid>
</i:Interaction.Behaviors>
<Grid ColumnDefinitions="140, *,20,150, 40,40" RowDefinitions="40,*">
<TextBlock Classes="PageHeader" Text="Периферия" />
<TextBox
Grid.Column="1"
Margin="10,5,10,5"
MaxLength="50"
Text="{Binding SearchText}"
UseFloatingWatermark="False"
Watermark="Поиск по названию, номерам и сотруднику">
<i:Interaction.Behaviors>
<ia:EventTriggerBehavior EventName="KeyUp">
<ia:InvokeCommandAction Command="{Binding SearchBoxKeyUp}" />
</ia:EventTriggerBehavior>
</i:Interaction.Behaviors>
</TextBox>
<CheckBox Grid.Column="2" IsChecked="{Binding IsPeripheryTypeFilter}">
<i:Interaction.Behaviors>
<EventTriggerBehavior EventName="Checked">
<InvokeCommandAction Command="{Binding SearchBoxKeyUp}" PassEventArgsToCommand="True" />
</EventTriggerBehavior>
</i:Interaction.Behaviors>
<i:Interaction.Behaviors>
<EventTriggerBehavior EventName="Unchecked">
<InvokeCommandAction Command="{Binding SearchBoxKeyUp}" PassEventArgsToCommand="True" />
</EventTriggerBehavior>
</i:Interaction.Behaviors>
</CheckBox>
<ComboBox
Grid.Column="3"
Width="140"
HorizontalAlignment="Center"
VerticalAlignment="Center"
IsEnabled="{Binding IsPeripheryTypeFilter}"
ItemsSource="{Binding PeripheryTypes}"
SelectedItem="{Binding SelectedPeripheryType}">
<i:Interaction.Behaviors>
<EventTriggerBehavior EventName="SelectionChanged">
<InvokeCommandAction Command="{Binding SelectionPeripheryTypeChanged}" PassEventArgsToCommand="True" />
</EventTriggerBehavior>
</i:Interaction.Behaviors>
</ComboBox>
<Image Grid.Column="4" Source="/Assets/Images/excel.png">
<i:Interaction.Behaviors>
<ia:EventTriggerBehavior EventName="Tapped">
<ia:InvokeCommandAction Command="{Binding CreateExcelTable}" />
</ia:EventTriggerBehavior>
</i:Interaction.Behaviors>
</Image>
<Image Grid.Column="5" Source="/Assets/Images/add.png">
<i:Interaction.Behaviors>
<ia:EventTriggerBehavior EventName="Tapped">
<ia:InvokeCommandAction Command="{Binding OpenAddPeripheryWindow}" />
</ia:EventTriggerBehavior>
</i:Interaction.Behaviors>
</Image>
<DataGrid
Grid.Row="1"
Grid.ColumnSpan="6"
x:DataType="models:Periphery"
ItemsSource="{Binding Peripheries}"
SelectedItem="{Binding SelectedPeriphery}">
<DataGrid.ContextMenu>
<ContextMenu>
<MenuItem Command="{Binding OpenEditPeripheryWindow}" Header="Редактировать" />
<MenuItem Command="{Binding RemovePeriphery}" Header="Удалить" />
</ContextMenu>
</DataGrid.ContextMenu>
<DataGrid.Columns>
<DataGridTextColumn Binding="{Binding Name}" Header="Наименование" />
<DataGridTextColumn Binding="{Binding Type}" Header="Тип" />
<DataGridTextColumn Binding="{Binding InventarNumber}" Header="Инвентарный" />
<DataGridTextColumn Binding="{Binding SerialNumber}" Header="Серийный" />
<DataGridTextColumn Binding="{Binding Computer.Name}" Header="Компьютер" />
<DataGridTextColumn
Width="*"
Binding="{Binding Computer.User.FIO}"
Header="ФИО сотрудника" />
<DataGridTextColumn Binding="{Binding Computer.Cabinet}" Header="Кабинет" />
<DataGridTextColumn Binding="{Binding IsPersonal}" Header="Личное" />
</DataGrid.Columns>
</DataGrid>
</Grid>
</UserControl>
1 change: 1 addition & 0 deletions src/SudInfo.Avalonia/Views/Pages/PhonesPage.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
<DataGridTextColumn Binding="{Binding IsDecommissioned}" Header="Списан" />
<DataGridTextColumn Binding="{Binding IsBroken}" Header="Сломан" />
<DataGridTextColumn Binding="{Binding IsStock}" Header="На складе" />
<DataGridTextColumn Binding="{Binding IsPersonal}" Header="Личный" />
<DataGridTextColumn Binding="{Binding BreakdownDescription}" Header="Описание поломки" />
</DataGrid.Columns>
</DataGrid>
Expand Down
91 changes: 46 additions & 45 deletions src/SudInfo.Avalonia/Views/Windows/PeripheryWindow.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,54 +10,55 @@
xmlns:viewModels="clr-namespace:SudInfo.Avalonia.ViewModels.WindowViewModels;assembly=SudInfo.Avalonia"
Title="Периферия"
Width="300"
Height="300"
Height="330"
x:DataType="viewModels:PeripheryWindowViewModel"
CanResize="False"
WindowStartupLocation="CenterOwner"
mc:Ignorable="d">
<i:Interaction.Behaviors>
<ia:EventTriggerBehavior EventName="Initialized">
<ia:InvokeCommandAction Command="{Binding LoadComputers}" />
</ia:EventTriggerBehavior>
</i:Interaction.Behaviors>
<StackPanel Margin="10" Spacing="5">
<TextBox
MaxLength="50"
Text="{Binding Periphery.Name}"
Watermark="Название" />
<TextBox
MaxLength="50"
Text="{Binding Periphery.SerialNumber}"
Watermark="Серийный номер" />
<TextBox
MaxLength="50"
Text="{Binding Periphery.InventarNumber}"
Watermark="Инвентарный номер" />
<ComboBox
HorizontalAlignment="Stretch"
ItemsSource="{Binding PeripheryTypes}"
SelectedItem="{Binding Periphery.Type}" />
<StackPanel Orientation="Horizontal">
<CheckBox Name="IsComputerBox" IsChecked="{Binding IsComputer}" />
<ComboBox
Width="252"
AutoScrollToSelectedItem="True"
IsEnabled="{Binding #IsComputerBox.IsChecked}"
ItemsSource="{Binding Computers}"
PlaceholderText="Компьютер"
SelectedItem="{Binding Periphery.Computer}">
<ComboBox.DataTemplates>
<DataTemplate DataType="{x:Type models:Computer}">
<TextBlock Text="{Binding ComputerNameWithUserSurFirstName}" />
</DataTemplate>
</ComboBox.DataTemplates>
</ComboBox>
<i:Interaction.Behaviors>
<ia:EventTriggerBehavior EventName="Initialized">
<ia:InvokeCommandAction Command="{Binding LoadComputers}" />
</ia:EventTriggerBehavior>
</i:Interaction.Behaviors>
<StackPanel Margin="10" Spacing="5">
<TextBox
MaxLength="50"
Text="{Binding Periphery.Name}"
Watermark="Название" />
<TextBox
MaxLength="50"
Text="{Binding Periphery.SerialNumber}"
Watermark="Серийный номер" />
<TextBox
MaxLength="50"
Text="{Binding Periphery.InventarNumber}"
Watermark="Инвентарный номер" />
<CheckBox Content="Личное" IsChecked="{Binding Periphery.IsPersonal}" />
<ComboBox
HorizontalAlignment="Stretch"
ItemsSource="{Binding PeripheryTypes}"
SelectedItem="{Binding Periphery.Type}" />
<StackPanel Orientation="Horizontal">
<CheckBox Name="IsComputerBox" IsChecked="{Binding IsComputer}" />
<ComboBox
Width="252"
AutoScrollToSelectedItem="True"
IsEnabled="{Binding #IsComputerBox.IsChecked}"
ItemsSource="{Binding Computers}"
PlaceholderText="Компьютер"
SelectedItem="{Binding Periphery.Computer}">
<ComboBox.DataTemplates>
<DataTemplate DataType="{x:Type models:Computer}">
<TextBlock Text="{Binding ComputerNameWithUserSurFirstName}" />
</DataTemplate>
</ComboBox.DataTemplates>
</ComboBox>
</StackPanel>
<Button
HorizontalAlignment="Stretch"
HorizontalContentAlignment="Center"
Command="{Binding SavePeriphery}"
Content="{Binding SaveButtonText}"
IsVisible="{Binding IsButtonVisible}" />
</StackPanel>
<Button
HorizontalAlignment="Stretch"
HorizontalContentAlignment="Center"
Command="{Binding SavePeriphery}"
Content="{Binding SaveButtonText}"
IsVisible="{Binding IsButtonVisible}" />
</StackPanel>
</Window>
Loading

0 comments on commit 73ad794

Please sign in to comment.