EntrepotBase.cs 3.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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 CheminDeFichier;
  19. protected string Utilisateur;
  20. protected string MotDePasse;
  21. protected string NomDeDomaine;
  22. // protected string ChaineDeConnexionAccess;
  23. public EntrepotBase()
  24. {
  25. this.ChaineDeConnexion = ConfigurationManager.AppSettings["ConnexionStringSic"];
  26. if (string.IsNullOrEmpty(this.ChaineDeConnexion))
  27. {
  28. throw new Exception("Chaine de connexion Sql Server non renseignée");
  29. }
  30. // this.ChaineDeConnexionCollege = ConfigurationManager.AppSettings["ConnexionStringOracleCollege"];
  31. // if (string.IsNullOrEmpty(this.ChaineDeConnexionCollege))
  32. // {
  33. // throw new Exception("Chaine de connexion Oracle non renseignée");
  34. // }
  35. this.ChaineDeConnexionSubvention = ConfigurationManager.AppSettings["ConnexionStringOracleSubvention"];
  36. if (string.IsNullOrEmpty(this.ChaineDeConnexionSubvention))
  37. {
  38. throw new Exception("Chaine de connexion Oracle non renseignée");
  39. }
  40. this.ChaineDeConnexionAstreGF = ConfigurationManager.AppSettings["ConnexionStringOracleAstreGF"];
  41. if (string.IsNullOrEmpty(this.ChaineDeConnexionAstreGF))
  42. {
  43. throw new Exception("Chaine de connexion Oracle non renseignée");
  44. }
  45. this.ChaineDeConnexionRH = ConfigurationManager.AppSettings["ConnexionStringOracleRH"];
  46. if (string.IsNullOrEmpty(this.ChaineDeConnexionRH))
  47. {
  48. throw new Exception("Chaine de connexion Oracle non renseignée");
  49. }
  50. this.CheminDeFichier = ConfigurationManager.AppSettings["FileRepository"];
  51. if (string.IsNullOrEmpty(this.CheminDeFichier))
  52. {
  53. throw new Exception("Chemin d'accès aux fichiers non renseigné");
  54. }
  55. this.Utilisateur = ConfigurationManager.AppSettings["ImpersonationUser"];
  56. if (string.IsNullOrEmpty(this.Utilisateur))
  57. {
  58. throw new Exception("Nom Utilisateur non renseigné");
  59. }
  60. this.MotDePasse = ConfigurationManager.AppSettings["ImpersonationPassword"];
  61. if (string.IsNullOrEmpty(this.MotDePasse))
  62. {
  63. throw new Exception("Mot de passe non renseigné");
  64. }
  65. this.NomDeDomaine = ConfigurationManager.AppSettings["ImpersonationDomain"];
  66. if (string.IsNullOrEmpty(this.NomDeDomaine))
  67. {
  68. throw new Exception("Nom de domaine non renseigné");
  69. }
  70. //this.ChaineDeConnexionAccess = ConfigurationManager.AppSettings["ConnexionStringAccess"];
  71. //if (string.IsNullOrEmpty(this.ChaineDeConnexionAccess))
  72. //{
  73. // throw new Exception("Chaine de connexion Access non renseignée");
  74. //}
  75. }
  76. }
  77. }