public static Message EncryptString(Message msg)
        {
            string toEncrypt = (string)msg.Data[0];
            byte[] encryptionKey = GenerateAESKey();

            var toEncryptBytes = Encoding.UTF8.GetBytes(toEncrypt);
            using (var provider = new AesCryptoServiceProvider())
            {
                provider.Key = encryptionKey;
                provider.Mode = CipherMode.CBC;
                provider.Padding = PaddingMode.PKCS7;
                using (var encryptor = provider.CreateEncryptor(provider.Key, provider.IV))
                {
                    using (var ms = new MemoryStream())
                    {
                        using (var cs = new CryptoStream(ms, encryptor, CryptoStreamMode.Write))
                        {
                            cs.Write(toEncryptBytes, 0, toEncryptBytes.Length);
                            cs.FlushFinalBlock();
                            var retVal = new byte[16 + ms.Length];
                            provider.IV.CopyTo(retVal, 0);
                            ms.ToArray().CopyTo(retVal, 16);
                            msg.Data[0] = retVal;
                            msg.Data[1] = encryptionKey;
                            msg.Statut = true;
                            return msg;
                        }
                    }
                }
            }
        }
        public static Message DecryptString(Message msg)
        {
            byte[] encryptedString = ((byte[])msg.Data[0]);
            byte[] encryptionKey = (byte[])msg.Data[1];

            using (var provider = new AesCryptoServiceProvider())
            {
                provider.Key = encryptionKey;
                provider.Mode = CipherMode.CBC;
                provider.Padding = PaddingMode.PKCS7;
                provider.IV = encryptedString.Take(16).ToArray();
                using (var ms = new MemoryStream(encryptedString, 16, encryptedString.Length - 16))
                {
                    using (var decryptor = provider.CreateDecryptor(provider.Key, provider.IV))
                    {
                        using (var cs = new CryptoStream(ms, decryptor, CryptoStreamMode.Read))
                        {
                            byte[] decrypted = new byte[encryptedString.Length];
                            var byteCount = cs.Read(decrypted, 0, encryptedString.Length);
                            msg.Data[0] = Encoding.UTF8.GetString(decrypted, 0, byteCount);
                            msg.Data[1] = encryptionKey;
                            msg.Statut = true;
                            return msg;
                        }
                    }
                }
            }
        }
        public static Message Check(Message msg)
        {
            List<string> authorizedApplications = new List<string>();
            authorizedApplications.Add("Client");
            authorizedApplications.Add("Middleware");

            Message reponseNegative = msg;
            reponseNegative.Statut = false;

            if ((!authorizedApplications.Contains(msg.AppName)) || (string.IsNullOrEmpty(msg.Invoke)) || !Token.ValidToken(msg.Token))
            {
                Program.Debug("Une application non autorisé a envoyé un message: \nAppName:" + msg.AppName + "  token:" + msg.Token + "  isValid:" + Token.ValidToken(msg.Token));
                string[] tokenParts = msg.Token.Split('|');
                string _hash = tokenParts[0];
                double time = Convert.ToDouble(tokenParts[1]);
                MD5Crypter md5 = new MD5Crypter();
                Program.Debug("Token invalide : " + _hash + "\n\t" + md5.Encrypt("WAYSprOject1")
                    + " Is Valid:" + (_hash == md5.Encrypt("WAYSprOject1"))
                    + " \nTime:" + time + " StillValid:"+ (time > 0));
                return reponseNegative;
            }

            Program.Debug("Une application autorisé a envoyé un message: \nAppName:" + msg.AppName + "  token:" + msg.Token + "  isValid:" + Token.ValidToken(msg.Token));

            TaskProvider taskProvider = new TaskProvider();
            Message reponse = taskProvider.ExecTask(msg);
            return reponse;
        }
        private void SendMailButton_Click(object sender, RoutedEventArgs e)
        {
            CT_EnvoyerMail work = new CT_EnvoyerMail();
            Message msg = new Message();
            msg.Data[0] = "*****@*****.**";
            Message reponse = work.Exec(msg);

            this.DebugTextBlock.Text = "Tâche :" + reponse.Invoke + "    Réussi :" + reponse.Statut.ToString() + "\n";
        }
Beispiel #5
0
        public Message ExecTask(Message msg)
        {
            msg = TranslateTaskToWF(msg);

            Message reponse = this.cam.ExecWF(msg);

            reponse = TranslateWFToTask(msg);

            return reponse;
        }
        public Message Exec(Message msg)
        {
            List<QuestionOrientation> questionsOrientation = new List<QuestionOrientation>();

            msg.Data[0] = Mpg_Questions_Orientation.Rq_GetAllQuestions();
            Message reponse = CAD.GetInstance().Execute_StockedProcedure(msg);
            System.Data.DataSet results = (System.Data.DataSet)reponse.Data[0];

            msg.Data[0] = Mpg_Reponses_Orientation.Rq_GetAllReponses();
            Message reponseRep = CAD.GetInstance().Execute_StockedProcedure(msg);
            System.Data.DataSet resultsRep = (System.Data.DataSet)reponseRep.Data[0];

            msg.Data[0] = Mpg_Metiers.Rq_GetAllMetiers();
            Message reponseMetier = CAD.GetInstance().Execute_StockedProcedure(msg);
            System.Data.DataSet resultsMetier = (System.Data.DataSet)reponseRep.Data[0];

            foreach (System.Data.DataRow row in results.Tables[0].Rows)
            {
                List<ReponseOrientation> reponsesQuestion = new List<ReponseOrientation>();

                int id = Convert.ToInt32(row[Mpg_Questions_Orientation.CH_ID].ToString());
                string intitule = row[Mpg_Questions_Orientation.CH_INTITULE].ToString();
                int ordre = Convert.ToInt32(row[Mpg_Questions_Orientation.CH_ORDRE].ToString());

                foreach (System.Data.DataRow rowRep in resultsRep.Tables[0].Rows)
                {
                    Metier metier = new Metier("Aucun metier","Aucune description");

                    int idRep = Convert.ToInt32(rowRep[Mpg_Reponses_Orientation.CH_ID].ToString());
                    int idQues = Convert.ToInt32(rowRep[Mpg_Reponses_Orientation.CH_ID_QUESTION].ToString());
                    string intituleRep = rowRep[Mpg_Reponses_Orientation.CH_INTITULE].ToString();
                    int idMetier = Convert.ToInt32(rowRep[Mpg_Reponses_Orientation.CH_ID_METIER].ToString());

                    foreach (System.Data.DataRow rowMet in resultsMetier.Tables[0].Rows)
                    {
                        int idMet = Convert.ToInt32(rowMet[Mpg_Metiers.CH_ID].ToString());
                        string intituleMet = rowMet[Mpg_Metiers.CH_INTITULE].ToString();
                        string descMet = rowMet[Mpg_Metiers.CH_DESCRIPTION].ToString();

                        if (idMet == idMetier)
                            metier = new Metier(idMet, intituleMet, descMet);
                    }

                    ReponseOrientation reponseQues = new ReponseOrientation(idRep, idQues, intituleRep, metier);

                    if (reponseQues.ID_Question == id)
                        reponsesQuestion.Add(reponseQues);
                }

                questionsOrientation.Add(new QuestionOrientation(id, intitule, reponsesQuestion.Cast<ReponseOrientation>().ToArray(), ordre));
            }

            msg.Data[0] = questionsOrientation.Cast<QuestionOrientation>().ToArray();
            return msg;
        }
Beispiel #7
0
        public Message Exec(Message msg)
        {
            if (msg.Data[0].GetType() != typeof(int))
                return msg;

            msg.Data[0] = Mpg_Joueurs.Rq_DeletePlayer((int)msg.Data[0]);

            msg = CAD.GetInstance().Execute_StockedProcedure(msg);

            return msg;
        }
Beispiel #8
0
        public Message Exec(Message msg)
        {
            if (msg.Data[0].GetType() != typeof(int) && msg.Data[1].GetType() != typeof(string) && msg.Data[2].GetType() != typeof(int))
                return msg;

            msg.Data[0] = Mpg_Joueurs.Rq_UpdatePlayer((int)msg.Data[0], (string)msg.Data[1], (int)msg.Data[2]);

            msg = CAD.GetInstance().Execute_StockedProcedure(msg);

            return msg;
        }
Beispiel #9
0
        public Message Exec(Message msg)
        {
            if(msg.Data[0].GetType() == typeof(string) && msg.Data[1].GetType() == typeof(string))
            {
                msg = ComSMTP.GetInstance().SendMail(msg);
                return msg;
            }

            msg.Statut = false;
            return msg;
        }
Beispiel #10
0
        public Message Exec(Message msg)
        {
            if (msg.Data[0].GetType() != typeof(string) && msg.Data[1].GetType() != typeof(string))
                return msg;

            msg.Data[0] = Mpg_Metiers.Rq_CreateMetier((string)msg.Data[0], (string)msg.Data[1]);

            msg = CAD.GetInstance().Execute_StockedProcedure(msg);

            return msg;
        }
        public Message Exec(Message msg)
        {
            if (msg.Data[0].GetType() != typeof(ComposantTechnique.Objets_en_base.QuestionJeu))
                return msg;

            msg.Data[0] = Mpg_Questions_Jeu.Rq_DeleteQuestion(((ComposantTechnique.Objets_en_base.QuestionJeu)msg.Data[0]).ID);

            msg = CAD.GetInstance().Execute_StockedProcedure(msg);

            return msg;
        }
        public Message Exec(Message msg)
        {

            if (msg.Data[0].GetType() != typeof(string) && msg.Data[1].GetType() != typeof(bool) && msg.Data[2].GetType() != typeof(string) && msg.Data[3].GetType() != typeof(string) && msg.Data[4].GetType() != typeof(string) && msg.Data[5].GetType() != typeof(string))
                return msg;

            msg.Data[0] = Mpg_Statistiques.Rq_CreateStat((int)msg.Data[0], (bool)msg.Data[1], (string)msg.Data[2], (string)msg.Data[3], (string)msg.Data[4], (string)msg.Data[5]);

            msg = CAD.GetInstance().Execute_StockedProcedure(msg);

            return msg;
        }
 public Message Exec(Message oMsg)
 {
     Message msg = new Message();
     Token token = new Token("37223bb1b16ab31a8b653b7d122da208");
     msg.AppName = Properties.Settings.Default.AppName;
     msg.Invoke = ServeurTask.AFFICHER_CLASSEMENT;
     msg.PSecurity = "Projet_Client";
     msg.Statut = false;
     msg.Info = "J'ajoute un joueur";
     msg.Token = token.ToString();
     Message reponse = MessageManager.SendMessageToServer(msg);
     return reponse;
 }
 public Message Exec(Message oMsg)
 {
     Message msg = new Message();
     Token token = new Token("37223bb1b16ab31a8b653b7d122da208");
     msg.AppName = Properties.Settings.Default.AppName;
     msg.Invoke = ServeurTask.AJOUTER_STATISTIQUE;
     msg.PSecurity = "Projet_Client";
     msg.Statut = false;
     msg.Info = "J'ajoute des données de staistique";
     msg.Data = oMsg.Data;
     msg.Token = token.ToString();
     Message reponse = MessageManager.SendMessageToServer(msg);
     return reponse;
 }
Beispiel #15
0
 public Message Exec(Message oMsg)
 {
     Message msg = new Message();
     Token token = new Token("37223bb1b16ab31a8b653b7d122da208");
     msg.AppName = Properties.Settings.Default.AppName;
     msg.Invoke = ServeurTask.MODIFIER_MAIL;
     msg.PSecurity = "Projet_Client";
     msg.Statut = false;
     msg.Info = "Je modifie l'adresse mail";
     msg.Data = oMsg.Data;
     msg.Token = token.ToString();
     Message reponse = MessageManager.SendMessageToServer(msg);
     return reponse;
 }
Beispiel #16
0
 public Message Exec(Message oMsg)
 {
     Message msg = new Message();
     Token token = new Token("37223bb1b16ab31a8b653b7d122da208");
     msg.AppName = Properties.Settings.Default.AppName;
     msg.Invoke = ServeurTask.ENVOYER_MAIL;
     msg.PSecurity = "Projet_Client";
     msg.Statut = false;
     msg.Info = "J'essaie d'envoyer un mail";
     msg.Data[0] = oMsg.Data[0];
     msg.Data[1] = "Corps du message";
     msg.Token = token.ToString();
     Message reponse = MessageManager.SendMessageToServer(msg);
     return reponse;
 }
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            CT_Add_Statistique CT = new CT_Add_Statistique();

            Message msg = new Message();
            msg.Data[0] = this.AgeTextBox.Text;
            if(this.SexeComboBox.Text == "Homme")
                msg.Data[1] = true;
            else
                msg.Data[1] = false;
            msg.Data[2] = this.CodePostalTextBox.Text;
            msg.Data[3] = this.DiplomeTextBox.Text;
            msg.Data[4] = this.TypeDiplomeTextBox.Text;
            msg.Data[5] = this.ConnaissanceTextBox.Text;

            CT.Exec(msg);
        }
Beispiel #18
0
        public Message Exec(Message msg)
        {

        //XMLLoader xml = new XMLLoader(CONFIG_TYPE.SMTP_Config);

        string[] nodes = new string[2];
        nodes[0] = "Address";
        nodes[1] = "Username";

        string[] mails = new string[2];
        mails[0] = (string)msg.Data[0];
        mails[1] = (string)msg.Data[0];

        msg.Data[0] = nodes;
        msg.Data[1] = mails;

        msg = XMLLoader.ModifierNode(msg);

        return msg;
        }
        public Message Exec(Message msg)
        {
            if (msg.Data[0].GetType() != typeof(QuestionJeu))
                return msg;

            QuestionJeu questionAAjouter = (QuestionJeu)msg.Data[0];

            ReponseJeu[] listeReponses = questionAAjouter.Reponses;

            msg.Data[0] = Mpg_Questions_Jeu.Rq_CreateQuestion(questionAAjouter.QuestionText, questionAAjouter.Order);
            msg = CAD.GetInstance().Execute_StockedProcedure(msg);

            foreach (ReponseJeu rep in listeReponses)
            {
                msg.Data[0] = Mpg_Reponses_Jeu.Rq_CreateReponse(rep.ID, rep.ReponseText, rep.Points, rep.IsCorrect);
                msg = CAD.GetInstance().Execute_StockedProcedure(msg);
            }

            return msg;
        }
        public Message Exec(Message msg)
        {
            if (msg.Data[0].GetType() != typeof(QuestionOrientation))
                return msg;

            QuestionOrientation questionO = (QuestionOrientation)msg.Data[0];
            ReponseOrientation[] listeRep = questionO.Reponses;

            msg.Data[0] = Mpg_Questions_Jeu.Rq_CreateQuestion(questionO.QuestionText, questionO.Order);
            msg = CAD.GetInstance().Execute_StockedProcedure(msg);

            foreach (ReponseOrientation rep in listeRep)
            {
                msg.Data[0] = Mpg_Reponses_Orientation.Rq_CreateReponse(rep.ID, rep.ReponseText, rep.Metier.ID);
                msg = CAD.GetInstance().Execute_StockedProcedure(msg);
            }

            return msg;

        }
        public Message Exec(Message msg)
        {
            List<QuestionJeu> questionsJeu = new List<QuestionJeu>();
            
            msg.Data[0] = Mpg_Questions_Jeu.Rq_GetAllQuestions();
            Message reponse = CAD.GetInstance().Execute_StockedProcedure(msg);
            System.Data.DataSet results = (System.Data.DataSet)reponse.Data[0];

            msg.Data[0] = Mpg_Reponses_Jeu.Rq_GetAllReponses();
            Message reponseRep = CAD.GetInstance().Execute_StockedProcedure(msg);
            System.Data.DataSet resultsRep = (System.Data.DataSet)reponseRep.Data[0];

            foreach (System.Data.DataRow row in results.Tables[0].Rows)
            {
                List<ReponseJeu> reponsesQuestion = new List<ReponseJeu>();

                int id = Convert.ToInt32(row[Mpg_Questions_Jeu.CH_ID].ToString());
                string intitule= row[Mpg_Questions_Jeu.CH_INTITULE].ToString();
                int ordre = Convert.ToInt32(row[Mpg_Questions_Jeu.CH_ORDRE].ToString());

                foreach (System.Data.DataRow rowRep in resultsRep.Tables[0].Rows)
                {
                    int idRep = Convert.ToInt32(rowRep[Mpg_Reponses_Jeu.CH_ID].ToString());
                    int idQues = Convert.ToInt32(rowRep[Mpg_Reponses_Jeu.CH_ID_QUESTION].ToString());
                    string intituleRep = rowRep[Mpg_Reponses_Jeu.CH_INTITULE].ToString();
                    int points = Convert.ToInt32(rowRep[Mpg_Reponses_Jeu.CH_POINTS].ToString());
                    bool isCorrect = bool.Parse(rowRep[Mpg_Reponses_Jeu.CH_ISCORRECT].ToString());

                    ReponseJeu reponseQues = new ReponseJeu(idRep, idQues, intituleRep, points, isCorrect);

                    if(reponseQues.ID_Question == id)
                    reponsesQuestion.Add(reponseQues);
                }

                questionsJeu.Add(new QuestionJeu(id, intitule, reponsesQuestion.Cast<ReponseJeu>().ToArray(),ordre));
            }

            msg.Data[0] = questionsJeu.Cast<QuestionJeu>().ToArray();
            DebugPrintQuestions((QuestionJeu[])msg.Data[0]);
            return msg;
        }
        public Message Exec(Message msg)
        {
            msg.Data[0] = Mpg_Joueurs.Rq_GetAllPlayers();
            List<Joueur> classement = new List<Joueur>();

            Message reponse = CAD.GetInstance().Execute_StockedProcedure(msg);

            System.Data.DataSet results = (System.Data.DataSet)reponse.Data[0];

            foreach (System.Data.DataRow row in results.Tables[0].Rows)
            {
                int id = Convert.ToInt32(row[Mpg_Joueurs.CH_ID].ToString());
                string nom = row[Mpg_Joueurs.CH_PSEUDO].ToString();
                int score = Convert.ToInt32(row[Mpg_Joueurs.CH_SCORE].ToString());
                
                classement.Add(new Joueur(id, nom, score));
            }

            msg.Data[0] = classement.Cast<Joueur>().ToArray();
            return msg;
        }
        private void refreshQuestionList()
        {
            CT_Get_Questionnaire CT = new CT_Get_Questionnaire();
            Message msg = new Message();

            if (this.QuestionTypeComboBox.SelectedIndex == 0)
            {
                this.type = CT_Get_Questionnaire.QuestionnaireType.Jeu;
                msg.Data[0] = this.type;
                this.questionsJeu = (QuestionJeu[])CT.Exec(msg).Data[0];

                this.QuestionListBox.ItemsSource = this.questionsJeu;
            }
            else
            {
                this.type = CT_Get_Questionnaire.QuestionnaireType.Orientation;
                msg.Data[0] = this.type;
                this.questionsOrientation = (QuestionOrientation[])CT.Exec(msg).Data[0];

                this.QuestionListBox.ItemsSource = this.questionsOrientation;

                foreach (QuestionOrientation q in this.questionsOrientation)
                {
                    foreach (ReponseOrientation rep in q.Reponses)
                    {
                        if (!this.MetierList.Contains(rep.Metier.Intitule))
                        {
                            this.MetierList.Add(rep.Metier.Intitule);
                            Projet_Client.Composant_de_communication.MessageManager.Debug(rep.Metier.Intitule);
                        }
                    }
                }

                foreach (ComboBox cb in this.ReponseMMetierComboBox)
                {
                    cb.ItemsSource = this.MetierList;
                }
            }
        }
        public Message Exec(Message oMsg)
        {
            QuestionnaireType type = (QuestionnaireType)oMsg.Data[0];
            Message msg = new Message();
            Token token = new Token("37223bb1b16ab31a8b653b7d122da208");
            switch (type)
            {
                case QuestionnaireType.Jeu:
                    msg.Invoke = ServeurTask.AFFICHER_QUESTION_JEU;
                    break;

                case QuestionnaireType.Orientation:
                    msg.Invoke = ServeurTask.AFFICHER_QUESTION_ORIENTATION;
                    break;
            }
            msg.AppName = Properties.Settings.Default.AppName;
            msg.PSecurity = "Projet_Client";
            msg.Statut = false;
            msg.Info = "Je veux répupérer le questionnaire";
            msg.Token = token.ToString();
            Message reponse = MessageManager.SendMessageToServer(msg);
            return reponse;
        }
Beispiel #25
0
        public Message ExecWF(Message msg)
        {
            if (!string.IsNullOrEmpty(msg.Invoke))
            {
                string classeApp = msg.Invoke; // Invoke contient le nom du workflow a utiliser

                Assembly assembly = Assembly.GetExecutingAssembly();
                Type typeClasse = assembly.GetType(this.namaspaceWF +  "." + classeApp);
                if (typeClasse != null)
                {
                    Program.Debug("Execution de la tâche : " + msg.Invoke);
                    object classe = Activator.CreateInstance(typeClasse); // On instancie le bon workflow
                    msg = ((IWorkflow)classe).Exec(msg); // Et on l'execute
                    Program.Debug("Tâche exécutée : " + msg.Invoke);
                }
                else
                {
                    Program.Debug("Le CAM ne trouve pas de correpondance de classe : "+classeApp);
                    msg.Statut = false;
                }
            }
            return msg;
        }
        private void NewButton_Click(object sender, RoutedEventArgs e)
        {
            switch (this.type)
            {
                case CT_Get_Questionnaire.QuestionnaireType.Jeu:

                    int id = this.questionsJeu[this.questionsJeu.Length - 1].ID;

                    ReponseJeu[] reps = new ReponseJeu[4];

                    QuestionJeu questionJ = (new QuestionJeu(id,this.QuestionIntituleLabel.Text, reps, this.questionsJeu.Length+1));

                    Message msgJ = new Message();

                    msgJ.Data[0] = CT_Get_Questionnaire.QuestionnaireType.Jeu;
                    msgJ.Data[1] = questionJ;

                    new CT_Add_Question().Exec(msgJ);

                    break;
                case CT_Get_Questionnaire.QuestionnaireType.Orientation:
                    QuestionOrientation questionO = ((QuestionOrientation)this.QuestionListBox.SelectedItem);

                    questionO.QuestionText = this.QuestionIntituleLabel.Text;

                    Message msgO = new Message();

                    msgO.Data[0] = CT_Get_Questionnaire.QuestionnaireType.Orientation;
                    msgO.Data[1] = questionO;

                    new CT_Del_Question().Exec(msgO);

                    break;
            }
        }
Beispiel #27
0
        public static Message SendMessageToServer(Message msg)
        {
            // Data buffer for incoming data.
            byte[] bytes = new byte[131072];

            // Connect to a remote device.
            try
            {
                // Establish the remote endpoint for the socket.
                // This example uses port 11000 on the local computer.
                IPHostEntry ipHostInfo = Dns.Resolve(Dns.GetHostName());
                IPAddress ipAddress = IPAddress.Parse("127.0.0.1");
                IPEndPoint remoteEP = new IPEndPoint(ipAddress, 11000);
                // Create a TCP/IP  socket.
                Socket sender = new Socket(AddressFamily.InterNetwork,
                    SocketType.Stream, ProtocolType.Tcp);

                // Connect the socket to the remote endpoint. Catch any errors.
                try
                {
                    sender.Connect(remoteEP);

                    Console.WriteLine("Socket connected to {0}",
                        sender.RemoteEndPoint.ToString());

                    // Encode the message into a byte array.
                    Debug("Envoi d'un message... Sérilalization.");
                    byte[] msgBytes = msg.ToByteArray();
                    Debug("Envoi d'un message... Sérilalization terminée.");

                    // Send the data through the socket.
                    int bytesSent = sender.Send(msgBytes);
                    Debug("Envoi d'un message... Envoi terminé.");

                    // Receive the response from the remote device.
                    Debug("Reception d'un message... Réception.");
                    int bytesRec = sender.Receive(bytes);
                    Debug("Bytes reçues : " + bytesRec);
                    Debug("Reception d'un message... Désérilalization.");
                    Message reponse = Message.GetMessageFromByteArray(bytes);
                    Debug("Reception d'un message... Désérilalization terminée.");
                    // Release the socket.
                    sender.Shutdown(SocketShutdown.Both);
                    sender.Close();
                    return reponse;
                }
                catch (ArgumentNullException ane)
                {
                    Console.WriteLine("ArgumentNullException : " + ane.ToString());
                    System.Windows.MessageBox.Show("ArgumentNullException : " + ane.ToString());
                    msg.Statut = false;
                    return msg;
                }
                catch (SocketException se)
                {
                    Console.WriteLine("SocketException : {0}", se.ToString());
                    System.Windows.MessageBox.Show("SocketException : " + se.ToString());
                    msg.Statut = false;
                    return msg;
                }
                catch (Exception e)
                {
                    Console.WriteLine("Unexpected exception : {0}", e.ToString());
                    System.Windows.MessageBox.Show("Unexpected exception : " + e.ToString());
                    msg.Statut = false;
                    return msg;
                }

            }
            catch (Exception e)
            {
                Console.WriteLine(e.ToString());
                System.Windows.MessageBox.Show(e.ToString());
                msg.Statut = false;
                return msg;
            }
        }
        private void DeleteButton_Click(object sender, RoutedEventArgs e)
        {
            switch (this.type)
            {
                case CT_Get_Questionnaire.QuestionnaireType.Jeu:
                    QuestionJeu questionJ = ((QuestionJeu)this.QuestionListBox.SelectedItem);

                    Message msgJ = new Message();

                    msgJ.Data[0] = CT_Get_Questionnaire.QuestionnaireType.Jeu;
                    msgJ.Data[1] = questionJ;

                    new CT_Del_Question().Exec(msgJ);

                    break;
                case CT_Get_Questionnaire.QuestionnaireType.Orientation:
                    QuestionOrientation questionO = ((QuestionOrientation)this.QuestionListBox.SelectedItem);

                    questionO.QuestionText = this.QuestionIntituleLabel.Text;

                    Message msgO = new Message();

                    msgO.Data[0] = CT_Get_Questionnaire.QuestionnaireType.Orientation;
                    msgO.Data[1] = questionO;

                    new CT_Del_Question().Exec(msgO);

                    break;
            }
        }
        private void Button_Modif_Mail_Click(object sender, RoutedEventArgs e)
        {
            string nouv_Addr = nouv_Mail.Text;

            Message mail = new Message();

            mail.Data[0] = nouv_Addr;

            new CT_Upd_Mail().Exec(mail);
        }
Beispiel #30
0
 public CT_EnvoyerMail()
 {
     msg = new Message();
 }