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 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 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); } }