Пример #1
0
        public form1(choix_etiquette menu_etiquette, Button_menu bouton_menu)
        {
            InitializeComponent();

            timer2.Interval = 1000; // specify interval time as you want
            timer2.Start();

            button_menu = bouton_menu;
            Delete_first();

            this.Width  = Screen.PrimaryScreen.WorkingArea.Right - Button_menu.button_menu_width;
            this.Height = Screen.PrimaryScreen.WorkingArea.Bottom;

            this.Location = new Point(Screen.PrimaryScreen.WorkingArea.Right, 0);
            tags          = Tags.Charger();
            etiquettes    = menu_etiquette;

            sa           = new string[tags.SA.Count][];
            performance  = new string[tags.Performance.Count][];
            comportement = new string[tags.Comportement.Count][];
            securite     = new string[tags.Securite.Count][];
            creation_tableau();
            affichage_boutons();
        }
Пример #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("Confirmer les informations ?", "Confirmer", MessageBoxButtons.YesNo) == DialogResult.Yes)
            {
                DateTime now      = DateTime.Now;
                DateTime time_GMT = DateTime.Now.ToUniversalTime();

                chemin = "Analyse du " + time_GMT.ToString("dd-MM-yyyy à HH") + "h " + time_GMT.ToString("mm") + "m " + time_GMT.ToString("ss") + "s";

                StreamWriter info = new StreamWriter("Informations sur l'analyse.txt");
                info.WriteLine("Obervateur : " + Organisateur_textbox.Text);
                info.WriteLine("");
                info.WriteLine("Participant");
                info.WriteLine("Nom : " + Participant_nom.Text);
                info.WriteLine("Spécialité : " + Participant_specialite.Text);
                info.WriteLine("Qualification : " + Participant_qualification.Text);
                info.WriteLine("Ancienneté : " + Participant_anciennete.Text);
                info.WriteLine("");
                info.WriteLine("Date PC : " + now.ToString("dd-MM-yyyy HH:mm:ss"));
                info.WriteLine("Date GMT : " + time_GMT.ToString("dd-MM-yyyy HH:mm:ss"));
                info.WriteLine("");
                info.WriteLine("Contexte : " + Contexte_textbox.Text);
                info.Close();

                System.IO.Directory.CreateDirectory(chemin);

                file_name = titre_textbox.Text;

                XmlTextWriter xmlWriter = new XmlTextWriter(titre_textbox.Text + ".xml", Encoding.UTF8);
                xmlWriter.Formatting = Formatting.Indented;

                xmlWriter.WriteStartDocument();
                xmlWriter.WriteStartElement("Analyse");


                xmlWriter.WriteStartElement("Observateur");
                xmlWriter.WriteAttributeString("Nom", Organisateur_textbox.Text);
                xmlWriter.WriteEndElement();

                xmlWriter.WriteStartElement("Participant");
                xmlWriter.WriteStartElement("Nom");
                xmlWriter.WriteString(Participant_nom.Text);
                xmlWriter.WriteEndElement();

                xmlWriter.WriteStartElement("Specialite");
                xmlWriter.WriteString(Participant_specialite.Text);
                xmlWriter.WriteEndElement();

                xmlWriter.WriteStartElement("Qualification");
                xmlWriter.WriteString(Participant_qualification.Text);
                xmlWriter.WriteEndElement();

                xmlWriter.WriteStartElement("Anciennete");
                xmlWriter.WriteString(Participant_anciennete.Text);
                xmlWriter.WriteEndElement();
                xmlWriter.WriteEndElement();

                xmlWriter.WriteStartElement("Date");
                xmlWriter.WriteString(time_GMT.ToString("yyyy-MM-dd"));
                xmlWriter.WriteEndElement();

                xmlWriter.WriteStartElement("Contexte");
                xmlWriter.WriteString(Contexte_textbox.Text);
                xmlWriter.WriteEndElement();

                xmlWriter.WriteStartElement("Tags");
                xmlWriter.WriteStartElement("Tag");
                xmlWriter.WriteStartElement("Heure");
                xmlWriter.WriteString("Null");
                xmlWriter.WriteEndElement();

                xmlWriter.WriteStartElement("Duree");
                xmlWriter.WriteString("Null");
                xmlWriter.WriteEndElement();

                xmlWriter.WriteStartElement("Carte");
                xmlWriter.WriteAttributeString("Categorie", "Null");
                xmlWriter.WriteAttributeString("Titre", "Null");
                xmlWriter.WriteAttributeString("Type", "Null");
                xmlWriter.WriteStartElement("Commentaire");
                xmlWriter.WriteString("Null");
                xmlWriter.WriteEndElement();
                xmlWriter.WriteEndElement();
                xmlWriter.WriteEndElement();
                xmlWriter.WriteEndElement();
                xmlWriter.WriteEndElement();

                xmlWriter.WriteEndDocument();
                xmlWriter.Close();

                File.Move("Informations sur l'analyse.txt", chemin + "\\Informations sur l'analyse.txt");

                Button_menu button_menu = new Button_menu();
                button_menu.Show();
                this.Hide();
            }

            else
            {
            }
        }