WinDict.xaml 7.33 KB
<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>