<Page x:Class="StoreServer.MonitoringCashierPage"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
      xmlns:local="clr-namespace:StoreServer"
      mc:Ignorable="d" 
      d:DesignHeight="450" d:DesignWidth="800"
      Title="Состояние касс">

    <Grid>
        <TabControl>
            <TabItem Header="Состояния касс">
                <TabControl>
                    <Grid>
                        <DataGrid x:Name="ListCashier" AutoGenerateColumns="False">
                            <DataGrid.Columns>
                                <DataGridTextColumn Header="Номер кассы" Binding="{Binding Cashier.CashierID}"></DataGridTextColumn>
                                <DataGridTextColumn Header="Статус" Binding="{Binding IsStartCashier}"></DataGridTextColumn>
                                <DataGridTextColumn Header="Кассир" Binding="{Binding EmployeeInStore.Employee.FullName}"></DataGridTextColumn>
                                <DataGridTextColumn Header="Состояние смены" Binding="{Binding IsStartWorkShift}"></DataGridTextColumn>
                            </DataGrid.Columns>
                        </DataGrid>
                    </Grid>
                </TabControl>
            </TabItem>
            <TabItem Header="Отчёты">
                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="50"/>
                        <RowDefinition/>
                        <RowDefinition Height="50"/>
                    </Grid.RowDefinitions>
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition/>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition/>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition/>
                        </Grid.ColumnDefinitions>
                        <TextBlock VerticalAlignment="Center" Margin="5">Касса</TextBlock>
                        <ComboBox Grid.Column="1" Margin="10,5,10,5" Name="CmbCasier" DisplayMemberPath="NumberCasier" SelectedIndex="0" SelectionChanged="CmbCasier_SelectionChanged"></ComboBox>
                        <TextBlock VerticalAlignment="Center" Grid.Column="2" Margin="5">Начало</TextBlock>
                        <DatePicker Name="DaPStartDate" Grid.Column="3" VerticalAlignment="Center" Margin="5" SelectedDateChanged="DaPStartDate_SelectedDateChanged"></DatePicker>
                        <TextBlock VerticalAlignment="Center" Grid.Column="4" Margin="5">Конец</TextBlock>
                        <DatePicker Name="DaPEndDate" Grid.Column="5" VerticalAlignment="Center" Margin="5" SelectedDateChanged="DaPEndDate_SelectedDateChanged"></DatePicker>
                    </Grid>
                    <DataGrid Grid.Row="1" x:Name="OrderList" AutoGenerateColumns="False" IsReadOnly="True" CanUserAddRows="False" CanUserDeleteRows="False">
                        <DataGrid.Columns>
                            <DataGridTextColumn Header="Касса" Binding="{Binding WorkShift.Cashier.CashierID}"></DataGridTextColumn>
                            <DataGridTextColumn Header="Сотрудник" Binding="{Binding WorkShift.EmployeeInStore.Employee.FullName}"></DataGridTextColumn>
                            <DataGridTextColumn Header="Номер заказа" Binding="{Binding OrderID}"></DataGridTextColumn>
                            <DataGridTextColumn Header="Дата" Binding="{Binding Date, StringFormat={}{0:dd.MM.yyyy}}"></DataGridTextColumn>
                            <DataGridTextColumn Header="Продукты" Binding="{Binding ProductInOrderString}"></DataGridTextColumn>
                            <DataGridTextColumn Header="Стоимость" Binding="{Binding CostOfOrder}"></DataGridTextColumn>
                        </DataGrid.Columns>
                    </DataGrid>
                    <Grid Grid.Row="2">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition/>
                            <ColumnDefinition/>
                        </Grid.ColumnDefinitions>
                        <Button x:Name="BtnInToPDF" Click="BtnInToPDF_Click" Margin="100,10,100,10">В PDF</Button>
                        <Button x:Name="BtnInToCSV" Grid.Column="1" Click="BtnInToCSV_Click" Margin="100,10,100,10">В CSV</Button>
                    </Grid>
                </Grid>
            </TabItem>
        </TabControl>
        
    </Grid>
</Page>
