Add somme litle features

This commit is contained in:
adri 2019-01-25 16:23:52 +01:00
parent 0ad72dcee7
commit 9a422d4760
9 changed files with 41 additions and 15 deletions

View File

@ -5,7 +5,7 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:ProjetTheAlone.View" xmlns:local="clr-namespace:ProjetTheAlone.View"
mc:Ignorable="d" mc:Ignorable="d"
Title="Accueil" Height="376.232" Width="816.438" ResizeMode="NoResize" WindowStartupLocation="CenterScreen" WindowStyle="None"> Title="Accueil" Height="376.232" Width="816.438" ResizeMode="NoResize" WindowStartupLocation="CenterScreen" WindowStyle="None" MouseDown="Window_MouseDown">
<Grid Margin="0,0,0,10"> <Grid Margin="0,0,0,10">
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>

View File

@ -64,5 +64,11 @@ namespace ProjetTheAlone.View
{ {
Close(); Close();
} }
private void Window_MouseDown(object sender, MouseButtonEventArgs e)
{
if (e.ChangedButton == MouseButton.Left)
this.DragMove();
}
} }
} }

View File

@ -16,7 +16,7 @@
TextOptions.TextRenderingMode="Auto" TextOptions.TextRenderingMode="Auto"
Background="{DynamicResource MaterialDesignPaper}" Background="{DynamicResource MaterialDesignPaper}"
FontFamily="{DynamicResource MaterialDesignFont}" FontFamily="{DynamicResource MaterialDesignFont}"
Name="wnd" Closing="wnd_Closing"> Name="wnd" Closing="wnd_Closing" WindowStyle="None" MouseDown="wnd_MouseDown">
<Window.Resources> <Window.Resources>
<local:DebugDummyConverter x:Key="DebugDummyConverter" /> <local:DebugDummyConverter x:Key="DebugDummyConverter" />
</Window.Resources> </Window.Resources>
@ -29,7 +29,7 @@
<ColumnDefinition /> <ColumnDefinition />
<ColumnDefinition /> <ColumnDefinition />
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<materialDesign:PackIcon Kind="Build" Grid.Column="2" HorizontalAlignment="Right" Cursor="Hand"/> <materialDesign:PackIcon Kind="Close" Grid.Column="2" HorizontalAlignment="Right" Cursor="Hand" MouseDown="PackIcon_MouseDown"/>
<Grid Grid.Column="0"> <Grid Grid.Column="0">
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition /> <ColumnDefinition />

View File

@ -75,6 +75,17 @@ namespace ProjetTheAlone.View
{ {
} }
private void wnd_MouseDown(object sender, MouseButtonEventArgs e)
{
if (e.ChangedButton == MouseButton.Left)
this.DragMove();
}
private void PackIcon_MouseDown(object sender, MouseButtonEventArgs e)
{
this.Close();
}
} }
public class DebugDummyConverter : IValueConverter public class DebugDummyConverter : IValueConverter
{ {

View File

@ -4,6 +4,8 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:ProjetTheAlone" xmlns:local="clr-namespace:ProjetTheAlone"
xmlns:System="clr-namespace:System;assembly=mscorlib"
xmlns:StyleAlias="clr-namespace:ProjetTheAlone.Classes"
xmlns:convert="clr-namespace:ProjetTheAlone.Converter" xmlns:convert="clr-namespace:ProjetTheAlone.Converter"
mc:Ignorable="d" mc:Ignorable="d"
Title="Plats" Height="482.167" Width="955.5" WindowStartupLocation="CenterScreen" WindowStyle="None"> Title="Plats" Height="482.167" Width="955.5" WindowStartupLocation="CenterScreen" WindowStyle="None">
@ -41,10 +43,8 @@
</DockPanel> </DockPanel>
<DockPanel Grid.Row="5" Grid.ColumnSpan="2"> <DockPanel Grid.Row="5" Grid.ColumnSpan="2">
<ComboBox x:Name="TypePlat" SelectionChanged="TypePlat_SelectionChanged"> <ComboBox x:Name="TypePlat" SelectionChanged="TypePlat_SelectionChanged" SelectedValue="{Binding Typeplat, Mode=TwoWay}">
<ComboBoxItem>Soupe</ComboBoxItem>
<ComboBoxItem IsSelected="True">Plat</ComboBoxItem>
<ComboBoxItem>Dessert</ComboBoxItem>
</ComboBox> </ComboBox>
</DockPanel> </DockPanel>
</Grid> </Grid>

View File

@ -26,6 +26,7 @@ namespace ProjetTheAlone
public FicEncodePlat() public FicEncodePlat()
{ {
InitializeComponent(); InitializeComponent();
this.TypePlat.ItemsSource = Enum.GetValues(typeof(Classes.C_T_plat.TypePlat_E)).Cast<Classes.C_T_plat.TypePlat_E>();
DataContext = new ViewModel.VM_Plat(); DataContext = new ViewModel.VM_Plat();
} }
@ -54,8 +55,8 @@ namespace ProjetTheAlone
private void TypePlat_SelectionChanged(object sender, SelectionChangedEventArgs e) private void TypePlat_SelectionChanged(object sender, SelectionChangedEventArgs e)
{ {
if (DataContext != null) if (DataContext != null && this.TypePlat.Text != "")
((ViewModel.VM_Plat)DataContext).UnPlat.TypePlat = (C_T_plat.TypePlat_E)Enum.Parse(typeof(C_T_plat.TypePlat_E), this.TypePlat.Text); ((ViewModel.VM_Plat)DataContext).UnPlat.TypePlat = (C_T_plat.TypePlat_E)Enum.Parse(typeof(C_T_plat.TypePlat_E), this.TypePlat.SelectedValue.ToString());
} }
} }
} }

View File

@ -5,7 +5,7 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:ProjetTheAlone.View" xmlns:local="clr-namespace:ProjetTheAlone.View"
mc:Ignorable="d" mc:Ignorable="d"
Title="FicRepas" Height="491.666" Width="1137.834" WindowStartupLocation="CenterScreen" WindowStyle="None"> Title="FicRepas" Height="491.666" Width="1137.834" WindowStartupLocation="CenterScreen" MouseDown="Window_MouseDown" WindowStyle="None">
<Grid> <Grid>
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"></ColumnDefinition> <ColumnDefinition Width="Auto"></ColumnDefinition>

View File

@ -53,14 +53,14 @@ namespace ProjetTheAlone.View
{ {
FicEncodePlat w = new FicEncodePlat(); FicEncodePlat w = new FicEncodePlat();
w.ShowDialog(); w.ShowDialog();
dgPlat.DataContext = new ViewModel.VM_Plat(); this.DataContext = new ViewModel.VM_Repa();
} }
private void btnAddPlat_Click(object sender, RoutedEventArgs e) private void btnAddPlat_Click(object sender, RoutedEventArgs e)
{ {
if (dgPlat.SelectedItems.Count > 0 && DateV.SelectedDate.HasValue) if (dgPlat.SelectedItems.Count > 0 && dgLPS.Items.Count < 3 &&DateV.SelectedDate.HasValue)
{ {
@ -113,5 +113,11 @@ namespace ProjetTheAlone.View
} }
} }
private void Window_MouseDown(object sender, MouseButtonEventArgs e)
{
if (e.ChangedButton == MouseButton.Left)
this.DragMove();
}
} }
} }

View File

@ -18,7 +18,7 @@ namespace ProjetTheAlone.ViewModel
private string chConnexion = Settings2.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 string chConnexion = Settings2.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 int nAjout; private int nAjout;
private int typeplat=0; private C_T_plat.TypePlat_E typeplat=0;
private bool _ActiverUneFiche; private bool _ActiverUneFiche;
public bool ActiverUneFiche public bool ActiverUneFiche
{ {
@ -64,6 +64,7 @@ namespace ProjetTheAlone.ViewModel
UnPlat.Nom = "Nom du plat"; UnPlat.Nom = "Nom du plat";
BcpPlats = ChargerPersonnes(chConnexion); BcpPlats = ChargerPersonnes(chConnexion);
ActiverUneFiche = false; ActiverUneFiche = false;
Typeplat = C_T_plat.TypePlat_E.Soupe;
cConfirmer = new BaseCommande(Confirmer); cConfirmer = new BaseCommande(Confirmer);
cAnnuler = new BaseCommande(Annuler); cAnnuler = new BaseCommande(Annuler);
cAjouter = new BaseCommande(Ajouter); cAjouter = new BaseCommande(Ajouter);
@ -77,6 +78,7 @@ namespace ProjetTheAlone.ViewModel
public BaseCommande cAjouter { get; set; } public BaseCommande cAjouter { get; set; }
public BaseCommande cModifier { get; set; } public BaseCommande cModifier { get; set; }
public BaseCommande cSupprimer { get; set; } public BaseCommande cSupprimer { get; set; }
public C_T_plat.TypePlat_E Typeplat { get => typeplat; set =>AssignerChamp<C_T_plat.TypePlat_E>(ref typeplat, value, System.Reflection.MethodBase.GetCurrentMethod().Name); }
#endregion #endregion
private ObservableCollection<C_T_plat> ChargerPersonnes(string chConn) private ObservableCollection<C_T_plat> ChargerPersonnes(string chConn)