Esempio n. 1
0
        private string CalculerChaineAImprimer()
        {
            string impression = EnteteDocument();

            foreach (Theme theme in themes)
            {
                List <Emprunt>           empruntsTheme    = ((List <Emprunt>)emprunts).FindAll(emp => emp.Exemplaire.Livre.Theme.Equals(theme));
                IList <Livre>            livres           = Livre.Obtenir(theme);
                IDictionary <Livre, int> empruntsParLivre = new Dictionary <Livre, int>();

                foreach (Livre livre in livres)
                {
                    empruntsParLivre[livre] = empruntsTheme.Count(emp => emp.Exemplaire.Livre.Equals(livre));
                }

                //impression += $"\n\r\n\r{theme.Libelle} ({empruntsTheme.Count}) : \n\r";
                //impression += FormatterLigne(theme.Libelle, empruntsTheme.Count.ToString());
                impression += $"\n\r\n\r\n\r\n\r{theme.Libelle}({empruntsTheme.Count.ToString()})\n\r\n\r";
                foreach (Livre livre in empruntsParLivre.Keys)
                {
                    //string titre = Utilitaires.EgaliserLongeur(livre.Titre, 30);
                    impression += $"{livre.Titre} ({empruntsParLivre[livre]})\n\r\n\r";
                    //impression += FormatterLigne(livre.Titre, empruntsParLivre[livre].ToString());
                }
            }
            return(impression);
        }
Esempio n. 2
0
 private void btnIsbnOk_Click(object sender, EventArgs e)
 {
     if ((livre = Livre.Obtenir(txtIsbn.Text)) == null)
     {
         MessageBox.Show("Livre non trouvé !");
     }
     else
     {
         new LivreIhm(livre).ShowDialog();
     }
 }
Esempio n. 3
0
        private void dataGridView_RowHeaderMouseClick(object sender, DataGridViewCellMouseEventArgs e)
        {
            Theme theme = dataGridView.Rows[e.RowIndex].DataBoundItem as Theme;

            new ListeLivresIhm(Livre.Obtenir(theme)).ShowDialog();
        }