No cache version.

Caching disabled. Default setting for this page:enabled (code LNG204)
If the display is too slow, you can disable the user mode to view the cached version.

StatsForm.cs

Description du code

StatsForm.cs est un fichier du projet BiblioBrol.
Ce fichier est situé dans /var/www/bin/sniplets/bibliobrol/src/.

Projet BiblioBrol :

Gestion de media en CSharp.

Pour plus d'infos, vous pouvez consulter la brève analyse.

Code source ou contenu du fichier

  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Text;
  7. using System.Windows.Forms;
  8. using be.gaudry.bibliobrol.model.dao;
  9. using be.gaudry.bibliobrol.model;
  10. using System.Collections;
  11.  
  12. using be.gaudry.bibliobrol.view.utils;
  13. using be.gaudry.observer;
  14. using be.gaudry.view;
  15. using be.gaudry.model;
  16.  
  17. namespace be.gaudry.bibliobrol.view
  18. {
  19. public partial class StatsForm : MDIChildForm, IObserver
  20. {
  21. #region constructor and declarations
  22. private String[] charts;
  23. private Stat stat = null;
  24. private String chartTitle, columnTitle;
  25. public StatsForm()
  26. {
  27. ModelAdapter.Instance.addObserver(this);
  28. charts = new String[] {
  29. "Emprunts en cours",
  30. "Tous les emprunts",
  31. "Ouvrages par type",
  32. "Exemplaires par type",
  33. "Acteurs par rôles"
  34. };
  35. InitializeComponent();
  36. addToolStrip(statsTS);
  37. /*this.SetStyle(ControlStyles.UserPaint, true);
  38.   this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
  39.   this.SetStyle(ControlStyles.DoubleBuffer, true);
  40.   this.SetStyle(ControlStyles.ResizeRedraw, true);*/
  41. setCounters();
  42. }
  43.  
  44. private void setCounters()
  45. {
  46. Counter counter = ModelAdapter.getCounters();
  47. countersLbl.Text = String.Format(
  48. "{0} personne(s)\n\r{1} utilisateur(s)\n\r{2} ouvrage(s)\n\r{3} emprunt(s)",
  49. counter.PersonsCount,
  50. counter.UsersCount,
  51. counter.BrolCount,
  52. counter.BorrowsCount
  53. );
  54. }
  55. #endregion
  56.  
  57. #region private methods
  58. private void fillChartComboBox()
  59. {
  60. this.selectFirstChartTSCB.Items.AddRange(charts);
  61. this.selectSecondChartTSCB.Items.AddRange(charts);
  62.  
  63. this.selectFirstChartTSCB.SelectedIndex = 0;
  64. this.selectSecondChartTSCB.SelectedIndex = 1;
  65. }
  66. #endregion
  67.  
  68. #region events
  69.  
  70. private void StatsForm_Load(object sender, EventArgs e)
  71. {
  72. this.SuspendLayout();
  73. fillChartComboBox();
  74. this.ResumeLayout(false);
  75. }
  76. private void selectFirstChartTSCB_SelectedIndexChanged(object sender, EventArgs e)
  77. {
  78. //todo : fill an array with delegates according to chart array
  79. //on index changed, invoke delegate (at the same index as selected index) in a thread
  80. getInfosFromStats(selectFirstChartTSCB);
  81. chart1.setBrolChart(stat, chartTitle, columnTitle);
  82. }
  83.  
  84. private void selectSecondChartTSCB_SelectedIndexChanged(object sender, EventArgs e)
  85. {
  86. getInfosFromStats(selectSecondChartTSCB);
  87. chart2.setBrolChart(stat, chartTitle, columnTitle);
  88. }
  89.  
  90. private void getInfosFromStats(ToolStripComboBox selectChartTSCB)
  91. {
  92. switch (selectChartTSCB.SelectedIndex)
  93. {
  94. case 0:
  95. stat = ModelAdapter.getStatsCurrentBorrows();
  96. chartTitle = charts[0];
  97. columnTitle = "Emprunteur";
  98. break;
  99. case 1:
  100. stat = ModelAdapter.getStatsAllBorrows();
  101. chartTitle = charts[1];
  102. columnTitle = "Emprunteur";
  103. break;
  104. case 2:
  105. stat = ModelAdapter.getStatsBrolTypes();
  106. chartTitle = "Répartition des ouvrages par type";
  107. columnTitle = "Type";
  108. break;
  109. case 3:
  110. stat = ModelAdapter.getStatsMediaBrolTypes();
  111. chartTitle = "Répartition des exemplaires par type";
  112. columnTitle = "Type";
  113. break;
  114. case 4:
  115. stat = ModelAdapter.getStatsActorRoles();
  116. chartTitle = charts[4];
  117. columnTitle = "Rôle";
  118. break;
  119. default:
  120. chartTitle = "Graphique non défini";
  121. columnTitle = "";
  122. break;
  123. }
  124. }
  125. #endregion
  126.  
  127. #region IObserver Membres
  128.  
  129. public void update(Notification notification)
  130. {
  131. if (notification.Level.Equals(Notification.VERBOSE.modified))
  132. {
  133. EventArgs e = new EventArgs();
  134. selectFirstChartTSCB_SelectedIndexChanged(this, e);
  135. selectSecondChartTSCB_SelectedIndexChanged(this, e);
  136. }
  137. }
  138.  
  139. #endregion
  140.  
  141. private void StatsForm_Enter(object sender, EventArgs e)
  142. {
  143. this.Icon = global::be.gaudry.bibliobrol.Properties.Resources.statsIcon;
  144. }
  145. }
  146. }

Structure et Fichiers du projet

Afficher/masquer...


Répertoires contenus dans /var/www/bin/sniplets/bibliobrol/src/view/ 
IcôneNomTailleModification
IcôneNomTailleModification
| _ Répertoire parent0 octets1718884831 20/06/2024 14:00:31
| _wizards0 octets1541007184 31/10/2018 18:33:04
| _utils0 octets1541007184 31/10/2018 18:33:04
| _controls0 octets1541007178 31/10/2018 18:32:58
| _dialogs0 octets1541007183 31/10/2018 18:33:03
Fichiers contenus dans /var/www/bin/sniplets/bibliobrol/src/view/ 
IcôneNomTailleModificationAction
IcôneNomTailleModificationAction
Afficher le fichier .resx|.resxMediabrolForm.resx32.55 Ko31/10/2018 18:32:27-refusé-
Afficher le fichier .resx|.resxAWSForm.resx188.27 Ko31/10/2018 18:32:25-refusé-
Afficher le fichier .resx|.resxMainForm.resx6.07 Ko31/10/2018 18:32:27-refusé-
Afficher le fichier .resx|.resxConsoleForm.resx256.48 Ko31/10/2018 18:32:27-refusé-
Afficher le fichier .cs|.csAWSForm.Designer.cs23.45 Ko31/10/2018 18:32:25-refusé-
Afficher le fichier .cs|.csActorForm.cs9.09 Ko31/10/2018 18:32:25-refusé-
Afficher le fichier .cs|.csBiblioBrolAboutBox.Designer.cs11.22 Ko31/10/2018 18:32:25-refusé-
Afficher le fichier .cs|.csAWSForm.cs7.68 Ko31/10/2018 18:32:25-refusé-
Afficher le fichier .cs|.csBorrowsForm.cs1.66 Ko31/10/2018 18:32:25-refusé-
Afficher le fichier .cs|.csCopy of MainForm.Designer.cs16.91 Ko31/10/2018 18:32:27-refusé-
Afficher le fichier .cs|.csConsoleForm.Designer.cs2.71 Ko31/10/2018 18:32:26-refusé-
Afficher le fichier .cs|.csWebServiceForm.cs6.34 Ko31/10/2018 18:32:29-refusé-
Afficher le fichier .resx|.resxOldMainForm.resx58.06 Ko31/10/2018 18:32:28-refusé-
Afficher le fichier .cs|.csCopy of MainForm.cs30.81 Ko31/10/2018 18:32:26-refusé-
Afficher le fichier .resx|.resxActorForm.resx44.98 Ko31/10/2018 18:32:25-refusé-
Afficher le fichier .resx|.resxBorrowsForm.resx73.4 Ko31/10/2018 18:32:26-refusé-
Afficher le fichier .cs|.csMainForm.cs37.45 Ko31/10/2018 18:32:27-refusé-
Afficher le fichier .resx|.resxWebServiceForm.resx9.71 Ko31/10/2018 18:32:29-refusé-
Afficher le fichier .cs|.csMainForm.Designer.cs7.16 Ko31/10/2018 18:32:27-refusé-
Afficher le fichier .cs|.csBorrowsForm.Designer.cs10.51 Ko31/10/2018 18:32:25-refusé-
Afficher le fichier .cs|.csTasksForm.cs389 octets31/10/2018 18:32:28-refusé-
Afficher le fichier .resx|.resxBiblioBrolAboutBox.resx5.68 Ko31/10/2018 18:32:25-refusé-
Afficher le fichier .cs|.csBrolForm.cs25.87 Ko31/10/2018 18:32:26-refusé-
Afficher le fichier .cs|.csWebServiceForm.Designer.cs13.12 Ko31/10/2018 18:32:29-refusé-
Afficher le fichier .cs|.csMediabrolForm.Designer.cs142.05 Ko31/10/2018 18:32:27-refusé-
Afficher le fichier .cs|.csConsoleForm.cs2.79 Ko31/10/2018 18:32:26-refusé-
Afficher le fichier .cs|.csBrolForm.designer.cs41.73 Ko31/10/2018 18:32:26-refusé-
Afficher le fichier .cs|.csMediabrolForm.cs31.94 Ko31/10/2018 18:32:27-refusé-
Afficher le fichier .cs|.csStatsForm.Designer.cs11.59 Ko31/10/2018 18:32:28-refusé-
Afficher le fichier .cs|.csActorForm.Designer.cs28.26 Ko31/10/2018 18:32:25-refusé-
Afficher le fichier .cs|.csOldMainForm.Designer.cs83.98 Ko31/10/2018 18:32:28-refusé-
Afficher le fichier .cs|.csStatsForm.cs5 Ko31/10/2018 18:32:28-refusé-
Afficher le fichier .cs|.csBiblioBrolAboutBox.cs5.51 Ko31/10/2018 18:32:25-refusé-
Afficher le fichier .cs|.csOldMainForm.cs27.08 Ko31/10/2018 18:32:27-refusé-
Afficher le fichier .resx|.resxTasksForm.resx187.31 Ko31/10/2018 18:32:29-refusé-
Afficher le fichier .cs|.csTasksForm.Designer.cs2.26 Ko31/10/2018 18:32:28-refusé-
Afficher le fichier .resx|.resxBrolForm.resx45.52 Ko31/10/2018 18:32:26-refusé-
Afficher le fichier .resx|.resxCopy of MainForm.resx7.53 Ko31/10/2018 18:32:27-refusé-
Afficher le fichier .resx|.resxStatsForm.resx187.5 Ko31/10/2018 18:32:28-refusé-

Utilisation de l'explorateur de code

  • Navigation :
    • Un clic sur une icône de répertoire ouvre ce répertoire pour en afficher les fichiers.
    • Lorsque le répertoire en cours ne contient pas de sous-répertoires il est possible de remonter vers le répertoire parent.
    • La structure de répertoires en treetable (tableau en forme d'arborescence) n'est plus possibledans cette version.
    • Un clic sur une icône de fichier ouvre ce fichier pour en afficher le code avec la coloration syntaxique adaptée en fonction du langage principal utilisé dans le fichier.
  • Affichage :
    • Il est possible de trier les répertoires ou les fichiers selon certains critères (nom, taille, date).
  • Actions :
    • Les actions possible sur les fichiers dépendent de vos droits d'utilisateur sur le site. Veuillez activer le mode utilisateur pour activer les actions.

English translation

You have asked to visit this site in English. For now, only the interface is translated, but not all the content yet.

If you want to help me in translations, your contribution is welcome. All you need to do is register on the site, and send me a message asking me to add you to the group of translators, which will give you the opportunity to translate the pages you want. A link at the bottom of each translated page indicates that you are the translator, and has a link to your profile.

Thank you in advance.

Document created the 16/10/2009, last modified the 26/10/2018
Source of the printed document:https://www.gaudry.be/en/cs-bibliobrol-source-rf-view//StatsForm.cs.html

The infobrol is a personal site whose content is my sole responsibility. The text is available under CreativeCommons license (BY-NC-SA). More info on the terms of use and the author.