WinDict.xaml
7.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
<win:MyWindow
xmlns:win="clr-namespace:HHECS.View.Win" x:Class="HHECS.View.SystemInfo.WinDict"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:HHECS.View.SystemInfo"
xmlns:control="clr-namespace:HHECS.Controls"
mc:Ignorable="d"
Title="字典管理" Height="450" Width="800">
<Window.Resources>
<Style TargetType="StackPanel" >
<Setter Property="Orientation" Value="Horizontal"/>
<Setter Property="VerticalAlignment" Value="Center"/>
</Style>
<Style TargetType="TextBlock">
<Setter Property="HorizontalAlignment" Value="Center"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="Margin" Value="10,0,0,0"/>
</Style>
<Style TargetType="TextBox">
<Setter Property="HorizontalAlignment" Value="Center"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="Width" Value="100"/>
</Style>
</Window.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition></RowDefinition>
</Grid.RowDefinitions>
<TabControl x:Name="TCMain" Grid.Row="2">
<TabItem x:Name="TIMain" Header="主表">
<Grid>
<DockPanel>
<WrapPanel Margin="5" DockPanel.Dock="Top">
<StackPanel>
<TextBlock>字典编码:</TextBlock>
<TextBox x:Name="TxtCode"></TextBox>
</StackPanel>
<StackPanel>
<TextBlock>字典名:</TextBlock>
<TextBox x:Name="TxtName"></TextBox>
</StackPanel>
</WrapPanel>
<StackPanel DockPanel.Dock="Top" HorizontalAlignment="Right">
<Button x:Name="BtnQuery" Click="BtnQuery_Click">查询</Button>
<Button IsEnabled="{Binding ElementName=TIMain,Path=IsSelected}" x:Name="BtnAdd" Click="BtnAdd_Click">新增字典</Button>
<Button IsEnabled="{Binding ElementName=TIMain,Path=IsSelected}" x:Name="BtnEdit" Click="BtnEdit_Click">编辑字典</Button>
<Button IsEnabled="{Binding ElementName=TIMain,Path=IsSelected}" x:Name="BtnDelete" Click="BtnDelete_Click">删除字典</Button>
</StackPanel>
<control:DataPager x:Name="page" DockPanel.Dock="Bottom" PageIndex="{Binding PageIndex}" PageSize="{Binding PageSize}" TotalCount="{Binding TotalCount}"
PageChanged="page_PageChanged"></control:DataPager>
<DataGrid x:Name="DGMain">
<DataGrid.RowStyle>
<Style TargetType="{x:Type DataGridRow}">
<EventSetter Event="MouseDoubleClick" Handler="DataGridRow_MouseDoubleClick"/>
</Style>
</DataGrid.RowStyle>
<DataGrid.Columns>
<DataGridTextColumn Header="Id" Binding="{Binding Id}"/>
<DataGridTextColumn Header="字典编码" Binding="{Binding Code}"/>
<DataGridTextColumn Header="字典名" Binding="{Binding Name}"/>
<DataGridTextColumn Header="备注" Binding="{Binding Remark}"/>
<DataGridTextColumn Header="创建时间" Binding="{Binding Created}"/>
<DataGridTextColumn Header="创建人" Binding="{Binding CreatedBy}"/>
<DataGridTextColumn Header="更新时间" Binding="{Binding Updated}"/>
<DataGridTextColumn Header="更新人" Binding="{Binding UpdatedBy}"/>
</DataGrid.Columns>
</DataGrid>
</DockPanel>
</Grid>
</TabItem>
<TabItem x:Name="TIDetail" Header="明细">
<Grid x:Name="GridDetail">
<Grid.RowDefinitions>
<RowDefinition Height="50"></RowDefinition>
<RowDefinition Height="50"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
</Grid.RowDefinitions>
<StackPanel Grid.Row="0">
<StackPanel>
<TextBlock>字典编码:</TextBlock>
<TextBox x:Name="TxtCode2" Text="{Binding Code}" IsReadOnly="True"></TextBox>
</StackPanel>
<StackPanel>
<TextBlock>字典名:</TextBlock>
<TextBox x:Name="TxtName2" Text="{Binding Name}" IsReadOnly="True"></TextBox>
</StackPanel>
</StackPanel>
<StackPanel Grid.Row="1" HorizontalAlignment="Right">
<Button x:Name="BtnQueryDetail" Click="BtnQueryDetail_Click">刷新明细</Button>
<Button IsEnabled="{Binding ElementName=TIDetail,Path=IsSelected}" x:Name="BtnAddDetail" Click="BtnAddDetail_Click">新增明细</Button>
<Button IsEnabled="{Binding ElementName=TIDetail,Path=IsSelected}" x:Name="BtnEditDetial" Click="BtnEditDetial_Click">编辑明细</Button>
<Button IsEnabled="{Binding ElementName=TIDetail,Path=IsSelected}" x:Name="BtnDeleteDetail" Click="BtnDeleteDetail_Click">删除明细</Button>
</StackPanel>
<DataGrid Grid.Row="2" x:Name="DGDetail">
<DataGrid.Columns>
<DataGridTextColumn Header="Id" Binding="{Binding Id}"/>
<DataGridTextColumn Header="字典编码" Binding="{Binding HeadCode}"/>
<DataGridTextColumn Header="字典名称" Binding="{Binding HeadName}"/>
<DataGridTextColumn Header="字典明细编码" Binding="{Binding Code}"/>
<DataGridTextColumn Header="字典明细名" Binding="{Binding Name}"/>
<DataGridTextColumn Header="字典明细值" Binding="{Binding Value}"/>
<DataGridTextColumn Header="排序" Binding="{Binding Sort}"/>
<DataGridTextColumn Header="备注" Binding="{Binding Remark}"/>
<DataGridTextColumn Header="创建时间" Binding="{Binding Created}"/>
<DataGridTextColumn Header="创建人" Binding="{Binding CreatedBy}"/>
<DataGridTextColumn Header="更新时间" Binding="{Binding Updated}"/>
<DataGridTextColumn Header="更新人" Binding="{Binding UpdatedBy}"/>
</DataGrid.Columns>
</DataGrid>
</Grid>
</TabItem>
</TabControl>
</Grid>
</win:MyWindow>