Пример #1
0
        private void LB_Activité_SelectedIndexChanged(object sender, EventArgs e)
        {
            ClassIntervenant interv = new ClassIntervenant();
            int j = LB_Activité.SelectedIndex + 1;

            foreach (KeyValuePair <int, Activite> actrechercher in dico)
            {
                if (actrechercher.Key == j)
                {
                    TB_DetailTitre.Text = actrechercher.Value.Libelle;
                    TB_DetailType.Text  = type.getLibelleType(actrechercher.Value.IdType);
                    interv = getIntervenant(actrechercher.Value.Id);
                    if (interv != null)
                    {
                        TB_DetailIntervenant.Text = interv.Nom + " " + interv.Prenom;
                    }
                    else
                    {
                        TB_DetailIntervenant.Text = "aucun intervenant";
                    }
                    TB_DetailDate.Text         = actrechercher.Value.Heuredebut.ToLongDateString();
                    TB_DetailHeureDebut.Text   = actrechercher.Value.Heuredebut.ToShortTimeString();
                    TB_DetailHeureFin.Text     = actrechercher.Value.Heurefin.ToShortTimeString();
                    TB_DetailPlace.Text        = actrechercher.Value.Nombreplaces.ToString();
                    TB_DetailSalle.Text        = actrechercher.Value.Salle;
                    RTB_DetailDescription.Text = actrechercher.Value.Description;
                }
            }
        }
Пример #2
0
 private void Btn_Intervenant_Click(object sender, EventArgs e)
 {
     Form1 = new AjouterIntervenant();
     Form1.ShowDialog();
     chargerIntervenant("");
     Interv = lesIntervenants.Last();
     comboBoxIntervenant.Text = Interv.Nom + " " + Interv.Prenom;
 }
Пример #3
0
        public AjouterIntervenant(int idInterv, string n, string p, string pro, bool ext)
        {
            idIntervenant = idInterv;

            InitializeComponent();
            Interv = new ClassIntervenant();

            TB_NOM.Text       = n;
            TB_Prenom.Text    = p;
            TB_Professon.Text = pro;
            if (ext == true)
            {
                checkBox1.Checked = true;
            }
        }
Пример #4
0
        public void chargerIntervenant(string nomPrenom)
        {
            DicoIntervenant = new Dictionary <int, ClassIntervenant>();
            comboBoxIntervenant.Items.Clear();
            Interv          = new ClassIntervenant();
            lesIntervenants = new List <ClassIntervenant>();
            lesIntervenants = Interv.InitIntervenant();
            int i = 0;

            foreach (ClassIntervenant c in lesIntervenants)
            {
                if (nomPrenom == "" || c.Nom.StartsWith(nomPrenom) || c.Prenom.StartsWith(nomPrenom))
                {
                    comboBoxIntervenant.Items.Add(c.Nom + " " + c.Prenom);
                    DicoIntervenant.Add(i, c);
                    i++;
                }
            }
        }
Пример #5
0
        private void creerPDFlistesintervenants()
        {
            ClassIntervenant lintervenant = new ClassIntervenant();
            Dictionary <int, ClassIntervenant> lesIntervenants = lintervenant.InitIntervenantdateheure();

            try
            {
                Document  doc         = new Document();
                PdfWriter listeIntPDF = PdfWriter.GetInstance(doc, new FileStream(Properties.Settings.Default["savePDFLocal"] + "listeintervenant.pdf", FileMode.Create, FileAccess.Write));
                doc.Open();
                Paragraph paragraph = new Paragraph();
                Phrase    titre     = new Phrase("Listes des intervenants de Joach Autrement", FontFactory.GetFont(FontFactory.COURIER, 20));
                paragraph.Add(titre);
                doc.Add(paragraph);

                /*
                 * Paragraph p = new Paragraph();
                 * Phrase espace = new Phrase("Bravo vous avez trouvé une ligne cachée", FontFactory.GetFont(FontFactory.COURIER, 20, BaseColor.WHITE));
                 * p.Add(espace);
                 * doc.Add(p);
                 * */

                PdfPTable tableauintervenant = new PdfPTable(6);
                tableauintervenant.HorizontalAlignment = 0;
                tableauintervenant.TotalWidth          = 500f;
                tableauintervenant.LockedWidth         = true;
                float[] widths = new float[] { 80f, 80f, 100f, 80f, 40f, 40f };
                tableauintervenant.SetWidths(widths);
                tableauintervenant.SpacingBefore = 15;

                foreach (KeyValuePair <int, ClassIntervenant> inter in lesIntervenants)
                {
                    PdfPCell infoNom = new PdfPCell(new Phrase(inter.Value.Nom));
                    infoNom.BorderWidth    = 0;
                    infoNom.BorderWidthTop = 1;
                    PdfPCell infoPrenom = new PdfPCell(new Phrase(inter.Value.Prenom));
                    infoPrenom.BorderWidth    = 0;
                    infoPrenom.BorderWidthTop = 1;
                    PdfPCell infoprofession = new PdfPCell(new Phrase(inter.Value.Profession));
                    infoprofession.BorderWidth    = 0;
                    infoprofession.BorderWidthTop = 1;
                    tableauintervenant.AddCell(infoNom);
                    tableauintervenant.AddCell(infoPrenom);
                    tableauintervenant.AddCell(infoprofession);
                    PdfPCell infodate = new PdfPCell(new Phrase(inter.Value.Heuredebut[0].ToShortDateString()));
                    infodate.BorderWidth    = 0;
                    infodate.BorderWidthTop = 1;
                    PdfPCell infoheuredebut = new PdfPCell(new Phrase(inter.Value.Heuredebut[0].ToShortTimeString()));
                    infoheuredebut.BorderWidth    = 0;
                    infoheuredebut.BorderWidthTop = 1;
                    PdfPCell infoheurefin = new PdfPCell(new Phrase(inter.Value.Heurefin[0].ToShortTimeString()));
                    infoheurefin.BorderWidth    = 0;
                    infoheurefin.BorderWidthTop = 1;
                    tableauintervenant.AddCell(infodate);
                    tableauintervenant.AddCell(infoheuredebut);
                    tableauintervenant.AddCell(infoheurefin);
                    if (inter.Value.Heuredebut.Count > 1)
                    {
                        for (int i = 1; i < inter.Value.Heuredebut.Count; i++)
                        {
                            PdfPCell trou1 = new PdfPCell(); //Permet de faire la mise en page pour afficher les heures supplémentaires en dessous des autres
                            trou1.BorderWidth = 0;
                            PdfPCell trou2 = new PdfPCell();
                            trou2.BorderWidth = 0;
                            PdfPCell trou3 = new PdfPCell();
                            trou3.BorderWidth = 0;
                            PdfPCell infoextradate = new PdfPCell(new Phrase(inter.Value.Heuredebut[i].ToShortDateString()));
                            infoextradate.BorderWidth = 0;
                            PdfPCell infoextraheuredebut = new PdfPCell(new Phrase(inter.Value.Heuredebut[i].ToShortTimeString()));
                            infoextraheuredebut.BorderWidth = 0;
                            PdfPCell infoextraheurefin = new PdfPCell(new Phrase(inter.Value.Heurefin[i].ToShortTimeString()));
                            infoextraheurefin.BorderWidth = 0;
                            tableauintervenant.AddCell(trou1);
                            tableauintervenant.AddCell(trou2);
                            tableauintervenant.AddCell(trou3);
                            tableauintervenant.AddCell(infoextradate);
                            tableauintervenant.AddCell(infoextraheuredebut);
                            tableauintervenant.AddCell(infoextraheurefin);
                        }
                    }
                }
                doc.Add(tableauintervenant);
                doc.Close();
            }
            catch (System.IO.IOException err)// gestion des erreurs
            {
                MessageBox.Show("Erreur pdf: " + err, "PBS connection", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Пример #6
0
        int idIntervenant = 0;   // l'id de l'intervenant passé en parametre d'il sagit d'un modification

        public AjouterIntervenant()
        {
            InitializeComponent();
            Interv = new ClassIntervenant();
        }