Commit 42589637 authored by Pipelier Quentin's avatar Pipelier Quentin
Browse files

Mise à jour du 21/06/19

parent a23e3e74
......@@ -29,14 +29,14 @@
<MapFileExtensions>true</MapFileExtensions>
<InstallUrl>http://www.adg-software.fr/Softwares/ADGSoftware/ADG_Assistance/</InstallUrl>
<SupportUrl>http://www.adg-software.fr/</SupportUrl>
<ProductName>ADG_AssistanceV2</ProductName>
<ProductName>ADG_Assistance</ProductName>
<PublisherName>ADG Software Engineering</PublisherName>
<SuiteName>ADG_AssistanceV2</SuiteName>
<SuiteName>ADG_Assistance</SuiteName>
<CreateWebPageOnPublish>true</CreateWebPageOnPublish>
<WebPage>index.html</WebPage>
<TrustUrlParameters>true</TrustUrlParameters>
<ApplicationRevision>6</ApplicationRevision>
<ApplicationVersion>1.0.4.6</ApplicationVersion>
<ApplicationRevision>8</ApplicationRevision>
<ApplicationVersion>1.0.4.8</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<CreateDesktopShortcut>true</CreateDesktopShortcut>
<PublishWizardCompleted>true</PublishWizardCompleted>
......
......@@ -19,7 +19,7 @@
</providers>
</entityFramework>
<connectionStrings>
<add name="ADG_AssistanceEntities" connectionString="metadata=res://*/DB.ADG_AssistanceModel.csdl|res://*/DB.ADG_AssistanceModel.ssdl|res://*/DB.ADG_AssistanceModel.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=ADGDAGOBAH;initial catalog=ADG_Assistance_test;;user id=ad_user;password=Adg72;MultipleActiveResultSets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" />
<add name="ADG_AssistanceEntities" connectionString="metadata=res://*/DB.ADG_AssistanceModel.csdl|res://*/DB.ADG_AssistanceModel.ssdl|res://*/DB.ADG_AssistanceModel.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=ADGDAGOBAH;initial catalog=ADG_Assistance;;user id=ad_user;password=Adg72;MultipleActiveResultSets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" />
</connectionStrings>
......
......@@ -6,11 +6,11 @@
xmlns:local="clr-namespace:ADG_Assistance.Vue.DataDisplay"
mc:Ignorable="d"
WindowStartupLocation="CenterScreen"
Title="Se connecter" Height="347.834" Width="502.08" Closing="Window_Closing">
Title="Se connecter" Height="347.834" Width="502.08" Closing="Window_Closing" KeyDown="Window_KeyDown">
<Grid>
<Label Content="Se connecter" HorizontalAlignment="Left" Margin="141,10,0,0" VerticalAlignment="Top" Width="219" FontSize="36" Height="63"/>
<ComboBox x:Name="CBB_ListeLogin" Style="{StaticResource CBB_StyleClientNom}" HorizontalAlignment="Left" Margin="159,107,0,0" VerticalAlignment="Top" Width="180" SelectionChanged="CBB_ListeLogin_SelectionChanged"/>
<PasswordBox PasswordChar="*" x:Name="TXT_Password" Style="{StaticResource TXT_Password}" HorizontalAlignment="Left" Height="23" Margin="159,176,0,0" VerticalAlignment="Top" Width="180"/>
<PasswordBox PasswordChar="*" x:Name="TXT_Password" Style="{StaticResource TXT_Password}" HorizontalAlignment="Left" Height="23" Margin="159,176,0,0" VerticalAlignment="Top" Width="180" KeyDown="TXT_Password_KeyDown"/>
<Label Content="Identifiant" HorizontalAlignment="Left" Margin="159,81,0,0" VerticalAlignment="Top" Width="180"/>
<Label x:Name="LBL_Mot_de_passe" Content="Mot de passe" HorizontalAlignment="Left" Margin="159,150,0,0" VerticalAlignment="Top" Width="180"/>
<Button x:Name="BTN_Connect" Content="Connexion" HorizontalAlignment="Left" Margin="199,241,0,0" VerticalAlignment="Top" Width="104" Click="BTN_Connect_Click"/>
......
......@@ -39,53 +39,61 @@ namespace ADG_Assistance.Vue.DataDisplay
private void BTN_Connect_Click(object sender, RoutedEventArgs e)
{
connect();
}
private void connect()
{
using (MD5 md5Hash = MD5.Create())
if(TXT_Password.Password != "")
{
string source = "";
var password_bdd = from membres in dbEntity.Membres where membres.user == CBB_ListeLogin.SelectedItem.ToString() select membres.password;
foreach(var hashPassword in password_bdd)
using (MD5 md5Hash = MD5.Create())
{
source = hashPassword;
}
string source = "";
var password_bdd = from membres in dbEntity.Membres where membres.user == CBB_ListeLogin.SelectedItem.ToString() select membres.password;
if (VerifyMd5Hash(md5Hash, TXT_Password.Password, source))
{
DateTimeOffset date = DateTimeOffset.MaxValue;
cache.Add("Username", CBB_ListeLogin.SelectedItem.ToString(), date);
var role = (from membres in dbEntity.Membres where membres.user == CBB_ListeLogin.SelectedItem.ToString() select membres.role);
foreach(var donneRole in role)
foreach (var hashPassword in password_bdd)
{
cache.Add("Role", donneRole, date);
source = hashPassword;
}
var mail = (from membres in dbEntity.Membres where membres.user == CBB_ListeLogin.SelectedItem.ToString() select membres.mail);
foreach (var donneeMail in mail)
if (VerifyMd5Hash(md5Hash, TXT_Password.Password, source))
{
cache.Add("Mail", donneeMail, date);
}
var id = (from membres in dbEntity.Membres where membres.user == CBB_ListeLogin.SelectedItem.ToString() select membres.id);
foreach (var donnneId in id)
DateTimeOffset date = DateTimeOffset.MaxValue;
cache.Add("Username", CBB_ListeLogin.SelectedItem.ToString(), date);
var role = (from membres in dbEntity.Membres where membres.user == CBB_ListeLogin.SelectedItem.ToString() select membres.role);
foreach (var donneRole in role)
{
cache.Add("Role", donneRole, date);
}
var mail = (from membres in dbEntity.Membres where membres.user == CBB_ListeLogin.SelectedItem.ToString() select membres.mail);
foreach (var donneeMail in mail)
{
cache.Add("Mail", donneeMail, date);
}
var id = (from membres in dbEntity.Membres where membres.user == CBB_ListeLogin.SelectedItem.ToString() select membres.id);
foreach (var donnneId in id)
{
cache.Add("Id", donnneId, date);
}
MainWindow home = new MainWindow(true);
home.Show();
showNotification();
this.Hide();
}
else
{
cache.Add("Id", donnneId, date);
System.Windows.MessageBox.Show("Erreur de connexion, mauvais mot de passe.");
}
MainWindow home = new MainWindow(true);
home.Show();
showNotification();
this.Hide();
}
else
{
System.Windows.MessageBox.Show("Erreur de connexion, mauvais mot de passe.");
}
}
}
static string GetMd5Hash(MD5 md5Hash, string input)
......@@ -240,5 +248,23 @@ namespace ADG_Assistance.Vue.DataDisplay
}
}
private void TXT_Password_KeyDown(object sender, System.Windows.Input.KeyEventArgs e)
{
if(e.Key == Key.Enter)
{
connect();
e.Handled = true;
}
}
private void Window_KeyDown(object sender, System.Windows.Input.KeyEventArgs e)
{
if (e.Key == Key.Enter)
{
connect();
e.Handled = true;
}
}
}
}
......@@ -14,6 +14,8 @@ using System.Net.Mail;
using MailMessage = System.Net.Mail.MailMessage;
using System.Net;
using System.Runtime.Caching;
using System.Net.Mime;
using System.Reflection;
namespace ADG_Assistance.Functions
{
......@@ -324,65 +326,60 @@ namespace ADG_Assistance.Functions
object mailConvert = cache.Get("Mail");
string mailADG = mailConvert.ToString();
MessageBox.Show("Num: " + bi.Contrat.NumContrat);
var idContrat = from contrat in dbEntity.Contrat
int idContrat = (from contrat in dbEntity.Contrat
where contrat.NumContrat == bi.Contrat.NumContrat
select contrat.Id;
int contratId = 0;
foreach(var result in idContrat)
{
contratId = result;
}
MessageBox.Show("Contrat:" + contratId);
var idProjet = from projettocontrat in dbEntity.ProjetToContrat
where projettocontrat.idContrat == contratId
select projettocontrat.idProjet;
int projetID = 0;
select contrat.Id).First();
foreach(var result in idProjet)
{
projetID = (int) result;
}
MessageBox.Show("projet" + projetID);
var idClient = from projet in dbEntity.Projet
where projet.Id == projetID
select projet.IdClient;
int idProjet = (int)(from projettocontrat in dbEntity.ProjetToContrat
where projettocontrat.idContrat == idContrat
select projettocontrat.idProjet).First();
int clientID = 0;
foreach (var result in idClient)
{
clientID = (int)result;
int idClient = (int)(from projet in dbEntity.Projet
where projet.Id == idProjet
select projet.IdClient).First();
}
MessageBox.Show("client" + clientID);
var mailClient = from clients in dbEntity.Client
where clients.id == clientID
select clients.Mail;
string mailEnvoiClient = "";
string mailClient = (from clients in dbEntity.Client
where clients.id == idClient
select clients.Mail).First();
foreach(var result in mailClient)
{
mailEnvoiClient = result;
}
MessageBox.Show("" + mailEnvoiClient);
envoiMail.To.Add(new MailAddress(mailADG));
envoiMail.To.Add(new MailAddress(mailEnvoiClient));
envoiMail.To.Add(new MailAddress(mailClient));
envoiMail.Subject = "Bon Intervention sur votre contrat n°"+bi.Contrat.NumContrat;
envoiMail.Body = "Bonjour,\n\nVeuillez trouver ci-joint votre bon intervention suite à votre demande.\n\nNous vous remercions de bien vouloir nous renvoyer une copie signé de ce bon.";
envoiMail.IsBodyHtml = true;
envoiMail.Body = "";
LinkedResource LinkedImage = new LinkedResource(@"C:\Document_ADG_Assistance\LogoADG.jpg");
LinkedImage.ContentId = "MyPic";
AlternateView htmlView = AlternateView.CreateAlternateViewFromString(
"<html><body>Bonjour.<br><br>Veuillez trouver ci-joint votre bon d'intervention suite à votre demande." +
"<br><br>Nous vous remercions de bien vouloir nous renvoyer une copie signée de ce bon." +
"<br><br>Pour toute question relative à ce message, merci de bien vouloir nous contacter à l’adresse support@adg-software.fr" +
"<br><br>Cordialement" +
"<br><br> <img src=cid:MyPic><br><strong>ADG Software Engineering" +
"<br><p style=\"color: purple\">2, Boulevard de la Fresnellerie - 72100 LE MANS</p>" +
"Tel : +33 (0)2 43 43 05 43 / Fax : +33 (0)2 43 24 16 36" +
"<br><a href=\"www.adg-software.fr\">www.adg-software.fr</a>" +
"<br><p style=\"color: green\">Be green, leave it on the screen</p></strong>",
null, "text/html");
htmlView.LinkedResources.Add(LinkedImage);
envoiMail.AlternateViews.Add(htmlView);
LinkedImage.ContentType = new ContentType(MediaTypeNames.Image.Jpeg);
// création de la pièce jointe
Attachment PDF_BI = new Attachment(fileName.ToString()); // chemin de la pièce jointe
......@@ -400,13 +397,22 @@ namespace ADG_Assistance.Functions
try
{
client.Send(envoiMail);
MessageBox.Show("Le mail à bien été envoyé, une copie vous est envoyée par mail.");
msWord.Visible = true;
if(mailClient != "")
{
client.Send(envoiMail);
System.Windows.Forms.NotifyIcon _notifyIcon = new System.Windows.Forms.NotifyIcon();
_notifyIcon.Icon = System.Drawing.Icon.ExtractAssociatedIcon(Assembly.GetExecutingAssembly().Location);
_notifyIcon.BalloonTipClosed += (s, e) => _notifyIcon.Visible = false;
_notifyIcon.Visible = true;
_notifyIcon.ShowBalloonTip(3000, "Bon intervention n°" + bi.NumeroBon, "Le mail vient d'être envoyé aux personnes suivantes:\n - " + mailClient + "\n - " + mailADG, System.Windows.Forms.ToolTipIcon.Info);
msWord.Visible = true;
}
}
catch
{
MessageBox.Show("Une erreur est survenue.");
MessageBox.Show("Une erreur est survenue. Le client n'a pas d'e-mail enregistrer.");
}
......
......@@ -79,7 +79,7 @@ namespace ADG_Assistance.Functions
public static string connectDatabase()
{
return "data source=ADGDAGOBAH;initial catalog=ADG_Assistance_test;;user id=ad_user;password=Adg72";
return "data source=ADGDAGOBAH;initial catalog=ADG_Assistance;;user id=ad_user;password=Adg72";
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<asmv1:assembly xsi:schemaLocation="urn:schemas-microsoft-com:asm.v1 assembly.adaptive.xsd" manifestVersion="1.0" xmlns:asmv1="urn:schemas-microsoft-com:asm.v1" xmlns="urn:schemas-microsoft-com:asm.v2" xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:xrml="urn:mpeg:mpeg21:2003:01-REL-R-NS" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3" xmlns:dsig="http://www.w3.org/2000/09/xmldsig#" xmlns:co.v1="urn:schemas-microsoft-com:clickonce.v1" xmlns:co.v2="urn:schemas-microsoft-com:clickonce.v2">
<assemblyIdentity name="ADG_Assistance.application" version="1.0.4.6" publicKeyToken="0000000000000000" language="neutral" processorArchitecture="msil" xmlns="urn:schemas-microsoft-com:asm.v1" />
<description asmv2:publisher="ADG Software Engineering" co.v1:suiteName="ADG_AssistanceV2" asmv2:product="ADG_AssistanceV2" asmv2:supportUrl="http://www.adg-software.fr/" xmlns="urn:schemas-microsoft-com:asm.v1" />
<assemblyIdentity name="ADG_Assistance.application" version="1.0.4.8" publicKeyToken="0000000000000000" language="neutral" processorArchitecture="msil" xmlns="urn:schemas-microsoft-com:asm.v1" />
<description asmv2:publisher="ADG Software Engineering" co.v1:suiteName="ADG_Assistance" asmv2:product="ADG_Assistance" asmv2:supportUrl="http://www.adg-software.fr/" xmlns="urn:schemas-microsoft-com:asm.v1" />
<deployment install="true" mapFileExtensions="true" trustURLParameters="true" co.v1:createDesktopShortcut="true">
<subscription>
<update>
......@@ -15,13 +15,13 @@
</compatibleFrameworks>
<dependency>
<dependentAssembly dependencyType="install" codebase="ADG_Assistance.exe.manifest" size="53449">
<assemblyIdentity name="ADG_Assistance.exe" version="1.0.4.6" publicKeyToken="0000000000000000" language="neutral" processorArchitecture="msil" type="win32" />
<assemblyIdentity name="ADG_Assistance.exe" version="1.0.4.8" publicKeyToken="0000000000000000" language="neutral" processorArchitecture="msil" type="win32" />
<hash>
<dsig:Transforms>
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
</dsig:Transforms>
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha256" />
<dsig:DigestValue>AdDKtnBhTiftoXezSs9lW5MK8tMwdBhqcSHSbCTIUxg=</dsig:DigestValue>
<dsig:DigestValue>m6SKNLxL1PFlkjSmdnDcmwL4emAl/mKWPxPHDikSKxY=</dsig:DigestValue>
</hash>
</dependentAssembly>
</dependency>
......
<?xml version="1.0" encoding="utf-8"?>
<asmv1:assembly xsi:schemaLocation="urn:schemas-microsoft-com:asm.v1 assembly.adaptive.xsd" manifestVersion="1.0" xmlns:asmv1="urn:schemas-microsoft-com:asm.v1" xmlns="urn:schemas-microsoft-com:asm.v2" xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:co.v1="urn:schemas-microsoft-com:clickonce.v1" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3" xmlns:dsig="http://www.w3.org/2000/09/xmldsig#" xmlns:co.v2="urn:schemas-microsoft-com:clickonce.v2">
<asmv1:assemblyIdentity name="ADG_Assistance.exe" version="1.0.4.6" publicKeyToken="0000000000000000" language="neutral" processorArchitecture="msil" type="win32" />
<asmv1:assemblyIdentity name="ADG_Assistance.exe" version="1.0.4.8" publicKeyToken="0000000000000000" language="neutral" processorArchitecture="msil" type="win32" />
<description asmv2:iconFile="ADG_Logo.ico" xmlns="urn:schemas-microsoft-com:asm.v1" />
<application />
<entryPoint>
......@@ -43,14 +43,14 @@
</dependentAssembly>
</dependency>
<dependency>
<dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="ADG_Assistance.exe" size="3041064">
<dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="ADG_Assistance.exe" size="3042600">
<assemblyIdentity name="ADG_Assistance" version="1.0.4.0" language="neutral" processorArchitecture="msil" />
<hash>
<dsig:Transforms>
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
</dsig:Transforms>
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha256" />
<dsig:DigestValue>5zhC6y3gjZJYFfoEgCN6R8RKtTSXjqksu3k628bYYeE=</dsig:DigestValue>
<dsig:DigestValue>N1vdTtYLo+aLA5g6UNSi+xwCV466uHqbsYidqEbTORk=</dsig:DigestValue>
</hash>
</dependentAssembly>
</dependency>
......@@ -882,13 +882,13 @@
</hash>
</dependentAssembly>
</dependency>
<file name="ADG_Assistance.exe.config" size="1974">
<file name="ADG_Assistance.exe.config" size="1969">
<hash>
<dsig:Transforms>
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
</dsig:Transforms>
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha256" />
<dsig:DigestValue>SmK3zzOa7mtLiEr4sufL8wsvLGYPJHF4fUNirr3oXWo=</dsig:DigestValue>
<dsig:DigestValue>wkuqgj0jw5t/jWuqFaVfAhzCLHeVl/mPV8o2Pmfww9k=</dsig:DigestValue>
</hash>
</file>
<file name="ADG_Logo.ico" size="602094">
......

FC:\Users\Programmeur1\source\repos\adgassistance-v22\ADG_AssistanceV2\Vue\DataDisplay\DisplayAppel.xaml;;
FC:\Users\Programmeur1\source\repos\adgassistance-v22\ADG_AssistanceV2\Vue\DataDisplay\DisplayContrat.xaml;;
FC:\Users\Programmeur1\source\repos\adgassistance-v22\ADG_AssistanceV2\Vue\DataManagement\ManageAppels.xaml;;
FC:\Users\Programmeur1\source\repos\adgassistance-v22\ADG_AssistanceV2\Vue\Style\SourceStyle.xaml;;
FC:\Users\Programmeur1\source\repos\adgassistance-v22\ADG_AssistanceV2\DisplayLogin.xaml;;
#pragma checksum "..\..\DisplayLogin.xaml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "A6AF5C6398546DE5B034EDF2319E6AA070520AF3"
#pragma checksum "..\..\DisplayLogin.xaml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "1DF782FC5D754C98B63DEA19B752910386CE96DD"
//------------------------------------------------------------------------------
// <auto-generated>
// Ce code a été généré par un outil.
......@@ -116,6 +116,12 @@ namespace ADG_Assistance.Vue.DataDisplay {
#line 9 "..\..\DisplayLogin.xaml"
((ADG_Assistance.Vue.DataDisplay.DispayLogin)(target)).Closing += new System.ComponentModel.CancelEventHandler(this.Window_Closing);
#line default
#line hidden
#line 9 "..\..\DisplayLogin.xaml"
((ADG_Assistance.Vue.DataDisplay.DispayLogin)(target)).KeyDown += new System.Windows.Input.KeyEventHandler(this.Window_KeyDown);
#line default
#line hidden
return;
......@@ -130,6 +136,12 @@ namespace ADG_Assistance.Vue.DataDisplay {
return;
case 3:
this.TXT_Password = ((System.Windows.Controls.PasswordBox)(target));
#line 13 "..\..\DisplayLogin.xaml"
this.TXT_Password.KeyDown += new System.Windows.Input.KeyEventHandler(this.TXT_Password_KeyDown);
#line default
#line hidden
return;
case 4:
this.LBL_Mot_de_passe = ((System.Windows.Controls.Label)(target));
......
#pragma checksum "..\..\DisplayLogin.xaml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "A6AF5C6398546DE5B034EDF2319E6AA070520AF3"
#pragma checksum "..\..\DisplayLogin.xaml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "1DF782FC5D754C98B63DEA19B752910386CE96DD"
//------------------------------------------------------------------------------
// <auto-generated>
// Ce code a été généré par un outil.
......@@ -116,6 +116,12 @@ namespace ADG_Assistance.Vue.DataDisplay {
#line 9 "..\..\DisplayLogin.xaml"
((ADG_Assistance.Vue.DataDisplay.DispayLogin)(target)).Closing += new System.ComponentModel.CancelEventHandler(this.Window_Closing);
#line default
#line hidden
#line 9 "..\..\DisplayLogin.xaml"
((ADG_Assistance.Vue.DataDisplay.DispayLogin)(target)).KeyDown += new System.Windows.Input.KeyEventHandler(this.Window_KeyDown);
#line default
#line hidden
return;
......@@ -130,6 +136,12 @@ namespace ADG_Assistance.Vue.DataDisplay {
return;
case 3:
this.TXT_Password = ((System.Windows.Controls.PasswordBox)(target));
#line 13 "..\..\DisplayLogin.xaml"
this.TXT_Password.KeyDown += new System.Windows.Input.KeyEventHandler(this.TXT_Password_KeyDown);
#line default
#line hidden
return;
case 4:
this.LBL_Mot_de_passe = ((System.Windows.Controls.Label)(target));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment