ServiceFiche.cs 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4. using System.ComponentModel;
  5. using CG67.FicheCollege.Domaine;
  6. using CG67.FicheCollege.Entrepot;
  7. using CG67.FicheCollege.Interface;
  8. namespace CG67.FicheCollege.Service
  9. {
  10. /// <summary>
  11. /// Une méthode est déclarée pour chaque Entrepot, ceci permet l'appel en static depuis n'importe où
  12. /// y compris depuis une page ASP.
  13. /// </summary>
  14. [DataObject]
  15. public static class ServiceFiche
  16. {
  17. public static IList<ActionEducative> GetActionEducativeByRNEAndAnnee(string codeRNE, int annee)
  18. {
  19. try
  20. {
  21. return EntrepotFactory.GetEntrepotActionEducative().GetByCodeRNEAndAnnee(codeRNE, annee);
  22. }
  23. catch (Exception erreur)
  24. {
  25. throw new Exception(erreur.ToString());
  26. }
  27. }
  28. public static IList<ATC> GetATCByRNE(string codeRNE)
  29. {
  30. try
  31. {
  32. return EntrepotFactory.GetEntrepotATC().GetByCodeRNE(codeRNE);
  33. }
  34. catch (Exception erreur)
  35. {
  36. throw new Exception(erreur.ToString());
  37. }
  38. }
  39. public static Bilinguisme GetBilinguismeByRNEAndAnnee(string codeRNE, int annee)
  40. {
  41. try
  42. {
  43. return EntrepotFactory.GetEntrepotBilinguisme().GetByCodeRNEAndAnnee(codeRNE, annee);
  44. }
  45. catch (Exception erreur)
  46. {
  47. throw new Exception(erreur.ToString());
  48. }
  49. }
  50. public static Dotation GetDotationByRNEAndAnnee(string codeRNE, int annee)
  51. {
  52. try
  53. {
  54. return EntrepotFactory.GetEntrepotDotation().GetByCodeRNEAndAnnee(codeRNE, annee);
  55. }
  56. catch (Exception erreur)
  57. {
  58. throw new Exception(erreur.ToString());
  59. }
  60. }
  61. public static IList<Equipement> GetEquipementByRNEAndAnnee(string codeRNE, int annee)
  62. {
  63. try
  64. {
  65. return EntrepotFactory.GetEntrepotEquipement().GetByCodeRNEAndAnnee(codeRNE, annee);
  66. }
  67. catch (Exception erreur)
  68. {
  69. throw new Exception(erreur.ToString());
  70. }
  71. }
  72. public static IList<Investissement> GetInvestissementByRNEAndAnnee(string codeRNE, int annee)
  73. {
  74. try
  75. {
  76. return EntrepotFactory.GetEntrepotInvestissement().GetByCodeRNEAndAnnee(codeRNE, annee);
  77. }
  78. catch (Exception erreur)
  79. {
  80. throw new Exception(erreur.ToString());
  81. }
  82. }
  83. public static Logement GetLogementByRNE(string codeRNE)
  84. {
  85. try
  86. {
  87. return EntrepotFactory.GetEntrepotLogement().GetByCodeRNE(codeRNE);
  88. }
  89. catch (Exception erreur)
  90. {
  91. throw new Exception(erreur.ToString());
  92. }
  93. }
  94. public static MCG GetMCGByRNE(string codeRNE)
  95. {
  96. try
  97. {
  98. return EntrepotFactory.GetEntrepotMCG().GetByCodeRNE(codeRNE);
  99. }
  100. catch (Exception erreur)
  101. {
  102. throw new Exception(erreur.ToString());
  103. }
  104. }
  105. public static IList<ProjetPilote> GetProjetPiloteByRNEAndAnnee(string codeRNE, int annee)
  106. {
  107. try
  108. {
  109. return EntrepotFactory.GetEntrepotProjetPilote().GetByCodeRNEAndAnnee(codeRNE, annee);
  110. }
  111. catch (Exception erreur)
  112. {
  113. throw new Exception(erreur.ToString());
  114. }
  115. }
  116. public static IList<RestaurationExterne> GetRestaurationExterneByRNEAndAnnee(string codeRNE, int annee)
  117. {
  118. try
  119. {
  120. return EntrepotFactory.GetEntrepotRestaurationExterne().GetByCodeRNEAndAnnee(codeRNE, annee);
  121. }
  122. catch (Exception erreur)
  123. {
  124. throw new Exception(erreur.ToString());
  125. }
  126. }
  127. public static IList<Contact> GetContactByRNE(string codeRNE)
  128. {
  129. try
  130. {
  131. return EntrepotFactory.GetEntrepotContact().GetByCodeRNE(codeRNE);
  132. }
  133. catch (Exception erreur)
  134. {
  135. throw new Exception(erreur.ToString());
  136. }
  137. }
  138. public static ChiffresSignificatifs GetChiffresSignificatifsByAnnee(int annee)
  139. {
  140. try
  141. {
  142. return EntrepotFactory.GetEntrepotChiffresSignificatifs().GetByAnnee(annee);
  143. }
  144. catch (Exception erreur)
  145. {
  146. throw new Exception(erreur.ToString());
  147. }
  148. }
  149. public static Commentaires GetCommentairesByCodeRNE(string codeRNE, int annee)
  150. {
  151. try
  152. {
  153. return EntrepotFactory.GetEntrepotCommentaires().GetByCodeRNEAndAnnee(codeRNE, annee);
  154. }
  155. catch
  156. {
  157. throw;
  158. }
  159. }
  160. public static Restauration GetRestaurationByCodeRNEAndAnnee(string codeRNE, int annee)
  161. {
  162. try
  163. {
  164. return EntrepotFactory.GetEntrepotRestauration().GetByRNEAndAnnee(codeRNE, annee);
  165. }
  166. catch
  167. {
  168. throw;
  169. }
  170. }
  171. public static IList<ProgTravaux> GetProgTravauxByCodeRNEAndAnnee(string codeRNE, int annee)
  172. {
  173. try
  174. {
  175. return EntrepotFactory.GetEntrepotProgTravaux().GetByCodeRNEAndAnnee(codeRNE, annee);
  176. }
  177. catch
  178. {
  179. throw;
  180. }
  181. }
  182. public static IList<Etablissement> GetAllEtablissement()
  183. {
  184. try
  185. {
  186. return EntrepotFactory.GetEntrepotEtablissement().GetAll();
  187. }
  188. catch
  189. {
  190. throw;
  191. }
  192. }
  193. public static Etablissement GetEtablissementByCodeRNEAndAnnee(string codeRNE, int annee)
  194. {
  195. try
  196. {
  197. return EntrepotFactory.GetEntrepotEtablissement().GetByCodeRNEAndAnnee(codeRNE, annee);
  198. }
  199. catch
  200. {
  201. throw;
  202. }
  203. }
  204. }
  205. }