Example #1
0
        private void toolStripButton6_Click(object sender, EventArgs e)
        {

    
            if ((this.listDesTaches.SelectedIndex != -1) && (this.listDesTaches.SelectedIndices.Count != 0))
            {
                if (this.listDesTaches.SelectedIndex != 0)
                {
                    Taches SelectedTache = this.ttab[this.listDesTaches.SelectedIndex];
                    Taches AvantSelectedTache = this.ttab[this.listDesTaches.SelectedIndex - 1];

                    BDGestionAccess2013.SUPPRIME_TACHE(AvantSelectedTache);
                    BDGestionAccess2013.SUPPRIME_TACHE(SelectedTache);
                    BDGestionAccess2013.CREA_TACHE(SelectedTache, AvantSelectedTache.TacheID);
                    BDGestionAccess2013.CREA_TACHE(AvantSelectedTache, SelectedTache.TacheID);               
                    this.MiseAJour();
                }
                    

            }




        }
        public static void CREA_TACHE(Taches tach)
        {
            try
            {
                // -------------  creation d'une tache


                string ins = "Insert into taches (titret,descript,datdebt,datfint,heuredebt,heurefint,datecreat,heurecreat,auteurt,destinatt,archive) values ('" + tach.Titre.Replace("'", "''") + "','" +
                             tach.Description.Replace("'", "''") + "','" +
                             tach.Datdeb + "','" +
                             tach.Datfin + "','" +
                             tach.Heuredeb + "','" +
                             tach.Heurefin + "','" +
                             tach.Datcrea + "','" +
                             tach.Heurecrea + "'," +
                             tach.AuteurId + "," +
                             tach.DestinatId + "," +
                             tach.Archive + ")";

                OleDbCommand cmdacc = new OleDbCommand(ins, BDGestionAccess2013.connexion_access);

                int res = cmdacc.ExecuteNonQuery();

                // -------------------------------------------------------------
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message + " " + ex.StackTrace);
            }
        }
Example #3
0
        public CreerForm(Users SuperU, Form precedant, Taches taModifier)
        {
            InitializeComponent();

            this.ModeModif = true;
            this.formulaire_precedant = precedant;
            this.TacheCouranteAmodifier = taModifier;
            this.CreerButt.Text = "Modifier";
            this.SuperUser = SuperU;
        }
Example #4
0
        public CreerForm(Users SuperU, Form precedant, Taches taModifier)
        {
            InitializeComponent();

            this.ModeModif              = true;
            this.formulaire_precedant   = precedant;
            this.TacheCouranteAmodifier = taModifier;
            this.CreerButt.Text         = "Modifier";
            this.SuperUser              = SuperU;
        }
Example #5
0
        public int CompareTo(object obj)
        {
            Taches t      = (Taches)obj;
            int    result = this.titre.CompareTo(t.titre);

            if (result == 0)
            {
                result = this.titre.CompareTo(t.titre);
            }
            return(result);
        }
Example #6
0
        private void listDesTaches_Click(object sender, EventArgs e)
        {
            if (this.listDesTaches.SelectedIndex != -1)
            {
                Taches SelectedTache = this.ttab[this.listDesTaches.SelectedIndex];

                this.InfoLab.Text = SelectedTache.Titre;

                this.detailminibox.Text = "\r\n" + SelectedTache.Description.ToString() + "\r\n" + "\r\n";
            }
        }
Example #7
0
        private void listDesTaches_DoubleClick(object sender, EventArgs e)
        {
            if (this.listDesTaches.SelectedIndex != -1)
            {
                SelectedTacheModif = this.ttab[this.listDesTaches.SelectedIndex];

                this.detailminibox.Text = "\r\n" + SelectedTacheModif.Description.ToString() + "\r\n" + "\r\n";

                this.toolStripButton5_Click(sender, e);
            }
        }
Example #8
0
        private void toolStripButton8_Click(object sender, EventArgs e)
        {
            if ((this.listDesTaches.SelectedIndex != -1) && (this.listDesTaches.SelectedIndices.Count != 0))
            {

                for (int i = 0; i < this.listDesTaches.SelectedIndices.Count; i++)
                {
                    Taches SelectedTache = this.ttab[this.listDesTaches.SelectedIndices[i]];
                    BDGestionAccess2013.MODIFIE_TACHE_ARCHIVEMOINS(SelectedTache);
                }

                this.MiseAJour();
            }
        }
Example #9
0
        private void button2_Click(object sender, EventArgs e)
        {
            if ((this.listDesTaches.SelectedIndex != -1) && (this.listDesTaches.SelectedIndices.Count != 0))
            {

                for (int i = 0; i < this.listDesTaches.SelectedIndices.Count; i++)
                {
                    Taches SelectedTache = this.ttab[this.listDesTaches.SelectedIndices[i]];
                    BDGestionAccess2013.REPORT_A_HIER(SelectedTache, this.DateCourante);
                }

                this.MiseAJour();
            }
        }
Example #10
0
        private void toolStripButton4_Click(object sender, EventArgs e)
        {
            if (this.listDesTaches.SelectedIndex != -1)
            {
                Taches SelectedTache = this.ttab[this.listDesTaches.SelectedIndex];
                BDGestionAccess2013.SUPPRIME_TACHE(SelectedTache);
                this.MiseAJour();
            }
            else
            {
                this.detailminibox.Text = "\r\nSELECTIONNEZ D'ABORD UNE TACHE";
            }


        }
        public static void REPORT_UNE_DATE(Taches tach, DateTime dt)
        {
            try
            {
                string autredate = dt.ToShortDateString();


                string rqt = "Update taches set datdebt = '" + autredate + "' where idt = " + tach.TacheID;

                OleDbCommand cmdacc = new OleDbCommand(rqt, BDGestionAccess2013.connexion_access);

                int res = cmdacc.ExecuteNonQuery();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message + " " + ex.StackTrace);
            }
        }
Example #12
0
        private void dateTimePicker1_CloseUp(object sender, EventArgs e)
        {
            if ((this.listDesTaches.SelectedIndex != -1) && (this.listDesTaches.SelectedIndices.Count != 0))
            {

                for (int i = 0; i < this.listDesTaches.SelectedIndices.Count; i++)
                {
                    Taches SelectedTache = this.ttab[this.listDesTaches.SelectedIndices[i]];
                    BDGestionAccess2013.REPORT_UNE_DATE(SelectedTache, this.dateTimePicker1.Value);
                }

                this.MiseAJour();

            }
            else
            {
                this.detailminibox.Text = "\r\nChoisir une tache à reporter !";
            }

        }
        public static void SUPPRIME_TACHE(Taches tach)
        {
            try
            {
                // -------------  effacer une tache


                string del = "DELETE from taches where idt=" + tach.TacheID;

                OleDbCommand cmdacc = new OleDbCommand(del, BDGestionAccess2013.connexion_access);

                int res = cmdacc.ExecuteNonQuery();

                // -------------------------------------------------------------
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message + " " + ex.StackTrace);
            }
        }
        public static void MODIFIE_TACHE_ARCHIVEPLUS(Taches tach)
        {
            try
            {
                // -------------  modif d'une tache


                string ins = "Update taches set archive=true where idt=" + tach.TacheID;

                OleDbCommand cmdacc = new OleDbCommand(ins, BDGestionAccess2013.connexion_access);

                int res = cmdacc.ExecuteNonQuery();

                // -------------------------------------------------------------
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message + " " + ex.StackTrace);
            }
        }
        public static void MODIFIE_TACHE(Taches tach)
        {
            try
            {
                // -------------  modif d'une tache


                string ins = "Update taches set titret='" + tach.Titre.Replace("'", "''") + "',descript='" + tach.Description.Replace("'", "''") + "',datdebt='" + tach.Datdeb + "',datfint='" + tach.Datfin + "',heuredebt='" + tach.Heuredeb + "',heurefint='" + tach.Heurefin + "',destinatt=" + tach.DestinatId + ",archive=" + tach.Archive + " where idt=" + tach.TacheID;

                OleDbCommand cmdacc = new OleDbCommand(ins, BDGestionAccess2013.connexion_access);

                int res = cmdacc.ExecuteNonQuery();

                // -------------------------------------------------------------
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message + " " + ex.StackTrace);
            }
        }
Example #16
0
        private void listDesTaches_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (this.listDesTaches.SelectedIndex != -1)
            {
                Taches SelectedTache = this.ttab[this.listDesTaches.SelectedIndex];

                ToolTip l_myToolTip = new ToolTip();
                l_myToolTip.AutoPopDelay = 10000;
                l_myToolTip.BackColor = Color.Black;
                l_myToolTip.ForeColor = Color.White;
                l_myToolTip.ToolTipTitle = SelectedTache.Titre;

                if (SelectedTache.Datdeb == SelectedTache.Datfin)
                {
                    l_myToolTip.SetToolTip(this.listDesTaches, SelectedTache.Datdeb +"\r\n\t(" + SelectedTache.Heuredeb + "->" + SelectedTache.Heurefin + ")");
                }
                else
                {
                    l_myToolTip.SetToolTip(this.listDesTaches, SelectedTache.Datdeb + "->" + SelectedTache.Datfin + "\r\n\t(" + SelectedTache.Heuredeb + "->" + SelectedTache.Heurefin + ")");
                }
            }
        }
        public static List <Taches> REQUETEUR_TACHES(string requete)
        {
            List <Taches> Lt = new List <Taches>();

            try
            {
                OleDbCommand    cmdaccess = new OleDbCommand(requete, BDGestionAccess2013.connexion_access);
                OleDbDataReader lecteur   = cmdaccess.ExecuteReader();


                while (lecteur.Read())
                {
                    Taches t = new Taches(lecteur.GetInt32(0),
                                          lecteur.GetString(1).Replace("''", "'"),
                                          lecteur.GetString(2).Replace("''", "'"),
                                          lecteur.GetString(3),
                                          lecteur.GetString(4),
                                          lecteur.GetString(5),
                                          lecteur.GetString(6),
                                          lecteur.GetString(7),
                                          lecteur.GetString(8),
                                          lecteur.GetInt32(9),
                                          lecteur.GetInt32(10),
                                          lecteur.GetBoolean(11));
                    Lt.Add(t);
                }

                lecteur.Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message + "\r\n" + ex.InnerException);
            }



            return(Lt);
        }
        public static void REPORT_A_HIER(Taches tach, DateTime dt)
        {
            try
            {
                string today     = dt.ToShortDateString();
                string lendemain = dt.AddDays(-1).ToShortDateString();


                #region "report hier"

                string rqt = "Update taches set datdebt = '" + lendemain + "' where idt = " + tach.TacheID;

                OleDbCommand cmdacc = new OleDbCommand(rqt, BDGestionAccess2013.connexion_access);

                int res = cmdacc.ExecuteNonQuery();

                // -------------------------------------------------------------
                #endregion
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message + " " + ex.StackTrace);
            }
        }
        public static void REPORT_A_HIER(Taches tach, DateTime dt)
        {
            try
            {
                string today = dt.ToShortDateString();
                string lendemain = dt.AddDays(-1).ToShortDateString();


                #region "report hier"

                string rqt = "Update taches set datdebt = '" + lendemain + "' where idt = " + tach.TacheID;

                OleDbCommand cmdacc = new OleDbCommand(rqt, BDGestionAccess2013.connexion_access);

                int res = cmdacc.ExecuteNonQuery();

                // -------------------------------------------------------------
                #endregion
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message + " " + ex.StackTrace);
            }
        }
        public static void MODIFIE_TACHE(Taches tach)
        {
            try
            {

                // -------------  modif d'une tache


                string ins = "Update taches set titret='" + tach.Titre.Replace("'", "''") + "',descript='" + tach.Description.Replace("'", "''") + "',datdebt='" + tach.Datdeb + "',datfint='" + tach.Datfin + "',heuredebt='" + tach.Heuredeb + "',heurefint='" + tach.Heurefin + "',destinatt=" + tach.DestinatId + ",archive=" + tach.Archive + " where idt=" + tach.TacheID;

                OleDbCommand cmdacc = new OleDbCommand(ins, BDGestionAccess2013.connexion_access);

                int res = cmdacc.ExecuteNonQuery();

                // -------------------------------------------------------------

            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message + " " + ex.StackTrace);
            }
        }
        public static void CREA_TACHE(Taches tach)
        {
            try
            {

                // -------------  creation d'une tache


                string ins = "Insert into taches (titret,descript,datdebt,datfint,heuredebt,heurefint,datecreat,heurecreat,auteurt,destinatt,archive) values ('" + tach.Titre.Replace("'", "''") + "','" +
                                                                                                                                                                           tach.Description.Replace("'", "''") + "','" +
                                                                                                                                                                           tach.Datdeb + "','" +
                                                                                                                                                                           tach.Datfin + "','" +
                                                                                                                                                                           tach.Heuredeb + "','" +
                                                                                                                                                                           tach.Heurefin + "','" +
                                                                                                                                                                           tach.Datcrea + "','" +
                                                                                                                                                                           tach.Heurecrea + "'," +
                                                                                                                                                                           tach.AuteurId + "," +
                                                                                                                                                                           tach.DestinatId + "," +
                                                                                                                                                                           tach.Archive + ")";

                OleDbCommand cmdacc = new OleDbCommand(ins, BDGestionAccess2013.connexion_access);                                                                         

                int res = cmdacc.ExecuteNonQuery();

                // -------------------------------------------------------------

            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message + " " + ex.StackTrace);
            }
        }
        public static List<Taches> REQUETEUR_TACHES(string requete)
        {

            List<Taches> Lt = new List<Taches>();

            try
            {

                OleDbCommand cmdaccess = new OleDbCommand(requete, BDGestionAccess2013.connexion_access);
                OleDbDataReader lecteur = cmdaccess.ExecuteReader();


                while (lecteur.Read())
                {
                    Taches t = new Taches(lecteur.GetInt32(0), 
                                         lecteur.GetString(1).Replace("''","'"),
                                         lecteur.GetString(2).Replace("''", "'"), 
                                         lecteur.GetString(3),
                                         lecteur.GetString(4), 
                                         lecteur.GetString(5), 
                                         lecteur.GetString(6),
                                         lecteur.GetString(7), 
                                         lecteur.GetString(8), 
                                         lecteur.GetInt32(9),
                                         lecteur.GetInt32(10), 
                                         lecteur.GetBoolean(11));
                    Lt.Add(t);
                }

                lecteur.Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message+"\r\n"+ex.InnerException);
            }

          

            return Lt;

        }
        public static void REPORT_UNE_DATE(Taches tach, DateTime dt)
        {
            try
            {

                string autredate = dt.ToShortDateString();


                string rqt = "Update taches set datdebt = '" + autredate + "' where idt = " + tach.TacheID;

                OleDbCommand cmdacc = new OleDbCommand(rqt, BDGestionAccess2013.connexion_access);

                int res = cmdacc.ExecuteNonQuery();


            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message + " " + ex.StackTrace);
            }
        }
        public static void MODIFIE_TACHE_ARCHIVEPLUS(Taches tach)
        {
            try
            {

                // -------------  modif d'une tache


                string ins = "Update taches set archive=true where idt=" + tach.TacheID;

                OleDbCommand cmdacc = new OleDbCommand(ins, BDGestionAccess2013.connexion_access);

                int res = cmdacc.ExecuteNonQuery();

                // -------------------------------------------------------------

            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message + " " + ex.StackTrace);
            }
        }
        public static void SUPPRIME_TACHE(Taches tach)
        {
            try
            {

                // -------------  effacer une tache


                string del = "DELETE from taches where idt=" + tach.TacheID;

                OleDbCommand cmdacc = new OleDbCommand(del, BDGestionAccess2013.connexion_access);

                int res = cmdacc.ExecuteNonQuery();

                // -------------------------------------------------------------

            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message + " " + ex.StackTrace);
            }
        }