示例#1
0
        public List <Agence> find_agence()
        {
            this.agences = new List <Agence>();
            Dictionary <string, string> id = new Dictionary <string, string>();

            id["NumeroDRE"] = "" + this.NumeroDRE;

            Agence agence = new Agence();

            agence.connect();
            SqlDataReader result = agence.select(id);

            while (result.Read())
            {
                this.agences.Add(new Agence(
                                     result.GetInt32(0),
                                     result.GetString(1),
                                     this,
                                     result.GetString(3),
                                     result.GetString(4)
                                     ));
            }
            agence.disconnect();
            return(this.agences);
        }
        public Agence find_by_id(Dictionary <string, string> data)
        {
            Agence agence;
            Dictionary <string, string> id = new Dictionary <string, string>();

            this.Dre = new DRE();


            this.connect();
            SqlDataReader result = this.select();

            while (result.Read())
            {
                id[NumeroDREColmn] = "" + result.GetInt32(2);
                this.Dre           = this.Dre.find_by_id(id);

                agence = new Agence(
                    result.GetInt32(0),
                    result.GetString(1),
                    this.Dre,
                    result.GetString(3),
                    result.GetString(4)
                    );
                this.disconnect();
                return(agence);
            }
            return(null);
        }
        public new List <EmployeAgence> find_all()
        {
            List <EmployeAgence>        employeAgences = new List <EmployeAgence>();
            Dictionary <string, string> id             = new Dictionary <string, string>();
            Dictionary <string, string> id2            = new Dictionary <string, string>();

            Utilisateur utilisateur = new Utilisateur();

            this.agence = new Agence();


            this.connect();
            SqlDataReader result = this.select();

            while (result.Read())
            {
                id2["IdUser"] = "" + result.GetInt32(0);
                utilisateur   = utilisateur.find_by_id(id2);

                id["NumeroAgence"] = "" + result.GetInt32(1);
                this.agence        = this.agence.find_by_id(id);

                employeAgences.Add(new EmployeAgence(
                                       utilisateur,
                                       this.agence
                                       ));
            }
            this.disconnect();
            return(employeAgences);
        }
        public new EmployeAgence find_by_id(Dictionary <string, string> data)
        {
            EmployeAgence employeAgence;
            Dictionary <string, string> id  = new Dictionary <string, string>();
            Dictionary <string, string> id2 = new Dictionary <string, string>();

            Utilisateur utilisateur = new Utilisateur();

            this.agence = new Agence();


            this.connect();
            SqlDataReader result = this.select(data);

            while (result.Read())
            {
                id2[IdUserColmn] = "" + result.GetInt32(0);
                utilisateur      = utilisateur.find_by_id(id2);

                id[NumeroAgenceColmn] = "" + result.GetInt32(1);
                this.agence           = this.agence.find_by_id(id);

                employeAgence = new EmployeAgence(
                    utilisateur,
                    this.agence
                    );
                this.disconnect();
                return(employeAgence);
            }
            return(null);
        }
        // Constructeur 3 :
        public EmployeAgence(Utilisateur utilisateur, Agence _agence)
        {
            this.table = "EmployeAgence";

            this.IdUser   = utilisateur.IdUser;
            this.Login    = utilisateur.Login;
            this.Password = utilisateur.Password;
            this.EtatUser = utilisateur.EtatUser;
            this.Nom      = utilisateur.Nom;
            this.Prenom   = utilisateur.Prenom;
            this.Email    = utilisateur.Email;
            this.Phone    = utilisateur.Phone;
            this.EtatUser = utilisateur.EtatUser;
            this.agence   = _agence;
        }
 public allobjet()
 {
     agence           = new Agence();
     dre              = new DRE();
     categorie        = new Categorie();
     ticket           = new Ticket();
     probleme         = new Probleme();
     user             = new Utilisateur();
     techhelp         = new TechnicienHelpDesk();
     techdre          = new TechnicienDre();
     direction        = new Direction();
     employer         = new EmployeAgence();
     stat             = new Statistic();
     ticket_his       = new Ticket_Historique();
     solution         = new Solution();
     super            = new Superviseur();
     StatByTicket     = new StatByTicket();
     StatByTechnicien = new StatByTechnicien();
     StatByProbleme   = new StatByProbleme();
     day              = null;
     month            = null;
     year             = null;
 }