Ejemplo n.º 1
0
        public Probleme find_by_id(Dictionary <string, string> data)
        {
            Probleme probleme;
            Dictionary <string, string> id = new Dictionary <string, string>();

            this.categorie = new Categorie();

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

            while (result.Read())
            {
                id["IdCategorie"] = "" + result.GetInt32(3);
                this.categorie    = this.categorie.find_by_id(id);

                probleme = new Probleme(
                    result.GetInt32(0),
                    result.GetString(1),
                    result.GetString(2),
                    this.categorie

                    );
                this.disconnect();
                return(probleme);
            }
            return(null);
        }
        public List <Solution> find_all()
        {
            List <Solution>             solutions = new List <Solution>();
            Dictionary <string, string> id        = new Dictionary <string, string>();

            this.probleme = new Probleme();

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

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

                solutions.Add(new Solution(
                                  result.GetInt32(0),
                                  result.GetString(1),
                                  this.probleme
                                  ));
            }
            this.disconnect();

            return(solutions);
        }
        public Solution find_by_id(Dictionary <string, string> data)
        {
            Solution solution;
            Dictionary <string, string> id  = new Dictionary <string, string>();
            Dictionary <string, string> id2 = new Dictionary <string, string>();

            this.probleme = new Probleme();

            this.connect();
            id2[IdSolutionColmn] = "" + this.IdSolution;
            SqlDataReader result = this.select(id2);

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

                solution = new Solution(
                    result.GetInt32(0),
                    result.GetString(1),
                    this.probleme
                    );
                this.disconnect();

                return(solution);
            }
            return(null);
        }
        public List <StatByProbleme> find_all(String dat)
        {
            Probleme p = new Probleme();


            Dictionary <string, string> id2 = new Dictionary <string, string>();
            Dictionary <string, string> id3 = new Dictionary <string, string>();

            List <StatByProbleme> stat = new List <StatByProbleme>();

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

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



                stat.Add(new StatByProbleme(
                             p,
                             result.GetInt32(1)
                             ));
            }
            return(stat);
        }
        // Constructeur 2:
        public Solution(int idSolution, string descriptionSolution, Probleme probleme)
        {
            this.table = "Solution";

            this.IdSolution  = idSolution;
            this.Description = descriptionSolution;
            this.probleme    = probleme;
        }
Ejemplo n.º 6
0
        public void save(Probleme probleme)
        {
            this.connect();
            this.table = "[dbo].[Ticket_Probleme]";
            Dictionary <string, string> data = new Dictionary <string, string>();

            data[IdTicketColmn]  = "" + this.IdTicket;
            data["[IdProbleme]"] = "" + probleme.IdProbleme;
            data["[date_p]"]     = "'" + this.DateFermeture + "'";
            this.insert(data);
            this.disconnect();
        }
Ejemplo n.º 7
0
        public void save(Probleme probleme, Solution solution)
        {
            this.connect();
            this.table = "[dbo].[Ticket_Proleme_Solution]";
            Dictionary <string, string> data = new Dictionary <string, string>();

            data[IdTicketColmn]  = "" + this.IdTicket;
            data["[IdProbleme]"] = "" + probleme.IdProbleme;
            data["[IdSolution]"] = "" + solution.IdSolution;

            this.insert(data);
            this.disconnect();
        }
 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;
 }
        public List <Solution> find_solution(SqlDataReader sql)
        {
            List <Solution>             solutions = new List <Solution>();
            Dictionary <string, string> id        = new Dictionary <string, string>();
            Probleme p = new Probleme();

            this.connect();
            SqlDataReader result = sql;

            while (result.Read())
            {
                id["IdProbleme"] = "" + result.GetInt32(2);
                p = p.find_by_id(id);

                solutions.Add(new Solution(
                                  result.GetInt32(0),
                                  result.GetString(1),
                                  p
                                  ));
            }
            this.disconnect();

            return(solutions);
        }
 public StatByProbleme(Probleme p, int nb)
 {
     this.probleme = p;
     this.Nbp      = nb;
 }