コード例 #1
0
ファイル: MBoyMain.cs プロジェクト: abdojobs/memoireboy
        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();
                }
                    

            }




        }
コード例 #2
0
        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);
            }
        }
コード例 #3
0
ファイル: CreerForm.cs プロジェクト: abdojobs/memoireboy
        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;
        }
コード例 #4
0
ファイル: CreerForm.cs プロジェクト: abdojobs/memoireboy
        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;
        }
コード例 #5
0
ファイル: Taches.cs プロジェクト: abdojobs/memoireboy
        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);
        }
コード例 #6
0
ファイル: MBoyMain.cs プロジェクト: abdojobs/memoireboy
        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";
            }
        }
コード例 #7
0
ファイル: MBoyMain.cs プロジェクト: abdojobs/memoireboy
        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);
            }
        }
コード例 #8
0
ファイル: MBoyMain.cs プロジェクト: abdojobs/memoireboy
        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();
            }
        }
コード例 #9
0
ファイル: MBoyMain.cs プロジェクト: abdojobs/memoireboy
        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();
            }
        }
コード例 #10
0
ファイル: MBoyMain.cs プロジェクト: abdojobs/memoireboy
        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";
            }


        }
コード例 #11
0
        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);
            }
        }
コード例 #12
0
ファイル: MBoyMain.cs プロジェクト: abdojobs/memoireboy
        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 !";
            }

        }
コード例 #13
0
        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);
            }
        }
コード例 #14
0
        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);
            }
        }
コード例 #15
0
        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);
            }
        }
コード例 #16
0
ファイル: MBoyMain.cs プロジェクト: abdojobs/memoireboy
        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 + ")");
                }
            }
        }
コード例 #17
0
        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);
        }
コード例 #18
0
        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);
            }
        }
コード例 #19
0
        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);
            }
        }
コード例 #20
0
        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);
            }
        }
コード例 #21
0
        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);
            }
        }
コード例 #22
0
        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;

        }
コード例 #23
0
        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);
            }
        }
コード例 #24
0
        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);
            }
        }
コード例 #25
0
        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);
            }
        }