Encode repas all work !

This commit is contained in:
adri 2019-01-25 14:20:43 +01:00
parent ceffc1446e
commit 589d08fc30
3 changed files with 12 additions and 7 deletions

View File

@ -33,28 +33,33 @@
<DataGrid.Columns>
<DataGridTextColumn Visibility="Hidden" Binding="{Binding ID_plat}" />
<DataGridTextColumn Header="Plat" Binding="{Binding P_nom}" Width="*" />
</DataGrid.Columns>
<DataGridTextColumn Header="Type de plat" Binding="{Binding ID_typePlat}" Width="auto" />
</DataGrid.Columns>
</DataGrid>
<Button x:Name="btnPlat"
Content="Gestion Plat" Click="btnPlat_Click" Height="30" Grid.Column="1" VerticalAlignment="Bottom" Grid.Row="1"/>
</Grid>
<Button x:Name="btnAddPlat"
Content="->" Click="btnAddPlat_Click" Height="30" Width="100" VerticalAlignment="Center" Grid.Column="2"/>
Content="->" Click="btnAddPlat_Click" Height="30" Width="auto" VerticalAlignment="Center" Grid.Column="2"
ToolTip="Ajouter aux plat sélectionné"/>
<Button x:Name="retirerPlat" Click="retirerPlat_Click"
Content="-" Height="30" Width="100" VerticalAlignment="Center" Grid.Column="2" Margin="0,262,0,192"/>
Content="-" Height="30" Width="auto" VerticalAlignment="Center" Grid.Column="2" Margin="0,262,0,192"
ToolTip="Suprimer des plats sélectionné"/>
<Grid Grid.Column="3">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
</Grid.RowDefinitions>
<TextBlock FontFamily="Calibri" FontSize="20" HorizontalAlignment="Center">Lisst des plat selectionné</TextBlock>
<DataGrid x:Name="dgLPS" ItemsSource="{Binding BcpPLatJourSelectionne}" VerticalScrollBarVisibility="Visible"
IsReadOnly="True" AutoGenerateColumns="False"
IsReadOnly="True" AutoGenerateColumns="False" IsEnabled="{Binding ActiverBcpFiche, Mode=OneWay}"
SelectedItem="{Binding PlatSelectionnee, Mode=TwoWay}" Grid.Row="1" Height="auto">
<DataGrid.Columns>
<DataGridTextColumn Visibility="Hidden" Binding="{Binding ID_plat}" />
<DataGridTextColumn Header="Plat" Binding="{Binding P_nom}" Width="*" />
<DataGridTextColumn Header="Type de plat" Binding="{Binding ID_typePlat}" Width="auto" />
</DataGrid.Columns>
</DataGrid>

View File

@ -104,9 +104,9 @@ namespace ProjetTheAlone.View
{
//((ViewModel.VM_Plat)dgPlat.DataContext).BcpPlats.Add();
for (int i = 0; i < dgLPS.SelectedItems.Count; i++)
for (; 0 < dgLPS.SelectedItems.Count;)
{
C_T_plat plat = (C_T_plat)dgLPS.SelectedItems[i];
C_T_plat plat = (C_T_plat)dgLPS.SelectedItems[0];
((ViewModel.VM_Repa)dgLPS.DataContext).BcpPLatJourSelectionne.Remove(((ViewModel.VM_Repa)dgLPS.DataContext).BcpPLatJourSelectionne.Where(ii => ii.ID_plat == plat.ID_plat).First());
new Gestion.G_T_listPlat(Config.Settings1.Default.schCon).Supprimer(plat.ID_plat, DateV.SelectedDate.Value);
}

View File

@ -40,7 +40,7 @@ namespace ProjetTheAlone.ViewModel
cConfirmer = new BaseCommande(Confirmer);
cSupprimer = new BaseCommande(Supprimer);
cSupprimer = new BaseCommande(calendar_SelectedDatesChanged);
DateSelection = DateTime.Now.AddDays(7);
DateSelection = DateTime.Now;
BcpPlats = ChargerRepa(chConnexion);
BcpPLatJourSelectionne = ChargerRepa(chConnexion, DateSelection);
base.PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler(onPropertyChanged);