<Page x:Class="ComputerShopWpf.Views.ClientsPage"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      Title="Клиенты">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <TextBlock Text="Клиенты" Style="{StaticResource PageTitleStyle}"/>

        <Border Grid.Row="1"
                Background="{StaticResource PanelBrush}"
                BorderBrush="{StaticResource BorderBrush}"
                BorderThickness="1"
                Padding="16"
                Margin="0,4,0,10">
            <StackPanel>
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="*"/>
                        <ColumnDefinition Width="*"/>
                        <ColumnDefinition Width="*"/>
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                    </Grid.RowDefinitions>

                    <StackPanel Grid.Row="0" Grid.Column="0" Margin="0,0,14,0">
                        <TextBlock Text="Имя"/>
                        <TextBox x:Name="FirstNameTextBox"/>
                    </StackPanel>
                    <StackPanel Grid.Row="0" Grid.Column="1" Margin="0,0,14,0">
                        <TextBlock Text="Фамилия"/>
                        <TextBox x:Name="LastNameTextBox"/>
                    </StackPanel>
                    <StackPanel Grid.Row="0" Grid.Column="2">
                        <TextBlock Text="Телефон"/>
                        <TextBox x:Name="PhoneTextBox"/>
                    </StackPanel>

                    <StackPanel Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2" Margin="0,0,14,0">
                        <TextBlock Text="Адрес"/>
                        <TextBox x:Name="AddressTextBox"/>
                    </StackPanel>
                    <StackPanel Grid.Row="1" Grid.Column="2">
                        <TextBlock Text="Email"/>
                        <TextBox x:Name="EmailTextBox"/>
                    </StackPanel>
                </Grid>
                <StackPanel Orientation="Horizontal" Margin="0,6,0,0">
                    <Button x:Name="AddButton" Content="Добавить" Click="AddButton_Click"/>
                    <Button x:Name="UpdateButton" Content="Изменить" Click="UpdateButton_Click"/>
                    <Button x:Name="DeleteButton" Content="Удалить" Click="DeleteButton_Click"/>
                    <Button x:Name="RefreshButton" Content="Обновить" Click="RefreshButton_Click"/>
                </StackPanel>
            </StackPanel>
        </Border>

        <DataGrid x:Name="ClientsDataGrid"
                  Grid.Row="2"
                  SelectionChanged="ClientsDataGrid_SelectionChanged">
            <DataGrid.Columns>
                <DataGridTextColumn Header="ID" Binding="{Binding [client_id]}" Width="70"/>
                <DataGridTextColumn Header="Имя" Binding="{Binding [first_name]}" Width="140"/>
                <DataGridTextColumn Header="Фамилия" Binding="{Binding [last_name]}" Width="160"/>
                <DataGridTextColumn Header="Адрес" Binding="{Binding [address]}" Width="*"/>
                <DataGridTextColumn Header="Телефон" Binding="{Binding [phone]}" Width="150"/>
                <DataGridTextColumn Header="Email" Binding="{Binding [email]}" Width="190"/>
            </DataGrid.Columns>
        </DataGrid>
    </Grid>
</Page>
