procédure ListPlat
This commit is contained in:
@@ -22,6 +22,7 @@ namespace ProjetTheAlone.View
|
||||
public Accueil()
|
||||
{
|
||||
InitializeComponent();
|
||||
Settings1.Default.schCon = @"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename='C:\Users\Hugues\Haute Ecole de la ville de Liège\Adrien VAN DAMME - ProjetTheAlone\ProjetTheAlone\ProjetThe.mdf';Integrated Security = True";
|
||||
}
|
||||
private static bool openaffichage = false;
|
||||
private static bool openencodage = false;
|
||||
|
||||
@@ -29,17 +29,16 @@
|
||||
<TextBlock x:Name="tNom" Text="Nom" Grid.Row="2" VerticalAlignment="Center" />
|
||||
<TextBox x:Name="tbNom" Grid.Row="2" Grid.Column="1" Margin="3"
|
||||
Text="{Binding UnBeneficiaire.Nom, Mode=TwoWay}" />
|
||||
<TextBlock x:Name="tNai" Text="Date Naissance" Grid.Row="3" VerticalAlignment="Center" />
|
||||
<DatePicker x:Name="dpNai" Grid.Row="3" Grid.Column="1" Margin="3"
|
||||
Text="{Binding UnBeneficiaire.Nai, Mode=TwoWay}"
|
||||
DisplayDate="{Binding UnBeneficiaire.Nai, Mode=TwoWay}" />
|
||||
<TextBlock x:Name="tAnnif" Text="Date Naissance" Grid.Row="3" VerticalAlignment="Center" />
|
||||
<DatePicker x:Name="dpAnnif" Grid.Row="3" Grid.Column="1" Margin="3"
|
||||
SelectedDate="{Binding UnBeneficiaire.Annif, Mode=TwoWay}" />
|
||||
<TextBlock x:Name="tImg" Text="Photo" Grid.Row="4" VerticalAlignment="Center" Margin="0,56,0,10" />
|
||||
<DockPanel Margin="10,10,10,10" Grid.Row="4" Grid.Column="1">
|
||||
<WrapPanel HorizontalAlignment="Right" DockPanel.Dock="Top" >
|
||||
<Image x:Name="ImageFile" Height="40" HorizontalAlignment="Right" VerticalAlignment="Top" Width="90"/>
|
||||
<Button x:Name="btnOpenFile" HorizontalAlignment="Right" Click="btnOpenFile_Click" Content="Open file"/>
|
||||
</WrapPanel>
|
||||
<TextBox x:Name="txtEditor" />
|
||||
<TextBox x:Name="txtEditor" Text="{Binding UnBeneficiaire.Img, Mode=TwoWay}"/>
|
||||
|
||||
</DockPanel>
|
||||
</Grid>
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace ProjetTheAlone.View
|
||||
public FicBeneficiaireEncode()
|
||||
{
|
||||
InitializeComponent();
|
||||
// DataContext = new ViewModel.VM_Beneficiaire();
|
||||
DataContext = new ViewModel.VM_Beneficiaire();
|
||||
}
|
||||
|
||||
private void BtnQuitter_Click(object sender, RoutedEventArgs e)
|
||||
|
||||
64
ProjetTheAlone/View/FicEncodePlat.xaml
Normal file
64
ProjetTheAlone/View/FicEncodePlat.xaml
Normal file
@@ -0,0 +1,64 @@
|
||||
<Window x:Class="ProjetTheAlone.FicEncodePlat"
|
||||
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:ProjetTheAlone"
|
||||
mc:Ignorable="d"
|
||||
Title="Plats" Height="482.167" Width="955.5" WindowStartupLocation="CenterScreen" WindowStyle="None">
|
||||
<Grid Margin="0,-3,2,2">
|
||||
<Grid.RowDefinitions>
|
||||
|
||||
</Grid.RowDefinitions>
|
||||
<Label Content="Plats" HorizontalAlignment="Left" Margin="31,20,0,0" VerticalAlignment="Top" FontFamily="Calibri" FontSize="20"/>
|
||||
<Grid x:Name="UneFiche" IsEnabled="{Binding ActiverUneFiche, Mode=OneWay}" Margin="515,82,139,258" >
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock x:Name="tNom" Text="Nom" Grid.Row="2" VerticalAlignment="Center" />
|
||||
<TextBox x:Name="tbNom" Grid.Row="2" Grid.Column="1" Margin="3"
|
||||
Text="{Binding UnPlat.Nom, Mode=TwoWay}" />
|
||||
<TextBlock x:Name="tImg" Text="Photo" Grid.Row="4" VerticalAlignment="Center" Margin="0,56,0,10" />
|
||||
<DockPanel Margin="10,10,10,10" Grid.Row="4" Grid.Column="1">
|
||||
<WrapPanel HorizontalAlignment="Right" DockPanel.Dock="Top" >
|
||||
<Image x:Name="ImageFile" Height="40" HorizontalAlignment="Right" VerticalAlignment="Top" Width="90"/>
|
||||
<Button x:Name="btnOpenFile" HorizontalAlignment="Right" Click="btnOpenFile_Click" Content="Open file"/>
|
||||
</WrapPanel>
|
||||
<TextBox x:Name="txtEditor" Text="{Binding UnPlat.Img, Mode=TwoWay}"/>
|
||||
|
||||
</DockPanel>
|
||||
</Grid>
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Margin="678,237,78,140" Width="190">
|
||||
<Button x:Name="bConfirmer" Content="Confirmer" Margin="3" IsEnabled="{Binding ActiverUneFiche, Mode=OneWay}"
|
||||
Command="{Binding cConfirmer}" />
|
||||
<Button x:Name="bAnnuler" Content="Annuler" Margin="3,16,3,17" IsEnabled="{Binding ActiverUneFiche, Mode=OneWay}"
|
||||
Command="{Binding cAnnuler}" />
|
||||
</StackPanel>
|
||||
<DataGrid ItemsSource="{Binding BcpBeneficiaire}" VerticalScrollBarVisibility="Visible"
|
||||
IsReadOnly="True" AutoGenerateColumns="False" IsEnabled="{Binding ActiverBcpFiche, Mode=OneWay}"
|
||||
SelectedItem="{Binding BeneficiaireSelectionnee, Mode=TwoWay}" Margin="126,86,605,140" >
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn Visibility="Hidden" Binding="{Binding ID}" />
|
||||
<DataGridTextColumn Header="Nom du plat" Binding="{Binding Nom}" Width="*" />
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Margin="88,331,576,46" Width="282">
|
||||
<Button x:Name="bAjouter" Content="Ajouter" Margin="3" IsEnabled="{Binding ActiverBcpFiche, Mode=OneWay}"
|
||||
Command="{Binding cAjouter}" />
|
||||
<Button x:Name="bModifier" Content="Modifier" Margin="3" IsEnabled="{Binding ActiverBcpFiche, Mode=OneWay}"
|
||||
Command="{Binding cModifier}" />
|
||||
<Button x:Name="bSupprimer" Content="Supprimer" Margin="3" IsEnabled="{Binding ActiverBcpFiche, Mode=OneWay}"
|
||||
Command="{Binding cSupprimer}" />
|
||||
</StackPanel>
|
||||
<Button x:Name="BtnQuitter" Content="Quitter" HorizontalAlignment="Left" Margin="810,403,0,0" VerticalAlignment="Top" Width="92" Click="BtnQuitter_Click" Height="26"/>
|
||||
|
||||
</Grid>
|
||||
</Window>
|
||||
56
ProjetTheAlone/View/FicEncodePlat.xaml.cs
Normal file
56
ProjetTheAlone/View/FicEncodePlat.xaml.cs
Normal file
@@ -0,0 +1,56 @@
|
||||
using System;
|
||||
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;
|
||||
using System.IO;
|
||||
|
||||
using Microsoft.Win32;
|
||||
|
||||
namespace ProjetTheAlone
|
||||
{
|
||||
/// <summary>
|
||||
/// Logique d'interaction pour FicEncodePlat.xaml
|
||||
/// </summary>
|
||||
public partial class FicEncodePlat : Window
|
||||
{
|
||||
public FicEncodePlat()
|
||||
{
|
||||
InitializeComponent();
|
||||
DataContext = new ViewModel.VM_Plat();
|
||||
}
|
||||
|
||||
private void BtnQuitter_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
Close();
|
||||
}
|
||||
|
||||
private void btnOpenFile_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
OpenFileDialog openFileDialog = new OpenFileDialog();
|
||||
openFileDialog.Filter = "Image files (*.png;*.jpeg)|*.png;*.jpeg|All files (*.*)|*.*";
|
||||
if (openFileDialog.ShowDialog() == true)
|
||||
{
|
||||
string FileName = openFileDialog.FileName;
|
||||
|
||||
txtEditor.Text = FileName;
|
||||
|
||||
//FileStream fs = new System.IO.FileStream(@""+FileName+"", FileMode.Open, FileAccess.Read);
|
||||
//BinaryReader br = new BinaryReader(fs);
|
||||
//byte[] result = br.ReadBytes((int)fs.Length);
|
||||
|
||||
ImageFile.Source = new BitmapImage(new Uri(@"" + FileName + ""));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -10,7 +10,7 @@
|
||||
<Button x:Name="btnQuitter" Margin="974,414,29,25"
|
||||
Content="Quitter" RenderTransformOrigin="0.017,0.519" Click="btnQuitter_Click" Height="Auto"/>
|
||||
|
||||
<StackPanel Margin="544,117,444,202">
|
||||
<StackPanel Margin="574,117,414,202">
|
||||
<Label Content="Type de plat" FontFamily="Calibri" FontSize="16" Height="40"/>
|
||||
<CheckBox Name="CheckSoupe" Content="Soupe" FontFamily="Calibri" FontSize="14" Height="40" Checked="CheckSoupe_Checked"/>
|
||||
<CheckBox Name="CheckPlatP" Content="Plat principal" FontFamily="Calibri" FontSize="14" Height="40" Checked="CheckPlatP_Checked"/>
|
||||
@@ -18,7 +18,7 @@
|
||||
</StackPanel>
|
||||
|
||||
<Calendar HorizontalAlignment="Left" Margin="51,103,0,0" VerticalAlignment="Top"/>
|
||||
<ListView x:Name="lvPlat" Margin="352,107,609,215">
|
||||
<ListView x:Name="lvPlat" Margin="382,107,579,215">
|
||||
<ListView.View>
|
||||
<GridView>
|
||||
<GridViewColumn Width="160" Header="Plats"/>
|
||||
@@ -27,6 +27,26 @@
|
||||
</ListView.View>
|
||||
</ListView>
|
||||
<Label Content="Repas" HorizontalAlignment="Left" Margin="51,30,0,0" VerticalAlignment="Top" FontFamily="Calibri" FontSize="20"/>
|
||||
<Button x:Name="btnPlat" Margin="382,309,566,126"
|
||||
Content="Nouveau Plat" Click="btnPlat_Click" Height="Auto"/>
|
||||
<ListView x:Name="lvRepas" Margin="734,107,29,126">
|
||||
<ListView.View>
|
||||
<GridView>
|
||||
<GridViewColumn Width="120" Header="Soupe"/>
|
||||
<GridViewColumn Width="120" Header="Plat"/>
|
||||
<GridViewColumn Width="120" Header="Dessert"/>
|
||||
|
||||
</GridView>
|
||||
</ListView.View>
|
||||
</ListView>
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Margin="687,304,29,82" Width="414">
|
||||
<Button x:Name="bAjouter" Content="Ajouter Repas" Margin="3" IsEnabled="{Binding ActiverBcpFiche, Mode=OneWay}"
|
||||
Command="{Binding cAjouter}" />
|
||||
<Button x:Name="bModifier" Content="Modifier Repas" Margin="3" IsEnabled="{Binding ActiverBcpFiche, Mode=OneWay}"
|
||||
Command="{Binding cModifier}" />
|
||||
<Button x:Name="bSupprimer" Content="Supprimer Repas" Margin="3" IsEnabled="{Binding ActiverBcpFiche, Mode=OneWay}"
|
||||
Command="{Binding cSupprimer}" />
|
||||
</StackPanel>
|
||||
|
||||
</Grid>
|
||||
</Window>
|
||||
@@ -46,5 +46,11 @@ namespace ProjetTheAlone.View
|
||||
CheckPlatP.IsChecked = false;
|
||||
CheckSoupe.IsChecked = false;
|
||||
}
|
||||
|
||||
private void btnPlat_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
FicEncodePlat w = new FicEncodePlat();
|
||||
w.ShowDialog();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user