EntrepotBase.cs 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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 ChaineDeConnexionAccess;
  18. public EntrepotBase()
  19. {
  20. this.ChaineDeConnexion = ConfigurationManager.AppSettings["ConnexionStringSic"];
  21. if (string.IsNullOrEmpty(this.ChaineDeConnexion))
  22. {
  23. throw new Exception("Chaine de connexion Sql Server non renseignée");
  24. }
  25. this.ChaineDeConnexionCollege = ConfigurationManager.AppSettings["ConnexionStringOracleCollege"];
  26. if (string.IsNullOrEmpty(this.ChaineDeConnexionCollege))
  27. {
  28. throw new Exception("Chaine de connexion Oracle non renseignée");
  29. }
  30. this.ChaineDeConnexionSubvention = ConfigurationManager.AppSettings["ConnexionStringOracleSubvention"];
  31. if (string.IsNullOrEmpty(this.ChaineDeConnexionSubvention))
  32. {
  33. throw new Exception("Chaine de connexion Oracle non renseignée");
  34. }
  35. this.ChaineDeConnexionRH = ConfigurationManager.AppSettings["ConnexionStringOracleRH"];
  36. if (string.IsNullOrEmpty(this.ChaineDeConnexionRH))
  37. {
  38. throw new Exception("Chaine de connexion Oracle non renseignée");
  39. }
  40. //this.ChaineDeConnexionAccess = ConfigurationManager.AppSettings["ConnexionStringAccess"];
  41. //if (string.IsNullOrEmpty(this.ChaineDeConnexionAccess))
  42. //{
  43. // throw new Exception("Chaine de connexion Access non renseignée");
  44. //}
  45. }
  46. }
  47. }