2019-01-24 22:24:05 +01:00
|
|
|
|
using ProjetTheAlone.Classes;
|
|
|
|
|
using System;
|
2019-01-19 11:04:17 +01:00
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using System.Windows;
|
|
|
|
|
using System.Windows.Controls;
|
|
|
|
|
using System.Windows.Data;
|
|
|
|
|
using System.Windows.Documents;
|
|
|
|
|
using System.Windows.Input;
|
|
|
|
|
using System.Windows.Media;
|
|
|
|
|
using System.Windows.Media.Imaging;
|
|
|
|
|
using System.Windows.Shapes;
|
|
|
|
|
|
|
|
|
|
namespace ProjetTheAlone.View
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Logique d'interaction pour FicRepasEncode.xaml
|
|
|
|
|
/// </summary>
|
|
|
|
|
public partial class FicRepasEncode : Window
|
|
|
|
|
{
|
|
|
|
|
public FicRepasEncode()
|
|
|
|
|
{
|
|
|
|
|
InitializeComponent();
|
2019-01-24 22:24:05 +01:00
|
|
|
|
this.DataContext = new ViewModel.VM_Repa();
|
2019-01-19 11:04:17 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void btnQuitter_Click(object sender, RoutedEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
Close();
|
|
|
|
|
}
|
2019-01-19 22:29:09 +01:00
|
|
|
|
|
|
|
|
|
private void CheckSoupe_Checked(object sender, RoutedEventArgs e)
|
|
|
|
|
{
|
2019-01-24 22:24:05 +01:00
|
|
|
|
//CheckPlatP.IsChecked = false;
|
|
|
|
|
//CheckDessert.IsChecked = false;
|
2019-01-19 22:29:09 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void CheckPlatP_Checked(object sender, RoutedEventArgs e)
|
|
|
|
|
{
|
2019-01-24 22:24:05 +01:00
|
|
|
|
//CheckDessert.IsChecked = false;
|
|
|
|
|
//CheckSoupe.IsChecked = false;
|
2019-01-19 22:29:09 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void CheckDessert_Checked(object sender, RoutedEventArgs e)
|
|
|
|
|
{
|
2019-01-24 22:24:05 +01:00
|
|
|
|
//CheckPlatP.IsChecked = false;
|
|
|
|
|
//CheckSoupe.IsChecked = false;
|
2019-01-19 22:29:09 +01:00
|
|
|
|
}
|
2019-01-20 11:46:45 +01:00
|
|
|
|
|
|
|
|
|
private void btnPlat_Click(object sender, RoutedEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
FicEncodePlat w = new FicEncodePlat();
|
|
|
|
|
w.ShowDialog();
|
2019-01-24 22:24:05 +01:00
|
|
|
|
dgPlat.DataContext = new ViewModel.VM_Plat();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void btnAddPlat_Click(object sender, RoutedEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
if (dgPlat.SelectedItems.Count > 0 && DateV.SelectedDate.HasValue)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < dgPlat.SelectedItems.Count; i++)
|
|
|
|
|
{
|
|
|
|
|
C_T_plat plat= (C_T_plat)dgPlat.SelectedItems[i];
|
|
|
|
|
if(((ViewModel.VM_Repa)dgLPS.DataContext).BcpPLatJourSelectionne.Where(ii => ii.ID_plat == plat.ID_plat).ToList().Count == 0)
|
|
|
|
|
{
|
|
|
|
|
((ViewModel.VM_Repa)dgPlat.DataContext).BcpPLatJourSelectionne.Add(plat);
|
|
|
|
|
new Gestion.G_T_listPlat(Config.Settings1.Default.schCon).Ajouter(DateV.SelectedDate.Value, plat.ID_plat);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void DateV_SelectedDatesChanged(object sender, SelectionChangedEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
Console.Write("");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void Button_Click(object sender, RoutedEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void Button_Click_1(object sender, RoutedEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void Button_Click_2(object sender, RoutedEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void retirerPlat_Click(object sender, RoutedEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
if (dgLPS.SelectedItems.Count > 0 && DateV.SelectedDate.HasValue)
|
|
|
|
|
{
|
|
|
|
|
//((ViewModel.VM_Plat)dgPlat.DataContext).BcpPlats.Add();
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < dgLPS.SelectedItems.Count; i++)
|
|
|
|
|
{
|
|
|
|
|
C_T_plat plat = (C_T_plat)dgLPS.SelectedItems[i];
|
|
|
|
|
((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);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
2019-01-20 11:46:45 +01:00
|
|
|
|
}
|
2019-01-19 11:04:17 +01:00
|
|
|
|
}
|
|
|
|
|
}
|