EntrepotBase.cs 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4. using System.Configuration;
  5. using System.Data;
  6. using System.Data.SqlClient;
  7. using System.Data.OracleClient;
  8. using CG67.FicheCollege.Domaine;
  9. namespace CG67.FicheCollege.Entrepot
  10. {
  11. public class EntrepotBase
  12. {
  13. protected string ChaineDeConnexion;
  14. protected string ChaineDeConnexionCollege;
  15. protected string ChaineDeConnexionSubvention;
  16. protected string ChaineDeConnexionRH;
  17. protected string ChaineDeConnexionAstreGF;
  18. // protected string ChaineDeConnexionAccess;
  19. public EntrepotBase()
  20. {
  21. this.ChaineDeConnexion = ConfigurationManager.AppSettings["ConnexionStringSic"];
  22. if (string.IsNullOrEmpty(this.ChaineDeConnexion))
  23. {
  24. throw new Exception("Chaine de connexion Sql Server non renseignée");
  25. }
  26. this.ChaineDeConnexionCollege = ConfigurationManager.AppSettings["ConnexionStringOracleCollege"];
  27. if (string.IsNullOrEmpty(this.ChaineDeConnexionCollege))
  28. {
  29. throw new Exception("Chaine de connexion Oracle non renseignée");
  30. }
  31. this.ChaineDeConnexionSubvention = ConfigurationManager.AppSettings["ConnexionStringOracleSubvention"];
  32. if (string.IsNullOrEmpty(this.ChaineDeConnexionSubvention))
  33. {
  34. throw new Exception("Chaine de connexion Oracle non renseignée");
  35. }
  36. this.ChaineDeConnexionAstreGF = ConfigurationManager.AppSettings["ConnexionStringOracleAstreGF"];
  37. if (string.IsNullOrEmpty(this.ChaineDeConnexionAstreGF))
  38. {
  39. throw new Exception("Chaine de connexion Oracle non renseignée");
  40. }
  41. this.ChaineDeConnexionRH = ConfigurationManager.AppSettings["ConnexionStringOracleRH"];
  42. if (string.IsNullOrEmpty(this.ChaineDeConnexionRH))
  43. {
  44. throw new Exception("Chaine de connexion Oracle non renseignée");
  45. }
  46. //this.ChaineDeConnexionAccess = ConfigurationManager.AppSettings["ConnexionStringAccess"];
  47. //if (string.IsNullOrEmpty(this.ChaineDeConnexionAccess))
  48. //{
  49. // throw new Exception("Chaine de connexion Access non renseignée");
  50. //}
  51. }
  52. }
  53. }