Commit eece2046 authored by Mohamed Guirat's avatar Mohamed Guirat
Browse files

event-Etapes

parent 19dc9b60
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
xmlns:HamburgerMenu="clr-namespace:HamburgerMenu;assembly=HamburgerMenu" xmlns:HamburgerMenu="clr-namespace:HamburgerMenu;assembly=HamburgerMenu"
WindowStartupLocation="CenterScreen" WindowStartupLocation="CenterScreen"
mc:Ignorable="d" mc:Ignorable="d"
Title="Consignela" Height="725.5" Width="1215" x:Name="main" Loaded="main_Loaded"> Title="Consignela" Height="{x:Static SystemParameters.PrimaryScreenHeight}" Width="{x:Static SystemParameters.PrimaryScreenWidth}" x:Name="main" Loaded="main_Loaded">
<Grid> <Grid>
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="auto"/> <RowDefinition Height="auto"/>
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
Foreground="White" Foreground="White"
Click="menuButton_Click"/>--> Click="menuButton_Click"/>-->
<Button Name="BackButton" <!--<Button Name="BackButton"
FontFamily="Segoe MDL2 Assets" FontFamily="Segoe MDL2 Assets"
FontSize="36" FontSize="36"
Width="50" Width="50"
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
Content="&#xE0C4;" Content="&#xE0C4;"
Background="#FF00575F" Background="#FF00575F"
Foreground="White" Foreground="White"
/> />-->
<TextBlock Name="titleTextBlock" <TextBlock Name="titleTextBlock"
Text="Consignela" Text="Consignela"
...@@ -50,6 +50,7 @@ ...@@ -50,6 +50,7 @@
FontSize="25" FontSize="25"
Foreground="White" Foreground="White"
Background="#FF02AC7E" Background="#FF02AC7E"
Click="conexion_Click"
> >
<StackPanel Orientation="Horizontal" > <StackPanel Orientation="Horizontal" >
<TextBlock FontFamily="Segoe MDL2 Assets" FontSize="36" Text="&#xE13D;" Margin="0,0,20,0"/> <TextBlock FontFamily="Segoe MDL2 Assets" FontSize="36" Text="&#xE13D;" Margin="0,0,20,0"/>
...@@ -68,7 +69,30 @@ ...@@ -68,7 +69,30 @@
Foreground="White" Foreground="White"
Click="quit_Click"/> Click="quit_Click"/>
</Grid> </Grid>
<Grid Grid.Row="1" > <Grid Grid.Row="1" >
<Popup x:Name="authenPopup" Placement="Center" Panel.ZIndex="1">
<Grid x:Name="authenPopupgrid" Width="500" Height="300" Background="White">
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="9*"/>
</Grid.RowDefinitions>
<Border Background="#FF4FDE96" Grid.Row="0">
<TextBlock Text="Connexion" TextAlignment="Center" VerticalAlignment="Center" Foreground="White" Height="30"/>
</Border>
<StackPanel Grid.Row="1" VerticalAlignment="Center">
<TextBlock Text="Login" HorizontalAlignment="Center" Foreground="Gray" Margin="0,20,0,0"/>
<TextBox x:Name="login1" Width="220" />
<TextBlock Text="Mot de passe" HorizontalAlignment="Center" Foreground="Gray" Margin="0,10,0,0"/>
<PasswordBox x:Name="pass1" Width="220" />
<Button x:Name="connecter" Width="200" Height="50" Background="#FF00C992" HorizontalAlignment="Center" Margin="0,10,0,0" Content="Connecter" Foreground="White" Click="connect_Click"/>
</StackPanel>
</Grid>
</Popup>
<Frame x:Name="framePages" Margin="50,0,0,0"> <Frame x:Name="framePages" Margin="50,0,0,0">
</Frame> </Frame>
......
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO;
using System.Linq; using System.Linq;
using System.Net;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Windows; using System.Windows;
...@@ -20,10 +22,15 @@ namespace consignelaWpf ...@@ -20,10 +22,15 @@ namespace consignelaWpf
/// </summary> /// </summary>
public partial class MainWindow : Window public partial class MainWindow : Window
{ {
String login;
String pass, jsonFromCheckAccess;
public MainWindow() public MainWindow()
{ {
InitializeComponent(); InitializeComponent();
} }
public event EventHandler CanExecuteChanged; public event EventHandler CanExecuteChanged;
...@@ -68,5 +75,73 @@ namespace consignelaWpf ...@@ -68,5 +75,73 @@ namespace consignelaWpf
{ {
framePages.NavigationService.Navigate(new Uri("pages/MainPage.xaml", UriKind.Relative)); framePages.NavigationService.Navigate(new Uri("pages/MainPage.xaml", UriKind.Relative));
} }
private void conexion_Click(object sender, RoutedEventArgs e)
{
if(!authenPopup.IsOpen) { authenPopup.IsOpen = true; }
}
private void connect_Click(object sender, RoutedEventArgs e)
{
login = login1.Text;
pass = pass1.Password;
bool x = false;
try
{
ASCIIEncoding encoding = new ASCIIEncoding();
// string postData = "{\"login\":\"osamaIA03\",\"pass\":\"osamaIA03\",\"request\":\"save\"}";
// System.Diagnostics.Debug.Write(postData);
string postData = "{\"login\":" + "\"" + login + "\"" + ",\"pass\":" + "\"" + pass + "\"" + "}";
byte[] data = encoding.GetBytes(postData);
WebRequest request = WebRequest.Create("http://memorae.hds.utc.fr/api/amc2/Checkaccess");
request.Method = "POST";
request.ContentType = "application/x-www-form-urlencoded";
request.ContentLength = data.Length;
Stream stream = request.GetRequestStream();
stream.Write(data, 0, data.Length);
stream.Close();
WebResponse response = request.GetResponse();
stream = response.GetResponseStream();
StreamReader sr = new StreamReader(stream);
// System.Diagnostics.Debug.Write(sr.ReadToEnd());
// MessageBox.Show(sr.ReadToEnd());
// textBlockJson.Text= sr.ReadToEnd();
jsonFromCheckAccess = sr.ReadToEnd();
System.Diagnostics.Debug.Write("jsonFromCheckAccess " + jsonFromCheckAccess);
if (jsonFromCheckAccess.StartsWith("["))
{
App.logIn = login1.Text;
App.password = pass1.Password;
profilNom.Text = App.logIn;
App.authentification = true;
conexion.Background = new SolidColorBrush(Color.FromArgb(255, 240, 196, 1));
if (authenPopup.IsOpen) { authenPopup.IsOpen = false; }
x = true;
}
else
{
x = false;
}
sr.Close();
stream.Close();
//return x;
}
catch (Exception ex)
{
//return false;
}
}
} }
} }
...@@ -16,8 +16,8 @@ namespace consignelaWpf.Model ...@@ -16,8 +16,8 @@ namespace consignelaWpf.Model
public String description { get; set; } public String description { get; set; }
[JsonProperty("img_path")] [JsonProperty("img_path")]
public String img_path { get; set; } public String img_path { get; set; }
[JsonProperty("imgBitmap")] //[JsonProperty("imgBitmap")]
public BitmapImage imgBitmap { get; set; } //public BitmapImage imgBitmap { get; set; }
[JsonProperty("imgNom")] [JsonProperty("imgNom")]
public String imgNom { get; set; } public String imgNom { get; set; }
......
...@@ -11,8 +11,8 @@ namespace consignelaWpf.Model ...@@ -11,8 +11,8 @@ namespace consignelaWpf.Model
{ {
[JsonProperty("id")] [JsonProperty("id")]
public int id { get; set; } public int id { get; set; }
[JsonProperty("nom")] [JsonProperty("codeParticipant")]
public String nom { get; set; } public String codeParticipant { get; set; }
[JsonProperty("dateTime")] [JsonProperty("dateTime")]
public DateTime dateTime { get; set; } public DateTime dateTime { get; set; }
[JsonProperty("listeConsigne")] [JsonProperty("listeConsigne")]
......
...@@ -6,7 +6,7 @@ using System.Threading.Tasks; ...@@ -6,7 +6,7 @@ using System.Threading.Tasks;
namespace consignelaWpf.Model namespace consignelaWpf.Model
{ {
public class Medicament public class Medicament : ICloneable
{ {
public String nom { get; set; } public String nom { get; set; }
public int nbr { get; set; } public int nbr { get; set; }
...@@ -28,5 +28,11 @@ namespace consignelaWpf.Model ...@@ -28,5 +28,11 @@ namespace consignelaWpf.Model
public int nbrAnalyse { get; set; } public int nbrAnalyse { get; set; }
public int nbrResultat { get; set; } public int nbrResultat { get; set; }
public int nbrPrescription { get; set; } public int nbrPrescription { get; set; }
public object Clone()
{
return this.MemberwiseClone();
}
} }
} }
...@@ -45,6 +45,10 @@ ...@@ -45,6 +45,10 @@
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Data" /> <Reference Include="System.Data" />
<Reference Include="System.Windows.Controls.DataVisualization.Toolkit, Version=4.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\System.Windows.Controls.DataVisualization.Toolkit.4.0.0.0\lib\net40-Client\System.Windows.Controls.DataVisualization.Toolkit.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Xml" /> <Reference Include="System.Xml" />
<Reference Include="Microsoft.CSharp" /> <Reference Include="Microsoft.CSharp" />
<Reference Include="System.Core" /> <Reference Include="System.Core" />
...@@ -255,6 +259,41 @@ ...@@ -255,6 +259,41 @@
<ItemGroup> <ItemGroup>
<Resource Include="Assets\icons\addImage.png" /> <Resource Include="Assets\icons\addImage.png" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<COMReference Include="Microsoft.Office.Core">
<Guid>{2DF8D04C-5BFA-101B-BDE5-00AA0044DE52}</Guid>
<VersionMajor>2</VersionMajor>
<VersionMinor>7</VersionMinor>
<Lcid>0</Lcid>
<WrapperTool>primary</WrapperTool>
<Isolated>False</Isolated>
<EmbedInteropTypes>True</EmbedInteropTypes>
</COMReference>
<COMReference Include="Microsoft.Office.Interop.Excel">
<Guid>{00020813-0000-0000-C000-000000000046}</Guid>
<VersionMajor>1</VersionMajor>
<VersionMinor>8</VersionMinor>
<Lcid>0</Lcid>
<WrapperTool>primary</WrapperTool>
<Isolated>False</Isolated>
<EmbedInteropTypes>True</EmbedInteropTypes>
</COMReference>
<COMReference Include="VBIDE">
<Guid>{0002E157-0000-0000-C000-000000000046}</Guid>
<VersionMajor>5</VersionMajor>
<VersionMinor>3</VersionMinor>
<Lcid>0</Lcid>
<WrapperTool>primary</WrapperTool>
<Isolated>False</Isolated>
<EmbedInteropTypes>True</EmbedInteropTypes>
</COMReference>
</ItemGroup>
<ItemGroup>
<Resource Include="Assets\logos\hauts-de-france.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Assets\logos\Logoupjv-bleu.png" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets. Other similar extension points exist, see Microsoft.Common.targets.
......
#pragma checksum "..\..\MainWindow.xaml" "{406ea660-64cf-4c82-b6f0-42d48172a799}" "B393004F300EBB54DBBD22BC6C3BD5A9" #pragma checksum "..\..\MainWindow.xaml" "{406ea660-64cf-4c82-b6f0-42d48172a799}" "053A1AE331C05D9B05C3BD4BCE584DF9"
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// <auto-generated> // <auto-generated>
// This code was generated by a tool. // This code was generated by a tool.
...@@ -50,14 +50,6 @@ namespace consignelaWpf { ...@@ -50,14 +50,6 @@ namespace consignelaWpf {
#line hidden #line hidden
#line 27 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Button BackButton;
#line default
#line hidden
#line 38 "..\..\MainWindow.xaml" #line 38 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBlock titleTextBlock; internal System.Windows.Controls.TextBlock titleTextBlock;
...@@ -77,7 +69,7 @@ namespace consignelaWpf { ...@@ -77,7 +69,7 @@ namespace consignelaWpf {
/// profilNom Name Field /// profilNom Name Field
/// </summary> /// </summary>
#line 56 "..\..\MainWindow.xaml" #line 57 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
public System.Windows.Controls.TextBlock profilNom; public System.Windows.Controls.TextBlock profilNom;
...@@ -85,7 +77,7 @@ namespace consignelaWpf { ...@@ -85,7 +77,7 @@ namespace consignelaWpf {
#line hidden #line hidden
#line 61 "..\..\MainWindow.xaml" #line 62 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Button quit; internal System.Windows.Controls.Button quit;
...@@ -93,7 +85,47 @@ namespace consignelaWpf { ...@@ -93,7 +85,47 @@ namespace consignelaWpf {
#line hidden #line hidden
#line 72 "..\..\MainWindow.xaml" #line 74 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Primitives.Popup authenPopup;
#line default
#line hidden
#line 76 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Grid authenPopupgrid;
#line default
#line hidden
#line 87 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBox login1;
#line default
#line hidden
#line 89 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.PasswordBox pass1;
#line default
#line hidden
#line 90 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Button connecter;
#line default
#line hidden
#line 96 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Frame framePages; internal System.Windows.Controls.Frame framePages;
...@@ -101,7 +133,7 @@ namespace consignelaWpf { ...@@ -101,7 +133,7 @@ namespace consignelaWpf {
#line hidden #line hidden
#line 77 "..\..\MainWindow.xaml" #line 101 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal HamburgerMenu.HamburgerMenuItem experienceItem; internal HamburgerMenu.HamburgerMenuItem experienceItem;
...@@ -109,7 +141,7 @@ namespace consignelaWpf { ...@@ -109,7 +141,7 @@ namespace consignelaWpf {
#line hidden #line hidden
#line 78 "..\..\MainWindow.xaml" #line 102 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal HamburgerMenu.HamburgerMenuItem parametresItem; internal HamburgerMenu.HamburgerMenuItem parametresItem;
...@@ -117,7 +149,7 @@ namespace consignelaWpf { ...@@ -117,7 +149,7 @@ namespace consignelaWpf {
#line hidden #line hidden
#line 79 "..\..\MainWindow.xaml" #line 103 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal HamburgerMenu.HamburgerMenuItem analyseItem; internal HamburgerMenu.HamburgerMenuItem analyseItem;
...@@ -164,57 +196,75 @@ namespace consignelaWpf { ...@@ -164,57 +196,75 @@ namespace consignelaWpf {
#line hidden #line hidden
return; return;
case 2: case 2:
this.BackButton = ((System.Windows.Controls.Button)(target)); this.titleTextBlock = ((System.Windows.Controls.TextBlock)(target));
return;
case 3:
this.conexion = ((System.Windows.Controls.Button)(target));
#line 32 "..\..\MainWindow.xaml" #line 53 "..\..\MainWindow.xaml"
this.BackButton.Click += new System.Windows.RoutedEventHandler(this.BackButton_Click); this.conexion.Click += new System.Windows.RoutedEventHandler(this.conexion_Click);
#line default #line default
#line hidden #line hidden
return; return;
case 3:
this.titleTextBlock = ((System.Windows.Controls.TextBlock)(target));
return;
case 4: case 4:
this.conexion = ((System.Windows.Controls.Button)(target));
return;
case 5:
this.profilNom = ((System.Windows.Controls.TextBlock)(target)); this.profilNom = ((System.Windows.Controls.TextBlock)(target));
return; return;
case 6: case 5:
this.quit = ((System.Windows.Controls.Button)(target)); this.quit = ((System.Windows.Controls.Button)(target));
#line 69 "..\..\MainWindow.xaml" #line 70 "..\..\MainWindow.xaml"
this.quit.Click += new System.Windows.RoutedEventHandler(this.quit_Click); this.quit.Click += new System.Windows.RoutedEventHandler(this.quit_Click);
#line default #line default
#line hidden #line hidden
return; return;
case 6:
this.authenPopup = ((System.Windows.Controls.Primitives.Popup)(target));
return;
case 7: case 7:
this.framePages = ((System.Windows.Controls.Frame)(target)); this.authenPopupgrid = ((System.Windows.Controls.Grid)(target));
return; return;
case 8: case 8:
this.login1 = ((System.Windows.Controls.TextBox)(target));
return;
case 9:
this.pass1 = ((System.Windows.Controls.PasswordBox)(target));
return;
case 10:
this.connecter = ((System.Windows.Controls.Button)(target));
#line 90 "..\..\MainWindow.xaml"
this.connecter.Click += new System.Windows.RoutedEventHandler(this.connect_Click);
#line default
#line hidden
return;
case 11:
this.framePages = ((System.Windows.Controls.Frame)(target));
return;
case 12:
this.experienceItem = ((HamburgerMenu.HamburgerMenuItem)(target)); this.experienceItem = ((HamburgerMenu.HamburgerMenuItem)(target));
#line 77 "..\..\MainWindow.xaml" #line 101 "..\..\MainWindow.xaml"
this.experienceItem.Selected += new System.Windows.RoutedEventHandler(this.experienceItem_Selected); this.experienceItem.Selected += new System.Windows.RoutedEventHandler(this.experienceItem_Selected);
#line default #line default
#line hidden #line hidden
return; return;
case 9: case 13:
this.parametresItem = ((HamburgerMenu.HamburgerMenuItem)(target)); this.parametresItem = ((HamburgerMenu.HamburgerMenuItem)(target));
#line 78 "..\..\MainWindow.xaml" #line 102 "..\..\MainWindow.xaml"
this.parametresItem.Selected += new System.Windows.RoutedEventHandler(this.parametresItem_Selected); this.parametresItem.Selected += new System.Windows.RoutedEventHandler(this.parametresItem_Selected);
#line default #line default
#line hidden #line hidden
return; return;
case 10: case 14:
this.analyseItem = ((HamburgerMenu.HamburgerMenuItem)(target)); this.analyseItem = ((HamburgerMenu.HamburgerMenuItem)(target));
#line 79 "..\..\MainWindow.xaml" #line 103 "..\..\MainWindow.xaml"