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(); } } }
private void ChargerLesTitres() { string req = "select distinct(titret) from taches where archive=false"; List <string> tabstr = BDGestionAccess2013.REQUETEUR_TITRES_TACHES(req); foreach (string t in tabstr) { if (this.ModeModif) { if (this.TacheCouranteAmodifier.Titre != t) { this.titreBox.Items.Add(t); } } else { this.titreBox.Items.Add(t); } } if (this.ModeModif) { this.titreBox.Text = this.TacheCouranteAmodifier.Titre; this.descripBox.Text = this.TacheCouranteAmodifier.Description; } }
private void toolStripButton2_Click(object sender, EventArgs e) { if (this.SuperUser != null) { if (this.SuperUser.droitsuser == 1) { UersForm usersF = new UersForm(this); this.Hide(); usersF.Show(); } else { this.detailminibox.Text = "\r\nVous devez vous connecter en tant qu'administrateur."; } } else { int o = BDGestionAccess2013.COUNT("users", "select count(*) from users"); if (o ==0) { UersForm usersF = new UersForm(this); this.Hide(); usersF.Show(); } } }
private void MBoyMain_Init() { this.DateCourante = DateTime.Today; this.statusBar1.Text = ""; try { if (this.SuperUser != null) { string ut = "UTILISATEUR : "; if (this.SuperUser.droitsuser == 1) { ut = "ADMINISTRATEUR : "; } PersonneClass p = BDGestionAccess2013.GET_PERSONNEBY(this.SuperUser.persUserId); if (p != null) { this.statusBar1.Text = ut + p.prenom + " " + p.nom; } } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void supprButt_Click(object sender, EventArgs e) { try { if (this.personneAmodifier != null) { bool lob = BDGestionAccess2013.USERS_EXIST(this.personneAmodifier.idPers); if (!lob) { BDGestionAccess2013.SUPPRIME_PERSONNE(this.personneAmodifier); } else { this.InfoLab.Text = " la personne est un utilisateur : suppression impossible"; } this.InitialiserLesChamps(); this.RechargerContacts(); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void RechercheContactsForm_Load(object sender, EventArgs e) { try { string app = Application.StartupPath; app = app + @"\images\MBoy.ico"; this.Icon = new Icon(app); this.comboBox1.SelectedText = "M"; this.listBox1.Items.Clear(); string req = "select * from personnes where nompers like '" + this.rechercheBox.Text + "%' or prenompers like '" + this.rechercheBox.Text + "%'"; tabpers = BDGestionAccess2013.REQUETEUR_PERSONNES(req); foreach (PersonneClass p in tabpers) { this.listBox1.Items.Add(p.AffichagePersonne); } this.miseAjourGroupes(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); MBoyForm mbf_log; MBoyMain mbm; int o = -1; bool bol = BDGestionAccess2013.OUVRIRconnexionBD("memoireboy2013"); if (bol) { o = BDGestionAccess2013.COUNT("users", "select count(*) from users"); bool lob = BDGestionAccess2013.FERMERconnexionBD("memoireboy2013"); } if (o > 0) { mbf_log = new MBoyForm(); Application.Run(mbf_log); } else { mbm = new MBoyMain(); Application.Run(mbm); } }
private void chargerMessagesPermanents() { this.MessagesPerm.Clear(); this.MessagesPerm = BDGestionAccess2013.LIRE_MESSAGES_PERMANENTS(); this.MaxMess = this.MessagesPerm.Count; this.afficherMessagesPerm(); }
private void buttonCreerGRP_Click(object sender, EventArgs e) { if (this.textBoxGRPCrea.Text != "") { BDGestionAccess2013.CREA_GROUPES(this.textBoxGRPCrea.Text); miseAjourGroupes(); } this.textBoxGRPCrea.Text = ""; }
private void JourModifier_Click(object sender, EventArgs e) { if (this.JOURNAL_box.Text != "") { string txt = this.JOURNAL_box.Text.Replace("'", "''"); txt = Encrypt.EncryptString(txt); BDGestionAccess2013.MODIF_JOUR_DS_JOURNAL(txt, this.DateCourante.ToShortDateString()); } this.MiseAJourDuJournal(); }
private void VerifierBaseMESSAGESPERM2013() { bool ok = BDGestionAccess2013.TABLE_EXIST("messperm"); if (!ok) // je crée la table messperm V2013 BETA VERSION { BDGestionAccess2013.CREATE_TABLE("CREATE TABLE messperm ([idmess] AUTOINCREMENT NOT NULL PRIMARY KEY , [mess] MEMO NULL)"); } }
private void VerifierBaseJournal2013() { bool ok = BDGestionAccess2013.TABLE_EXIST("journal"); if (!ok) // je crée la table journal V2013 BETA VERSION { BDGestionAccess2013.CREATE_TABLE("CREATE TABLE journal ([idj] AUTOINCREMENT NOT NULL PRIMARY KEY , [textj] MEMO NULL, [datej] VARCHAR(20))"); } }
private void listDesTaches_KeyDown(object sender, KeyEventArgs e) { if (this.listDesTaches.SelectedIndex != -1) { switch (e.KeyCode) { case Keys.M: this.SelectedTacheModif = this.ttab[this.listDesTaches.SelectedIndex]; this.toolStripButton5_Click(sender, e); break; // modifier case Keys.Delete: BDGestionAccess2013.SUPPRIME_TACHE(this.ttab[this.listDesTaches.SelectedIndex]); this.MiseAJour(); break; // supprimer case Keys.A: this.toolStripButton11_Click(sender, e); break; } } }
private void button6_Click(object sender, EventArgs e) { if (this.messagesaleabox.Text != "") { BDGestionAccess2013.CREA_MESSAGE_PERMANENT(this.messagesaleabox.Text); this.chargerMessagesPermanents(); } else { this.detailminibox.Text = "\r\nSaisir un texte dans les rappels permanents !"; } }
private void rechercheBox_TextChanged(object sender, EventArgs e) { this.listBox1.Items.Clear(); string req = "select * from personnes where nompers like '" + this.rechercheBox.Text + "%' or prenompers like '" + this.rechercheBox.Text + "%'"; List <PersonneClass> tabpers = BDGestionAccess2013.REQUETEUR_PERSONNES(req); foreach (PersonneClass p in tabpers) { this.listBox1.Items.Add(p.AffichagePersonne); } }
private void RechargerContacts() { this.listBox1.Items.Clear(); string req = "select * from personnes where nompers like '" + this.rechercheBox.Text + "%' or prenompers like '" + this.rechercheBox.Text + "%'"; tabpers = BDGestionAccess2013.REQUETEUR_PERSONNES(req); foreach (PersonneClass p in tabpers) { this.listBox1.Items.Add(p.AffichagePersonne); } }
private void RechargerUsers() { this.listBox1.Items.Clear(); string req = "select * from personnes"; tabpers = BDGestionAccess2013.REQUETEUR_PERSONNES(req); foreach (PersonneClass p in tabpers) { this.listBox1.Items.Add(p.AffichagePersonne); } }
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(); } }
private void CreerForm_Load(object sender, EventArgs e) { try { string app = Application.StartupPath; app = app + @"\images\MBoy.ico"; this.Icon = new Icon(app); this.ChargerLesTitres(); this.ChargerLesUsers(); this.HeureBox.Text = DateTime.Now.ToShortTimeString(); this.heureBox2.Text = DateTime.Now.AddHours(1).ToShortTimeString(); if (this.ModeModif) { int o = BDGestionAccess2013.COUNT("users", "select count(*) from users"); this.dateTimePicker1.Value = DateTime.Parse(this.TacheCouranteAmodifier.Datdeb); this.dateTimePicker2.Value = DateTime.Parse(this.TacheCouranteAmodifier.Datfin); this.checkBox1.Checked = this.TacheCouranteAmodifier.Archive; if (o > 0) { PersonneClass pepe = BDGestionAccess2013.GET_PERSONNEBY(this.TacheCouranteAmodifier.DestinatId); if (pepe != null) { this.destCombo.SelectedItem = pepe.prenom + " " + pepe.nom; } } } else { if (this.SuperUser != null) { PersonneClass meme = BDGestionAccess2013.GET_PERSONNEBY(this.SuperUser.persUserId); if (meme != null) { this.destCombo.SelectedItem = meme.prenom + " " + meme.nom; } } } } catch (Exception ex) { MessageBox.Show("erreur pepe " + "\r\n" + ex.Message); } }
private void button7_Click(object sender, EventArgs e) { if (this.messagesaleabox.Text != "") { BDGestionAccess2013.SUPPRIME_MESSAGE_PERMANENT(this.messagesaleabox.Text); this.messagesaleabox.Text = ""; this.detailminibox.Text = "\r\nMESSAGE SUPPRIME !"; this.chargerMessagesPermanents(); } else { this.detailminibox.Text = "\r\nChoisir un message à supprimer !"; } }
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(); } }
private void button1_Click(object sender, EventArgs e) { WebClient _webClient = new WebClient(); try { string urlDuFichier = @"http://www.memoireboy.fr/memoireboy/version.txt"; WebClient wc = new WebClient(); System.IO.Stream st = wc.OpenRead(urlDuFichier); System.IO.StreamReader sr = new System.IO.StreamReader(st); string fichierEntier = sr.ReadToEnd().Trim(); wc.Dispose(); BDGestionAccess2013.OUVRIRconnexionBD("MemoireBoy2013"); int vs = Convert.ToInt32(fichierEntier); int oldversion = Convert.ToInt32(BDGestionAccess2013.LIT_OLDVERSIONMB()); if (vs > oldversion) { this.metAJlaVersionDsBD(vs.ToString()); } string url_exe = "http://www.memoireboy.fr/memoireboy/memoireboy2013.exe"; string _path = Application.StartupPath + @"\" + "MemoireBoy2013.exe"; if (vs > oldversion) { if (File.Exists(Application.StartupPath + @"\" + "MemoireBoy2013.exe")) { File.Delete(Application.StartupPath + @"\" + "MemoireBoy2013.exe"); } _webClient.Headers.Add("User-Agent", "Mozilla"); _webClient.DownloadFileCompleted += new AsyncCompletedEventHandler(_webClient_DownloadFileCompleted); _webClient.DownloadProgressChanged += new DownloadProgressChangedEventHandler(_webClient_DownloadProgressChanged); _webClient.DownloadFileAsync(new Uri(url_exe), _path); this.button1.Text = "téléchargement en cours..."; } BDGestionAccess2013.FERMERconnexionBD("MemoireBoy2013"); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
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"; } }
private void menuItem3_Click(object sender, EventArgs e) { openFileDialog1.Filter = "access Files (.mdb)|*.mdb"; openFileDialog1.FilterIndex = 1; openFileDialog1.FileName = ""; DialogResult result = openFileDialog1.ShowDialog(); if (result == DialogResult.OK) { string file = openFileDialog1.FileName; BDGestionAccess2013.TotalPathForBase = file; BDGestionAccess2013.OUVRIRconnexionBD("memoireboy2013.mdb"); } }
private void JourCreer_Click(object sender, EventArgs e) { if (this.JOURNAL_box.Text != "") { string txt = this.JOURNAL_box.Text; txt = Encrypt.EncryptString(txt); BDGestionAccess2013.CREA_JOUR_DS_JOURNAL(txt, this.DateCourante.ToShortDateString()); this.MiseAJourDuJournal(); } else { this.detailminibox.Text = "\r\nSAISIR UN TEXTE !"; } }
private void button5_Click(object sender, EventArgs e) { if ((this.listBoxGRP_2.SelectedIndex != -1)) { string lib = this.listBoxGRP_2.SelectedItem.ToString(); this.listBoxGRP_1.Items.Add(this.listBoxGRP_2.SelectedItem); this.listBoxGRP_2.Items.Remove(this.listBoxGRP_2.SelectedItem); int num = BDGestionAccess2013.GROUPES_GETIDBYLIB(lib); BDGestionAccess2013.DELETE_GRPPERS(num, personneAmodifier.idPers); } else { this.InfoLab.Text = "Selectionnez un groupe dans la liste de droite"; } }
private void button6_Click(object sender, EventArgs e) { string g = ""; if ((this.comboBoxSupprGRP.SelectedItem != null)) { if (this.comboBoxSupprGRP.SelectedItem.ToString() != "") { g = this.comboBoxSupprGRP.SelectedItem.ToString(); int num = BDGestionAccess2013.GROUPES_GETIDBYLIB(this.comboBoxSupprGRP.SelectedItem.ToString()); BDGestionAccess2013.DELETE_GROUPE(num); this.InfoLab.Text = "Le groupe " + g + " a été supprimé"; this.miseAjourGroupes(); } } }
private void button12_Click(object sender, EventArgs e) { if(this.rechercheBox.Text!="") { string rech = this.rechercheBox.Text; ttab = BDGestionAccess2013.REQUETEUR_TACHES("select * from taches where descript like '%" + rech + "%'"); this.listDesTaches.Items.Clear(); foreach (Taches t in ttab) { this.listDesTaches.Items.Add(t.Description); } } }
private void ChargerLesUsers() { try { string requete = "select * from personnes,users where personnes.idpers = users.persuserid"; tp = BDGestionAccess2013.REQUETEUR_PERSONNES(requete); foreach (PersonneClass pers in tp) { this.destCombo.Items.Add(pers.prenom + " " + pers.nom); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void MiseAJourDuJournal() { string rq = "select * from journal where datej='" + this.DateCourante.ToShortDateString() + "'"; string txt = BDGestionAccess2013.REQUETEUR_JOURNAL(rq); if (!this.EncryptBool) { if (txt != "") { txt = Encrypt.DecryptString(txt); } } this.JOURNAL_box.Text = ""; this.JOURNAL_box.Text = txt; }